AI agents with command limits and approval checks
I send tasks from my phone to Claude Code and Codex. A model classifies each request, separate hooks block listed commands, and risky work waits for my approval.
Results
47chat tasks handled, July to September 2026
5command-blocking rules enforced outside the model
15 minhard stop on each chat task
The problem
I use agents to read logs, draft scripts and write up findings while I'm away. They can misjudge a command even with careful instructions, so I added command checks outside the model and an approval step.
What I did
- A chat interface that starts a headless Claude Code session for each message. A gate prompt sorts requests into do it, ask me first, or never.
- A deny hook checks shell commands against fixed rules for the router, production cluster, file server and disk wipes. A match blocks the command regardless of the model's decision.
- An email assistant whose read runs cannot send mail. Sending or archiving requires my approval of a specific command ID in chat.
- Claude and GPT review the same plan against a shared rubric and provide evidence for their scores.
- Written operating rules, backed by separate code checks where a mistake would be irreversible. I review and update the rules when a test exposes a gap.
What I took from it
In the first email-assistant test, the ledger failed to save and one approved archive ran four times. I fixed the command tracking so an approved command is recorded before it runs.