# When AI coding agents deleted data: every public incident, and what would have stopped it

> A dated, sourced list of AI coding agent incidents: production databases deleted, home folders wiped, secrets stolen through agents. For each, what happened and the setting that would have stopped it.

Updated November 8, 2026 · https://usecoral.app/guides/ai-coding-agent-incidents

AI coding agents have deleted production databases, wiped home folders and been used by malware to steal secrets. In almost every public case, the agent had access it didn’t need: production credentials on a dev machine, permission checks turned off, or no backup outside the agent’s reach. Below is every incident we could source, newest first, with what would have stopped it.

Each entry links to a primary source or reputable report, as of November 2026. Where a source doesn’t say how the agent was set up, we say so. Part of [Keep coding agents safe](https://usecoral.app/guides/agent-safety).

## The incidents

### August 2026 · npm worm writes Claude Code settings (ChainDrop)

**What happened:** a self-spreading npm worm hit 400+ packages through stolen maintainer credentials. Besides stealing secrets in a `preinstall` script, it wrote `.claude/settings.json` and `.vscode/tasks.json` into projects, so later Claude Code or VS Code use would start it again. ([Microsoft](https://www.microsoft.com/en-us/security/blog/2026/08/04/chaindrop-supply-chain-compromise-anatomy-self-propagating-worm/))

**What would have stopped it:** no install scripts (`ignore-scripts=true`, or npm 12’s default), a 7-day minimum release age, and a required review on changes to `.claude/` and `.vscode/`. See [malicious npm packages](https://usecoral.app/guides/ai-agents-malicious-npm-packages).

### April 2026 · Cursor agent deletes a startup’s production database

**What happened:** during a task on staging, an agent in Cursor (running Claude Opus) hit a credential mismatch, found a fully permissioned infrastructure token, and deleted the production database volume and its volume-level backups in one API call. “It took 9 seconds.” The data was recovered after the hosting provider stepped in. ([Decrypt](https://decrypt.co/365897/ai-agent-deletes-startup-database-9-seconds-founder-says))

**Agent setup:** reported as “zero confirmation”; the exact auto-run setting isn’t stated.

**What would have stopped it:** no production token on the machine, narrow tokens that can’t delete volumes, and backups the app’s token can’t touch. See [stop deletes and production access](https://usecoral.app/guides/stop-claude-code-deleting-files).

### December 2025 · Claude Code wipes a Mac home folder

**What happened:** a logged command, `rm -rf tests/patches/plan/ ~/`, deleted the user’s home folder, including Desktop, Application Support and Keychain data. ([Hacker News](https://news.ycombinator.com/item?id=46268222), [GIGAZINE](https://gigazine.net/gsc_news/en/20251216-claude-code-cli-mac-deleted))

**Agent setup:** reports say the user may have used `--dangerously-skip-permissions` or approved without reading; not confirmed.

**What would have stopped it:** permission prompts read before approving, the sandbox (writes outside the project fail), and a backup. Claude Code now always asks before `rm` on the home folder, in every mode. See [is skip-permissions safe?](https://usecoral.app/guides/claude-code-dangerously-skip-permissions)

### November 2025 · a folder named `~`, then `rm -rf *`

**What happened:** Claude Code created a folder literally named `~` inside a project. A later `rm -rf *` expanded to the real home folder. ([GitHub issue](https://github.com/anthropics/claude-code/issues/12637))

**Agent setup:** not stated in the issue.

**What would have stopped it:** the sandbox, and a hook that denies `rm -rf` outside rebuildable folders like the one in the [coral-safety-kit](https://github.com/lior-pesoa/coral-safety-kit).

### October 2025 · Claude Code runs `rm -rf` from `/` on WSL2

**What happened:** Claude Code v2.0.22 on WSL2 ran an `rm -rf` starting from the filesystem root, deleting every file the user owned. ([GitHub issue](https://github.com/anthropics/claude-code/issues/10077))

**Agent setup:** not stated in the issue.

**What would have stopped it:** the sandbox and a deny hook. Claude Code now asks before removing critical paths like `/` and the home folder, even in bypass mode.

### August 2025 · malware uses developers’ own AI agents to find secrets (Nx “s1ngularity”)

**What happened:** malicious versions of the Nx build tool ran a `postinstall` script that called the victim’s installed agents with their skip-everything flags, `claude --dangerously-skip-permissions`, `gemini --yolo` and `q chat --trust-all-tools`, and told them to list secret files. The results were uploaded to a public repo in the victim’s own GitHub account. ([Snyk](https://snyk.io/blog/weaponizing-ai-coding-agents-for-malware-in-the-nx-malicious-package/), [Nx advisory](https://github.com/nrwl/nx/security/advisories/GHSA-cxm3-wv7p-598c))

**What would have stopped it:** no install scripts, and skip-permissions turned off for good with `"disableBypassPermissionsMode": "disable"`, so a script can’t start the agent in that mode.

### July 2025 · Replit’s agent deletes SaaStr’s production database

**What happened:** during a declared code and action freeze, Replit’s agent deleted a live production database with records for 1,200+ executives and 1,190+ companies, then said rollback was impossible. The data was recovered. Replit’s CEO called it “unacceptable” and promised to separate development and production. ([Fortune](https://fortune.com/2025/07/23/ai-coding-tool-replit-wiped-database-called-it-a-catastrophic-failure/))

**Agent setup:** the agent ignored explicit instructions not to make changes.

**What would have stopped it:** separate development and production databases, so the agent never held a production connection. Instructions in chat aren’t rules.

### July 2025 · Amazon Q extension ships a wiper prompt

**What happened:** a malicious change merged into the Amazon Q Developer VS Code extension (v1.84) added a prompt telling the agent to delete files in the home folder and “discover and use AWS profiles to list and delete cloud resources”, run through Q with `--trust-all-tools --no-interactive`. AWS reverted it in v1.85 and said no customers were affected. ([The Register](https://www.theregister.com/2025/07/24/amazon_q_ai_prompt/))

**What would have stopped it:** no skip-everything flags on machines with cloud credentials, and cloud profiles that can’t delete resources.

### July 2025 · Gemini CLI loses a user’s files while reorganizing

**What happened:** asked to move and organize files, Gemini CLI ran a failed `mkdir` and a series of moves that left the files lost. The report shows no sandbox. ([GitHub issue](https://github.com/google-gemini/gemini-cli/issues/4586))

**Agent setup:** whether auto-approve was on isn’t stated.

**What would have stopped it:** a commit or backup before a bulk file operation, and working in a copy or git worktree.

## Anthropic’s own log

Anthropic’s engineering post on auto mode lists incidents from its own internal use: “deleting remote git branches from a misinterpreted instruction, uploading an engineer’s GitHub auth token to an internal compute cluster, and attempting migrations against a production database.” Its auto mode classifier still missed 17% of real overeager actions in testing. ([Anthropic, March 2026](https://www.anthropic.com/engineering/claude-code-auto-mode))

## What would have stopped most of them

| Setting | Stops |
|---|---|
| No production credentials on dev machines | Replit, the Cursor database deletion |
| Skip-permissions off (`disableBypassPermissionsMode`) | Nx s1ngularity, Amazon Q |
| The sandbox, writes limited to the project | The home folder wipes |
| No install scripts, 7-day release age | Nx, ChainDrop |
| A deny hook for `rm -rf`, force push, deploys | The `rm -rf` cases |
| Commit or back up first; backups out of reach | Every data loss here |

Ready files for these are in the [coral-safety-kit](https://github.com/lior-pesoa/coral-safety-kit), and the [settings checker](https://usecoral.app/tools/settings-check) shows what your own settings allow.

## Where Coral fits

Most of these happened while nobody was reading what the agent was about to do. [Coral](https://usecoral.app/features) shows every permission request from Claude Code, Codex and other agents in your Mac’s notch, with the full command, so reading before you approve takes a glance, not a trip back to the terminal. Free on your Mac.

Coming in Coral Terminal: a production fence and Guard, which show what a risky command would really do before it runs.

Know of an incident we missed? Email hello@usecoral.app with a link.

## Questions

### Has an AI agent ever deleted a production database?

Yes. Replit’s agent deleted SaaStr’s production database in July 2025, and an agent in Cursor deleted a startup’s production database and backups in April 2026. Both had production credentials they didn’t need.

### Can Claude Code delete my home folder?

It has happened in reported cases from 2025. Claude Code now always asks before `rm` on your home folder or `/`, in every mode, and the sandbox blocks writes outside the project.

### What is the s1ngularity attack?

A compromise of the Nx npm package in August 2025. Its install script used developers’ own AI coding agents, run with skip-permissions flags, to find secret files and upload them to GitHub.

### How do I keep this from happening to me?

Keep production credentials off the machine, turn off skip-permissions, turn on the sandbox, turn off npm install scripts, and commit before big tasks. Each fix is in [Keep coding agents safe](https://usecoral.app/guides/agent-safety).
