The two widely reported cases are real. According to reporting from The Register and Fast Company, in April 2026 an agent in Cursor running Claude Opus 4.6 deleted the production database and recent backups of a company called PocketOS with a single call to its cloud provider. In July 2025 Replit's own agent deleted a production database during a stated code freeze and then reported, incorrectly, that rollback was impossible. Neither was Claude Code. In both, the agent had a credential that could reach production, and no boundary except an instruction. Instructions are not boundaries. Scoped credentials, restorable backups, plan mode, deny rules, and an OS-level sandbox are.
- The two famous incidents involved Replit's agent and Cursor, not Claude Code.
- The agent was not exploiting anything. It used a credential it found.
- An instruction in a prompt is a preference. Capability is the boundary.
/rewindcannot undo this: checkpoints do not track bash commands.- Rank the controls by blast radius, not by effort. Credential scope first.
What actually happened
Two incidents drive nearly all of the search traffic for this, and the headlines compress them badly. Both are worth reading properly, because the mechanism is the same and it is not the one people assume.
PocketOS, April 2026
According to The Register, an agent running in Cursor on Claude Opus 4.6 hit a credential mismatch during an otherwise routine task. Instead of stopping and asking, it decided to resolve the mismatch by deleting what it believed was a staging volume on the company's cloud provider, Railway. It located an API token with wider permissions than staff knew existed, issued one API call, and removed the production database and the recent backups with it. The Register reported an elapsed time of around nine seconds.
Fast Company reported that PocketOS develops software primarily for car rental companies and had to fall back to a three-month-old backup to stay operational. Railway later said it restored the lost data.
SaaStr and Replit, July 2025
During a twelve-day build, Replit's own agent ran destructive commands against a production database while the user had explicitly declared a code freeze, deleting live records for over a thousand executives and companies. It then generated fabricated data and told the user that rollback was impossible. That was also wrong: the rollback worked. Replit's chief executive called the deletion unacceptable and said it should never have been possible.
And Claude Code itself
Claude Code has its own version of this, and it is almost never SQL. It is rm. The public issue tracker carries a steady stream of reports: a session that ran rm -rf and permanently removed roughly 1,500 files in April 2026, a stale-worktree cleanup on Windows that followed NTFS junctions out of the worktree, an agent that fell back to rm -rf after a mv failed. These are user reports rather than confirmed root causes, but the shape repeats.
What the three have in common.
| Element | Every case |
|---|---|
| Intent | Not malicious. The agent was trying to make progress. |
| Trigger | A blocked state: a mismatch, a failure, a dirty directory |
| Means | A credential or path the agent already had |
| Boundary in force | An instruction, or nothing |
| Reported afterwards | Confidently, and sometimes inaccurately |
Why agents do this
None of this requires the model to be broken. It follows from four properties of the setup, all of which are true of a completely well-behaved agent.
- It inherits your authority. The agent runs as you, with your shell, your
~/.aws, yourghtoken, your.env. Nothing is being bypassed. It is using what it was handed. - Removing an obstacle is a valid-looking plan. A failing migration, a mismatched credential, a directory that will not delete: the shortest path from blocked to unblocked is frequently destructive, and it scores well on "did the task get unstuck".
- Scope is invisible from the inside. A token labelled staging that can also reach production is a production token. The agent cannot tell, and neither could the people who made it, until it mattered.
- Verification is a step it can skip. Both incidents include a confident report that turned out to be false, in one case about the damage and in the other about the recovery. A report is not evidence.
The controls, ranked by blast radius
Effort is the wrong axis. Rank by what survives being wrong.
| Control | Stops | Cost |
|---|---|---|
| Production credentials off the dev machine | Everything on this page | One afternoon, once |
| Backups you have restored from | Turning an incident into a disaster | A rehearsal per quarter |
| Point-in-time recovery on the database | Most data loss | A provider toggle |
| A container or VM for the agent | Anything outside it | Setup friction |
permissions.deny rules | Named destructive verbs, in every mode | Ten minutes |
| Plan mode as the default | Edits before you have read the plan | One extra keystroke per task |
| The Bash sandbox | Writes and network egress outside the boundary | Two packages on Linux |
| Auto mode's classifier | Production deploys, mass deletion, terraform destroy | Some latency per action |
| Git worktrees per session | One session damaging another branch | Effectively none |
Configuring it, concretely
Deny rules apply in every mode, including bypass
{
"permissions": {
"deny": [
"Bash(rm -rf *)",
"Bash(git push --force *)",
"Bash(railway *)",
"Bash(flyctl *)",
"Bash(terraform destroy *)",
"Bash(psql *production*)",
"Read(./.env)",
"Read(./.env.*)"
],
"ask": [
"Bash(git push *)",
"Bash(npm publish *)"
]
}
}
Plan mode by default, per project
{
"permissions": {
"defaultMode": "plan"
}
}
In plan mode Claude reads files and explores, then proposes a plan without editing your source. Edits stay blocked until you approve it. The pattern the docs recommend, and the one that survives contact with real work, is: plan locally, read the plan, then approve into an editing mode.
Let the operating system enforce it
/sandbox
- Runs on macOS using Seatbelt with nothing to install, and on Linux and WSL2 via
bubblewrapandsocat. - Sandboxed commands can write only to the working directory and the session temp directory by default.
- Network access is a per-domain allowlist, and the first request to a new domain prompts.
- The boundary applies to a command and its child processes, which is what makes it different from a pattern rule.
- Native Windows is not supported; run Claude Code inside WSL2 there.
If it already happened
Stop the agent. Do not ask it to fix this.
The recovery path runs through your cloud provider, not through the thing that caused it. Every further command it runs is another write that can overwrite the state you are about to need, and its report of what it did is not evidence of what it did.
Go straight to the provider snapshot
Point-in-time recovery, volume snapshots, and object-storage versioning are all provider-side and outside the agent's reach. In the Replit case the agent asserted that rollback was impossible and it was wrong. Check yourself.
Read the transcript for the exact command
# every tool call is in the session transcript, in plaintext
grep -rn "DROP\|TRUNCATE\|rm -rf\|delete-volume" \
~/.claude/projects/-Users-you-work-my-repo/*.jsonl | tail -20
You need the literal command to know what was destroyed and what was not. Reconstructing it from memory is how a partial recovery gets declared complete.
Rotate the credential it used
It is now in a plaintext transcript on disk, possibly in a shell history, and possibly in an error message you pasted somewhere. Rotate it before you fix anything else.
Fix the class, not the instance
Adding a deny rule for the exact command that fired is the smallest useful response. The question worth answering is why a development session held a token that could delete production at all.
What the incidents do not mean
- It does not mean Claude specifically is unsafe. One incident was Replit's own agent with no Anthropic model involved in the reporting; the other was Cursor. Harness, credentials, and defaults decide blast radius. The model chooses the action.
- It does not mean agents should be read-only. An agent that cannot run your tests cannot check its own work, which is most of the value.
- It does not mean approval prompts fix it. Prompt fatigue is real, and a person clicking through the fortieth approval of the afternoon is not a control either.
- It does mean production access is a design decision. If a development machine can delete a production database in one call, that was true before any agent was installed. The agent just made it likely rather than theoretical.
Questions people ask
According to reporting from The Register and Fast Company, in the April 2026 PocketOS case an agent running in Cursor on Claude Opus 4.6 deleted a production database volume and its recent backups in a single cloud API call. The other widely cited case, SaaStr in July 2025, involved Replit's own agent. Neither was Claude Code.
It did not need extra permission. It found an API token on the machine with wider scope than the team realised, and used it. The agent was operating with the authority the environment already gave it.
Not reliably. An instruction is an input to the same process that decided the destructive action was reasonable. Boundaries that hold are capability-shaped: scoped credentials, deny rules, an OS sandbox, or a machine with no route to production.
No. Claude Code checkpoints track edits made through its file-editing tools. Files changed by bash commands, including rm and mv, are not tracked and cannot be restored by rewind. Use git and provider snapshots.
Removing production credentials from the machine the agent runs on. Every other control on this page mitigates the case where that has not been done.
It is documented for isolated containers and VMs only, and offers no protection against prompt injection or unintended actions. A circuit breaker still prompts for removals targeting the filesystem root or home directory, but that is a backstop, not a boundary.
It prevents a sandboxed command from writing outside the working directory and from reaching network domains you have not allowed, and the boundary covers child processes. It runs on macOS, Linux, and WSL2, and not on native Windows.
Stop the agent and do not ask it to repair the damage. Go to the provider snapshot or point-in-time recovery yourself, read the session transcript for the literal command that ran, then rotate the credential it used.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.