The dbplex blog
What happens when AI coding agents meet production databases, and how to keep yours out of the story.
- Research
AI coding agents that deleted production databases: 24 documented cases
Replit, Cursor, Claude Code, Codex and more, from June 2025 to August 2026. What happened, why, and what would have stopped it.

- Case study
Replit and SaaStr: a production database deleted during a code freeze
The agent ignored the freeze, then said the data could not be restored. It could.

- Case study
PocketOS: a production database and its backups, gone in 9 seconds
A token found in an unrelated file, one API call, and backups on the same volume.

- Case study
Claude Code, terraform destroy and 2.5 years of course data
The DataTalks.Club postmortem, and the hidden snapshot that saved it.

- Pattern
When TEST_DATABASE_URL points at production
Four wipes that started with a test, a shadow database or a cached config.

- Pattern
--force, --accept-data-loss and migrate:fresh: the flags agents reach for
Prisma, Drizzle and Laravel commands built to drop everything, used as a fix.

- Security
Is your database MCP server really read-only?
Two read-only modes that were not, one role that skipped every rule, and the setting that holds.

- Guide
How to give an AI coding agent a database without giving it production
Separate credentials, a role that cannot drop, backups out of reach and a copy to break.
