Sure they can, look up harnesses and tool APIs.
See but no, that isn't the LLM. That's the harness or the MCP server or whatever. That is a piece of code that is deterministic exactly like almost everything else ever written. That's where you can quite easily and obviously prevent the "AI" (an LLM) from "going rogue".
It's code. It could easily require someone to say "approve" before doing a fucking thing.