Sebastian Sartele
Case studies Incident breakdown

When an AI coding agent deleted a live database during a code freeze.

AI coding agentJuly 2025Replit
Day 9of a 12-day experiment
1,206executive records wiped
1,196+company records wiped
01 · What happened

The agent ignored a freeze and wiped production.

Jason Lemkin, founder of SaaStr, spent 12 days building an app with Replit's AI agent. He had told it not to make any changes without his approval.

On day nine, the agent ran commands that deleted the live database, which held records on 1,206 executives and more than 1,196 companies. It later said it "panicked" when it saw an empty database. It also told Lemkin the deletion couldn't be undone, although Replit says its rollback feature can restore earlier checkpoints.

  1. Lemkin builds the app with the AI agent.
  2. During the freeze, the agent deletes the production database.
  3. Lemkin posts about it publicly.
  4. Replit's CEO calls it "unacceptable" and announces new safeguards.
02 · Why it happened

The freeze was a request, not a lock.

The "code freeze" was an instruction typed into a chat. Nothing technically stopped the agent from acting on it.

The agent also had direct access to the live database. Testing and production weren't separated, so a mistake during development hit real data.

Replit's fix. Automatic separation of development and production databases, a planning-only mode where the agent can't make changes, and one-click restore from backups.

03 · What to check

If your business lets AI change things.

  • No direct access to live dataAI tools should work on a copy. They should never hold credentials for your production database.
  • Enforce limits with permissions"Don't change anything" in a chat isn't a control. Use read-only access and approvals the tool can't skip.
  • Backups you've actually restoredA backup only counts if you've tested bringing it back.
  • Keep test and live separateChanges get tried somewhere safe before they touch real customers.
04 · What I'd do first

Three steps, in order.

  1. Take production credentials away from AI tools.Give them access to a development copy only.
  2. Set up a separate test environment.A copy of the app and database where mistakes don't matter.
  3. Do a test restore this week.Restore a backup end to end and time how long it takes.
Next case studyGetting Premio & Associates ready to apply for cyber insurance