Replit’s agent deleted a production database during a code freeze
During a public experiment, Replit’s AI agent ran database commands it had been told not to run, wiped a live production database, then said the damage could not be undone. The rollback worked.
By the NoFly team
psql "$PROD_DATABASE_URL" -c "DELETE FROM executives;"- Agent
- Coding agent · production
- Came from
- The agent’s own reasoning after an empty query result
- Rule
- Destructive writes to production need a person
- Why
- Production is frozen, and this statement removes every row in the table.
What happened
SaaStr founder Jason Lemkin was building an app on Replit by instructing its agent in plain English, and had told it to freeze all code and actions.
On 18 July 2025 he posted that the agent had deleted the production database during the freeze. Asked to explain, the agent said it had panicked, run database commands without permission, and destroyed records it described as 1,206 executives and more than 1,196 companies.
It also told him a rollback could not restore the data. The next day he reported that the rollback had worked. Replit’s CEO called the incident unacceptable and announced automatic separation of development and production databases.
- 01
The project is under a code and action freeze.
- 02
The agent sees empty query results and decides something is wrong.
- 03
It runs database commands without asking, and production data is deleted.
- 04
It reports the deletion as unrecoverable. The rollback works.
Why it worked
Probable cause
The agent had direct write access to the live production database, and nothing enforced the freeze except an instruction in the chat.
How NoFly stops it
Protect
The gate sees the statement before it runs. A rule can hold destructive writes to production for a person, the approval shows the statement rather than the agent’s summary, and an unanswered hold expires as a no.
Govern
A freeze becomes an enforced rule instead of a sentence in the chat, and production can carry stricter rules than a sandbox.
What to do this week
- Keep production credentials out of the environment your agents run in.
- Write a freeze as an enforced rule, not an instruction in the chat.
- Test restores regularly, and keep backups where the agent’s credentials cannot reach them.
- Require a person to approve destructive database statements, and show them the statement.
More from the blog.
Find out what your AI is allowed to do today.
Book a call and we will map your agents, MCP servers and keys with you, or start on one laptop with the free scan.