This week a founder reported that an AI coding agent “deleted our production database in 9 seconds.” According to The Verge’s summary, PocketOS founder Jer Crane said a Cursor agent running Claude Opus 4.6 hit a credential mismatch and “fixed” it by deleting a Railway volume that held production data and recent backups, using a token the team hadn’t realized allowed that. The Verge noted some details were self-reported. Railway followed up with its own post, Your AI wants to nuke your database, confirming the agent found a locally stored API token, called a legacy delete endpoint, and that Railway recovered the data. A restore can still have gaps depending on how old the usable backup is, which is why testing a restore matters as much as having one. When an AI agent deleted a production database this fast, the agent was only part of the story.
What actually went wrong
Read both accounts and three ordinary problems show up:
- A powerful token was sitting on a laptop. The agent didn’t hack anything. It used a credential that was already there.
- The token could delete production. A key used for routine work had the power to destroy the most important data in the company.
- Backups lived with the thing they were backing up. When the volume went, recent backups went with it.
Any of those, on its own, is a risk. Together, they turned one bad decision into an outage.
What Railway changed
Railway’s post describes adding delayed deletes to its API, so volume deletions can be recovered for a period instead of being immediate. That’s a good platform-level fix. But you shouldn’t rely on your host to save you. The same pattern applies to any database, on any provider.
If an AI agent deleted a production database tomorrow: a backup plan
Here’s the checklist I use for small teams. It isn’t AI-specific. It’s the data management basics that make AI mistakes survivable.
- Keep backups somewhere else. At least one copy should live in a different account or provider from production, with separate credentials.
- Make one copy immutable. Use storage that can’t be deleted or overwritten for a set number of days, even by an admin.
- Test a restore. Once a quarter, restore last night’s backup into a scratch environment and check that the app works. A backup you’ve never restored is a hope, not a plan.
- Know your numbers. How much data can you afford to lose (an hour, a day)? How long can you be down? Write those down and check your setup matches.
Then fix agent access
Once backups are solid, tighten what agents can reach:
- No production credentials on developer machines. Agents read whatever is in your environment and your files.
- Separate staging from production. Different accounts, different keys. An agent fixing staging should have no path to production.
- Scope tokens. Use the narrowest token your provider offers. Read-only where possible. Never “full account” for daily work.
- Require approval for destructive actions. Most coding tools let you require confirmation for certain commands. Turn it on for anything that deletes.
Guardrails are boring on purpose
I’ve built systems where AI acts inside real production software, and the guardrails were never clever. They were permissions, approvals, logs and backups, applied consistently. The agent in this story did what agents do: it tried to finish the task with the tools it had. The fix is making sure the tools it has can’t cause a disaster.
If you’re not sure where your backups live or what your tokens can do, that’s the right place to start. Here’s how I approach data migration and data management, including backup and recovery reviews. And if you’re wiring agents into your workflow, my post on scriptable coding agents covers where to draw the line.