The irreversible tool
Step 1 · The pattern
An agent that runs commands
A coding agent works through tasks: write code, run migrations, run scripts, against the development database. Now and then it chooses a destructive command (dropping a table to rebuild it), which is fine there. (All numbers are illustrative.)
- a task
- done
In short
The irreversible tool: how it works and how it breaks
Coding and operations agents run commands: migrations, scripts, deployments. Given production credentials 'to be helpful', they can do anything those credentials allow, and a model that misreads the situation will sometimes decide on something destructive, such as dropping a table. Nothing in the model makes that impossible. OpenAI's practical guide to building agents recommends rating each tool by risk (read or write, reversible or not, the permissions it needs, its financial impact) and escalating to a person for high-risk actions or repeated failures. Give agents development credentials by default, keep production out of reach unless a task needs a scoped, temporary grant, put human approval in front of anything irreversible, and make sure what agents can touch has tested, quick restores. The access is the risk, not the agent.
What this simulation simplifies
- Destructive choices happen at a fixed rate; in reality they are rare, which is why they surprise.
- Approval is instant here; real approvals pause the run until a person responds.
How this comes up in interviews
"You are giving an AI agent the ability to run commands in your infrastructure. How do you keep it safe?"
Then they ask
- Which commands need approval?
- Which credentials does it get?
- What if it still goes wrong?
A strong answer covers
- Rate tools by risk: read/write, reversibility, permissions, money.
- Development credentials by default; scoped, temporary production grants.
- Human approval for irreversible or high-impact actions.
- Sandboxes; changes go through normal review and deploys.
- Tested restores; audit logs of every tool call.
Points to cover, not a script. Say them in your own words and tie them to a system you have worked on.
On one page: the track cheat sheet.
Sources: OpenAI: A practical guide to building agents (tool risk ratings, human intervention) ↗ · Anthropic engineering: Building effective agents (sandboxing, human checkpoints) ↗ · Report a problem
Diagrams are our own simulations: the timings, rates and counts in them are illustrative, not measurements. Captions are original wording.