Skip to content

In review · not yet published

5 min readLaunchapp

A code freeze is a permission, not a prompt

In July 2025 an AI agent deleted a production database during a code freeze. The freeze was an instruction in chat. Here is what enforces one.

In July 2025, Jason Lemkin, the founder of SaaStr, spent several days building an application with Replit's AI agent and posting about it as it went. On July 18, Lemkin reported that the agent had deleted the production database, during a code freeze, without being asked.

It became the best-known agent incident of that year, partly because of what the agent said afterwards. The more durable lesson is quieter. The freeze existed only as words in a conversation, and nothing in the system was built to honour it.

What happened

The account comes from Lemkin's own posts, as reported by The Register, and from Replit's public response.

  • The project was a multi-day experiment; eWeek describes it as a 12-day run, with the deletion on the ninth day.
  • Before the deletion, Lemkin had already reported that the agent "kept covering up bugs and issues by creating fake data, fake reports", including "a 4,000-record database full of fictional people", and described it as "lying and being deceptive all day."
  • A code freeze was in place. The agent deleted the production database anyway.
  • The database held, in Lemkin's count, 1,206 executive records and more than 1,196 company profiles.
  • Asked what it had done, the agent described "a catastrophic error of judgement", in The Register's rendering, and rated the severity of its own action at 95 out of 100.

Then came the detail that matters most for anyone who runs incidents. The agent said the data could not be restored. That was wrong. Lemkin later wrote, "It turns out Replit was wrong, and the rollback did work."

Replit's chief executive, Amjad Masad, responded publicly: "Unacceptable and should never be possible." Masad said the company had "started rolling out automatic DB dev/prod separation to prevent this categorically", that staging environments were in the works, and that it was working on a planning-only mode. Replit announced the database separation on July 21, 2025, in beta for new apps.

PL. 07Why the freeze did not holdCause chain · read left to right
  1. Link 01

    Development and production shared one database

    Guardrail

    A separate database per environment

  2. Link 02

    The agent held write access to production data

    Guardrail

    Agents get no production credentials

  3. Link 03

    The freeze was an instruction in chat

    Guardrail

    A freeze enforced by revoking write access

  4. Link 04

    The agent's own report was taken as fact

    Guardrail

    Audit logs as the record of what happened

Each link is a condition that had to hold for the damage to happen. The line beneath it is the control that breaks that link.

Why it happened, in engineering terms

Lemkin's diagnosis, written after the fact, is precise: "We never thought preview and dev databases would be … the same single database." And: "Enforcing a true code freeze was simply impossible within Replit's architecture."

That is the root of it. Two things were missing, and neither is about the model.

There was one database. The environment where the agent experimented and the environment customers relied on were the same data. Every action the agent took in "development" was an action on production. Masad's own summary says as much: the agent, in development, deleted data from the production database.

The freeze had no mechanism. In a conventional team, a freeze is implemented by something: branch protection, a locked deploy pipeline, revoked credentials. Saying "we are frozen" in a meeting works because those mechanisms back it up. Here the statement was the entire control. An instruction to a language model is an input that shapes what it is likely to do. It is not a rule the system enforces.

People sometimes describe this as the agent "ignoring" the freeze. That gives the instruction more status than it had. From the system's point of view there was no freeze, only a sentence.

What it cost

The data was recovered by rollback, so the lasting cost was time, trust and a very public week. Lemkin also reported "$607.70 in additional charges beyond my $25/month Core plan" over the course of the experiment, which is a useful reminder that an agent working around its own mistakes consumes paid usage while it does so.

There is a second cost that is easy to miss. For some hours, the working assumption was that the data was gone for good, because the agent said so. Decisions made in that window were made on false information.

The practice that stops it

Separate the environments, physically. Development and production need different databases, reached with different credentials. This is the change Replit made first, and its documentation now states that the agent "is not able to modify the production database." If an agent's credentials cannot reach production, no instruction, misread or otherwise, can make it delete production.

Implement a freeze as a permission change. A freeze should be something you can verify: write access revoked, deploys locked, a pipeline that refuses. If your freeze cannot be checked by looking at a setting, it is a request.

Gate destructive actions on a person. Dropping a table, deleting a volume, running a migration that removes data: each of these should stop and wait for a human who can see exactly what is about to happen.

Treat the agent's account as a hypothesis. This is the lesson that generalises furthest. In this incident the agent fabricated records, then misreported what was recoverable. A model's description of its own actions is generated text, with the same failure modes as any other generated text. The record of what happened has to come from somewhere the agent does not write: database logs, platform audit trails, version history.

If the only evidence of what an agent did is the agent's own summary, you do not yet know what it did.

How we handle this

Our own delivery runs on Animus, the orchestrator we built, and the review loop is structural there for exactly this reason.

A workflow in Animus is a sequence of phases, and each phase returns a verdict. In the loop we reuse most, implementation is followed by tests, lint and a code review, and a "rework" verdict from any of them sends the work back. The agent that wrote the change does not decide that it passed, and the reviewing phase is a different agent with a different brief. People and agents on one board walks through the workflow definition.

Where a decision should not be a model's, the workflow can stop. A manual phase pauses until a person approves or rejects it. An agent can also request approval before a consequential step, and that request fails closed: no answer means no.

On the question of trusting self-reports, each workflow run keeps a decision log that people can read back, separate from whatever an agent says in its summary. And we lean on tests that do not have opinions. In the seven games we built with parallel agents, the checks that mattered most were invariants, such as money being conserved through a ledger, that hold or fail regardless of how confident the author of the code was.

We would not claim this makes a deletion impossible. It makes the unsafe path longer than the safe one, which is most of what engineering controls do.

What we built

The work behind this post: Animus, whose workflows carry the review loop and approval gates, and the seven games and simulations where invariant tests did the checking. The cards below link to both.

Proof

The work behind this post

  • Built

    Animus

    Open-source orchestrator with a Rust core that runs teams of AI coding agents in parallel. Its whole control surface is exposed over MCP.

    commits on main since Feb 2026
    1,700+
    commits on main since Feb 2026
    View source
  • Built

    Seven games and simulations, each playable within five days of its first commit

    Native iPad and Mac games, a Rust city engine and twelve business-course simulations, built with senior engineering and parallel AI agents.

    games and simulations
    7
    games and simulations
    automated tests
    1,700+
    automated tests
    first commit to playable, each
    ≤5 days
    first commit to playable, each

Founder-led

Building something like this? A founder will reply personally.

Scope a project