How to Enable OpenClaw Exec Approval (Shell Command Safety)
2 min read
Your agent can rm -rf your entire machine. Whatever you can do in a terminal, your agent can do too. One config change puts you in control.
How It Works
Exec approval mode shows you every shell command before it runs. You approve or deny. Simple.
Enable it in openclaw.json:
{
"exec": {
"ask": "always"
}
}The three modes:
"always"— Every command needs approval. Safest option."on-miss"— Only ask for commands not in your allowlist."off"— No approval. Commands run immediately. Dangerous.
What You'll See
⚡ Exec request:
rm -rf node_modules && npm install
[Approve] [Deny]You catch problems before they happen. Typos, wrong directories, destructive commands — all visible before execution.
When to Skip It
Almost never. The only case for "off" is a fully sandboxed environment (Docker container or VM) where nothing important exists.
"on-miss" is reasonable once you've built a solid allowlist. But one mistake in that list could be catastrophic.
Your Last Line of Defense
Your agent is smart, but it makes mistakes. It might misunderstand your request. It might hallucinate a dangerous command. It might try something "helpful" that destroys your work.
Exec approval is the human-in-the-loop that catches it. A little tedious? Yes. Worth it? Absolutely.