To stop an AI agent from deleting data, remove the access it does not need, check every command and query before it runs, hold irreversible ones for a person, and keep backups for what gets through.
Steps
- Take away what is not needed. No production credentials in a development agent. Read-only database users where the task is reading. See least privilege.
- Isolate. Run commands in a sandbox with a working copy, not the real thing.
- Check each action before it runs. Read the command and its arguments:
rm -rfon a path outside the workspace,DROPorTRUNCATE, aDELETEwith noWHERE, a force push, a bucket deletion, aterraform destroy. - Hold what cannot be undone. Send it to a person with the exact command and its target. See human-in-the-loop.
- Make undo real. Backups, soft deletes, protected branches, versioned buckets.
- Record it. Keep the trace of what ran and who approved it.
What does not work alone
- "Never delete anything" in the system prompt. The model can be argued out of it, or forget it forty steps in. See system prompt vs guardrails.
- A blocklist of command strings.
rmhas many spellings, and a script can do the same thing. - Approving everything. People stop reading.
With White Circle
Control checks terminal commands, code execution and API calls against your policies before they run, and a policy can block the call or hold it for confirmation.
