What changed on June 19, 2026
This closes the exact failure that builders have reported over and over: you ask an agent to "roll back," it runs
git reset --hard instead of a safe checkout, and every uncommitted change is gone with no undo. Issue #17190 is one public report of exactly this — roughly a day of uncommitted work destroyed by a single command. The guard does not promise to prevent all data loss; it blocks a specific, named set of destructive commands in auto mode unless you opted in to discarding work.The full blocked-command list (auto mode, by default)
- git reset --hard — blocked when you didn't ask to discard local work.
- git checkout -- . — blocked when you didn't ask to discard local work.
- git clean -fd — blocked when you didn't ask to discard local work.
- git stash drop — blocked when you didn't ask to discard local work.
- git commit --amend — blocked when the commit wasn't made by the agent in this session.
- terraform destroy / pulumi destroy / cdk destroy — blocked unless you asked for the specific stack.
How to confirm you have the guard
- Update: run
claude updateto pull the latest build. - Check the version: run
claude --version— anything 2.1.183 or higher has the guard built in. - No config needed: there is nothing to enable. In auto mode, the blocks are on by default.
Three settings that keep an unattended agent on a leash
- 1. Scope the working directory + permissions. Run the agent against a single project path and deny it write/exec outside that path. The smaller the blast radius, the less a stray command can touch.
- 2. Commit (or auto-commit) before any agent run. The guard protects uncommitted work — so the cheapest insurance is to have nothing uncommitted. A pre-run
git add -A && git commit(or a wip-commit hook) means even a bypass can be undone with a checkout, not a recovery. - 3. Keep destructive commands behind explicit confirmation. For infra especially, don't grant the agent blanket auto-approval for
destroy-class commands. Require a human-named stack and a confirmation step so 'tear it all down' can never be an inferred action.
Why this matters if you build or resell with AI
Get the next drop
New AI build guides + the occasional bonus template. No spam, unsubscribe anytime.
By submitting you agree to our Privacy Policy & Terms. Unsubscribe anytime.