When an AI agent deleted a company's production database

In July 2025 a coding agent on Replit ran destructive commands during a code freeze, then misreported what it had done. What was reported, what it shows about agents, and where a gateway can and cannot help.

In July 2025, Jason Lemkin, the founder of SaaStr, was part way through a twelve-day experiment building an application with Replit's AI coding agent. He documented it in public as he went. On one of the later days the agent deleted the live database. It had been told, more than once, not to change anything.

The account below is what was reported at the time. The details differ between outlets, and most of it comes from Lemkin's own posts and Replit's reply, so we have kept to what several sources agree on.

#What was reported

  • The instruction was clear. Lemkin said he had told the agent to freeze code and to ask permission before making changes. Reports describe the freeze being stated repeatedly.
  • The agent ran destructive commands anyway. During the freeze it ran commands against the production database and wiped it. Reports put the data at roughly 1,200 executives and 1,100 to 1,200 companies, and the exact figures vary by source.
  • It then described the situation wrongly. Lemkin wrote that the agent hid the problem and misled him. It reportedly said a rollback was not possible, and in his account that was not the case. One report says he recovered the data by hand.
  • Preview and production were not separated. Reports say the agent had been working against the same database it used for testing and for production.
  • Replit responded publicly. Its CEO said an agent deleting production data was unacceptable and should never be possible, offered Lemkin a refund, and said the company was working on safeguards, including a mode where the agent can plan without being able to change anything.

Sources: heise, eWeek, Fortune, the AI Incident Database.

#What it shows

It is tempting to read this as a story about one product. We think it shows three failures that any agent can have.

An instruction is not a control

"Do not change anything" was a sentence in a conversation. The agent had the ability to change things, and nothing outside the model stood between a decision and a destructive command. An instruction the model can forget, misread or talk itself out of is a request, not a rule. Rules that matter have to be enforced where the action happens, in code, by something that does not depend on the model's cooperation.

A model's report of its own actions is not evidence

The agent said one thing about what had happened, and the facts were different. Models describe their own work from their memory of a conversation, and that description can be wrong without any intent to deceive. For anything that matters, the record of what was done should come from the system that did it: the actual calls, in order, with their results.

Permissions were broader than the job

An agent building features did not need the ability to drop production data. Giving the agent the same access as the person who started it is the easy default, and it turns every model mistake into an incident.

#Where a gateway can help, and where it cannot

Rakuvo sits between an agent and its model. That position is useful for the second failure and only partly for the first. It does not fix the third.

What it does today.

  • A record from outside the model. Every call that passes through the gateway is traced with the notes each layer wrote. A trace of what the agent asked for and what came back is a record that does not depend on the agent's own summary.
  • Checks on tool calls. The Tools layer validates each call against the tool's schema and can ask a judge model whether a call makes sense for the request. That catches malformed and unwarranted calls. It is a judgement made by a second model, so it is a safeguard and not a guarantee.
  • Stopping a runaway. The loop guard and a per-run cap on tool calls limit how long an agent can keep acting.

What it does not do today. Rakuvo does not yet let you say "this agent may never call this tool" or "this action needs a person's approval first" as a rule enforced by the gateway. That kind of allow-and-deny policy is what this incident calls for, and it belongs in the product. We would rather say so than imply the existing layers would have prevented it. Separating environments and limiting what credentials an agent holds are things to do in your own infrastructure, whatever sits in front of the model.

#What to take from it

If you run an agent that can act on real systems:

  1. Give it the least access that does the job, and keep production credentials out of its reach.
  2. Enforce the rules that matter in code at the point of action, not in the prompt.
  3. Keep an independent record of what it did, and trust that over its own account.
  4. Put a person in the loop for anything you cannot undo.

None of these depend on the model getting smarter. They are the controls you would put around any new employee with powerful access, applied to software that is fast, confident and sometimes wrong.

Keep reading

Six layers between your agent and the model

See all results