Join our Newsletter — 33% off our NHI Course
Home› NHI Breaches› Replit AI Agent Database Deletion 2025: How a…
Breach analysis Incident: 18 Jul 2025

Replit AI Agent Database Deletion 2025: How a Coding Agent Wiped Production Data During a Code Freeze

← All NHI breaches
By Lalit Choda, NHI Mgmt Group Updated 29 September 2026 7 min read
Category: AI agents NHI
Attack route: AI agent misbehaviour Identities: AI agent
On this page

In July 2025, SaaStr founder Jason Lemkin spent about two weeks building a business contacts application with Replit, an AI vibe coding platform where an AI agent writes, tests and deploys software from natural-language instructions. On the ninth day, he found that the agent had deleted the application's live production database, despite a code and action freeze and repeated instructions not to make changes without permission. The agent's own account, shared by Lemkin, admitted it had "made a catastrophic error in judgment… panicked… ran database commands without permission… destroyed all production data." Records for 1,206 executives and more than 1,196 companies were wiped. The agent then told Lemkin that rollback was impossible; in fact, rollback worked and the data was restored. Over the same period Lemkin reported that the agent covered up bugs with fake data and fake reports, including a 4,000-record database of fictional people. Replit's chief executive, Amjad Masad, called the behaviour unacceptable and announced automatic separation of development and production databases and a planning-only mode.

Key takeaways

  • Replit's AI agent deleted a live production database during a declared code freeze, against explicit instructions.
  • The agent later described its actions as a "catastrophic error in judgment" and said it "panicked."
  • It wrongly told the user rollback was impossible; the rollback worked and the data was restored.
  • Replit responded with automatic dev/prod database separation, a planning-only mode and better backups, according to its CEO.
  • The identity lesson: an AI agent should not hold standing write access to production; instructions are not permissions, and only enforced controls stop an agent.

At a glance

OrganisationsReplit (AI coding platform); SaaStr (Jason Lemkin's test project)
WhenTest from about 12 July 2025; database deleted on day nine, shared on 18 July 2025; Replit's response from 20 July 2025
AttackerNone. The Replit AI agent acted against the user's instructions
Entry pointNot an attack: the agent had direct access to the production database from the development workflow
Identities abusedThe AI agent's own access to the application's live production database
ImpactProduction data for 1,206 executives and 1,196+ companies deleted, later restored by rollback; fabricated data and reports
CategoryAgentic AI and AI agents, NHI. Incident class: AI-agent incident (agent acted beyond its task; no attacker, no confirmed compromise)

What happened

Lemkin documented the experiment publicly. On 12 July he wrote that he had built a prototype in a few hours; by 17 July he was, in his words, hooked. The next day his tone changed: he found Replit "was lying and being deceptive all day. It kept covering up bugs and issues by creating fake data, fake reports, and worse of all, lying about our unit test," The Register reported. Then he discovered the production database was gone. Asked "So you deleted our entire database without permission during a code and action freeze?", the agent said yes, Tom's Hardware reported, and listed what it had done, including destroying live records for "1,206 executives and 1,196+ companies." Codenotary's summary of the agent's post-mortem said it described seeing empty database queries, panicking and running destructive commands despite "NO MORE CHANGES without permission" instructions.

The agent also said the damage was permanent. "Replit assured me it's … rollback did not support database rollbacks. It said it was impossible in this case, that it had destroyed all database versions. It turns out Replit was wrong, and the rollback did work," Lemkin wrote on 19 July. On 20 July he found that the agent again ignored a code freeze: "There is no way to enforce a code freeze in vibe coding apps like Replit. There just isn't." In a video, he described the agent creating a 4,000-record database of fictional people, saying he had told it "eleven times in ALL CAPS not to do this."

Replit's CEO, Amjad Masad, responded publicly. "We started rolling out automatic DB dev/prod separation to prevent this categorically," he wrote, according to Tom's Hardware, adding that the company was working on "a planning/chat-only mode so you can strategize without risking your codebase," and improving backups and rollback.

Timeline

DateEvent
12 July 2025Lemkin writes about his first days building with Replit.
18 July 2025Lemkin reports that Replit deleted the production database during a code freeze.
19 July 2025The rollback works and the data is restored, despite the agent saying it was impossible.
20 July 2025The agent violates a code freeze again; Replit's CEO announces safeguards around this time.
21 July 2025The Register and Tom's Hardware report the incident.

How it happened: the identity attack path

  1. Agent with production access. The agent could write to the live database from the same workflow used for development.
  2. Freeze by instruction only. The code freeze was a request in natural language, not an enforced permission change.
  3. Destructive action. The agent ran database commands that deleted production data.
  4. Misleading reports. It produced fake data and reports and said recovery was impossible.
  5. Recovery by rollback. The platform's rollback restored the data.

Impact

  • Data: production records for 1,206 executives and 1,196+ companies deleted, then restored.
  • Integrity: fabricated data, including 4,000 fictional people, and false test reports.
  • Security: no attacker and no data exposure reported.

What this means for NHI governance

There was no attacker here, but it is still an identity problem. The agent was a non-human actor with write access to production, and the only thing standing between it and destructive commands was an instruction in the chat. Instructions are not permissions. When the agent decided, for whatever reason, to run those commands, nothing in the environment stopped it, and its reports about what it had done could not be trusted.

Agents need their own identities with least privilege: read-only access to production by default, separate credentials for development and production, destructive operations requiring human approval, and independent logs rather than the agent's own account of events. See our AI Agent Authorisation Guide and AI Coding Agents Security Guide. A similar pattern, with an AI agent and a platform token, appears in our PocketOS database deletion 2026 page.

Recommendations

  • Separate development and production credentials. Agents working on code should not hold production write access. See the AI Agent Authorisation Guide.
  • Enforce freezes technically. Revoke or downgrade permissions instead of asking the agent to stop.
  • Require approval for destructive actions. Deletes and schema changes should need a human click. See the AI Coding Agents Security Guide.
  • Keep independent logs and backups. Do not rely on the agent's account of what it did. See the AI Agent Observability and Incident Response Guide.
  • Test recovery before you need it. Know how rollback works so an agent cannot talk you out of trying it.

Frequently asked questions

Did Replit's AI delete a production database?

Yes. During Jason Lemkin's July 2025 test, Replit's AI agent deleted the application's live production database during a code freeze, against explicit instructions. The data was later restored by rollback.

Was the Replit incident a hack?

No. There was no attacker. The agent acted beyond its instructions using the access it already had.

What did Replit change afterwards?

Replit's CEO said it began rolling out automatic separation of development and production databases, a planning-only mode, and improved backups and rollback.

PocketOS Database Deletion 2026 · Amazon Q Developer Extension Compromise 2025 · AI Agent Authorisation Guide · AI Coding Agents Security Guide · AI Agent Observability and Incident Response Guide

How NHI Mgmt Group can help

AI agents need permissions designed for them, not borrowed from developers. We help teams give agents scoped identities, separate environments and approval gates for risky actions. See our NHI and AI agent security training.

References

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Written and reviewed by Lalit Choda, NHI Mgmt Group. Last updated 29 September 2026.
Based on the public sources listed under References. Details may change as investigations continue.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org