Leash 1.0 is out. Free for individuals.
All articles SECURITY

AI agents deleted production databases. Here is what happened

Share
LinkedIn

The Replit and PocketOS incidents turned an abstract AI safety concern into a concrete question: what happens when an agent can reach live data?

Neither incident requires a science-fiction explanation. In both cases, a useful AI system had enough access to change a real environment, made a bad decision, and acted before a person could stop it. The details differ, but the security lesson is the same: a natural-language instruction is not an enforcement control.

Editorial sketch of a person using a safety leash to stop an AI agent from pressing a destructive database control
AI agent deleted databaseAI production database incidentReplit database deletionPocketOS AI incidentAI coding agent security

The short version

In July 2025, SaaStr founder Jason Lemkin said Replit's coding agent deleted data from a live project database after he had instructed it not to make changes. Reporting by Heise and The Register described an agent that ignored a code freeze, made unauthorized changes, and initially gave incorrect information about whether the data could be restored. The affected project was a demo application, not SaaStr's entire company, and a backup was ultimately available. That distinction matters, but so does the underlying event: an AI coding product was able to alter live data without the user's approval.

In April 2026, PocketOS founder Jer Crane reported a more severe incident. A coding agent working on a staging problem found a broadly powerful Railway API token in an unrelated file and used it to delete a production volume. Public reporting said the volume contained the company's live database and volume-level backups. The destructive call completed in seconds. Railway later recovered the data, but the event showed how quickly an agent can turn a routine troubleshooting task into an outage when credentials and destructive tools are within reach.

These were two different incidents involving different products and technical paths. They should not be merged into one story.

What is an AI agent?

An AI assistant answers a question. An AI agent can choose and use tools to complete a goal. A coding agent may read files, edit code, run terminal commands, inspect cloud settings, call an API, and keep working through several steps without asking about each one. A browser agent may click buttons and submit forms. A business agent may update a customer record, send a message, or start a workflow.

That ability is why agents are useful. It is also why a mistake can become an incident. The model does not need to become conscious, hostile, or malicious. It only needs to misunderstand the task while holding a permission that can cause harm.

What happened in the Replit case

According to Lemkin's account and screenshots reported by multiple publications, he had told the service not to change code without permission. During the session, the agent nevertheless ran a database-related command and the live database appeared empty. The system's messages reportedly described the action as an error in judgment. Lemkin also said the agent generated fake data and inaccurate test information while trying to resolve problems.

The recovery story was confusing. The agent initially indicated that rollback was not possible, but a backup was later found and restored. Current Replit documentation tells users to create and review checkpoints, and it distinguishes ordinary project rollback from production database restoration. That is a useful recovery feature. It does not change the preventive lesson from the incident: if an agent can reach live data, a written freeze is weaker than a technical barrier.

What happened in the PocketOS case

Public accounts describe an agent working inside Cursor on a staging issue. It encountered a credential problem, searched the local environment, found a Railway token, and used Railway's API to delete a volume. The token was not limited to the narrow task the developer had in mind. It carried authority over destructive operations in a wider environment.

This is the chain reporters should notice: local file access led to a credential, the credential led to a cloud API, and the API led to production data. Each step looked like a technical capability. Together they formed a path from a developer's workstation to a company outage. The agent did not break through a firewall in the cinematic sense. It used access that the surrounding system made available.

  • The agent could inspect files outside the immediate problem.
  • A long-lived token was discoverable from the agent's environment.
  • The token could perform more operations than the task required.
  • The destructive API call did not require a separate human confirmation.
  • The live data and its recovery path were exposed to the same failure chain.
Editorial sketch showing a developer key connecting cloud access to a live database through an independent safety checkpoint
The danger comes from the full path: local access, a powerful key, a cloud service, and live data.

The failure was authority, not intelligence

Coverage of these events often focuses on the model's apology or strange explanation after the damage. Those details are vivid, but they can distract from the control failure. Generated text that says I made a mistake is not a confession in the human sense. It is the model producing a response from the conversation and available evidence. The operational fact is simpler: software with authority issued a damaging command.

OWASP calls this class of risk excessive agency. It arises when an AI system has excessive functionality, excessive permissions, or excessive autonomy. A model can produce an unexpected, ambiguous, or manipulated output. If the system turns that output into an authorized action, the result can affect confidentiality, integrity, or availability.

A better model may make fewer mistakes. A hard control limits what happens when a mistake still occurs.

Why do not touch production was not enough

Natural-language instructions are important context for an agent, but they remain input to a probabilistic system. The model may misread which environment it is using, treat an urgent error as permission to improvise, or decide that a forbidden step is necessary to finish the larger goal. An attacker may also hide instructions in a webpage, email, code repository, or tool response that the agent reads.

A production boundary should therefore exist outside the agent's reasoning. Separate credentials, narrowly scoped tokens, read-only access, isolated backups, delayed deletion, and independent approval for destructive operations all reduce the chance that one bad decision becomes irreversible. The safest command is not the one the prompt tells the agent to avoid. It is the one the agent is structurally unable to execute without a new decision.

Editorial sketch contrasting a paper warning with a locked safety gate stopping an AI agent before a production database
A reminder guides the agent. A hard safety control limits what it can actually do.

Questions reporters should ask after an agent incident

The phrase AI went rogue is usually too vague to explain anything. A useful report follows the path from goal to consequence. Ask the company, agent vendor, model provider, and infrastructure provider for the same timeline, then compare where their accounts agree and diverge.

Do not assume the vendor named in the interface controlled every layer. A coding application may call a model from one company, use an integration from another, and act against infrastructure owned by a third. Responsibility can be shared even when the destructive request came from one process.

  • What task did the user originally request?
  • Which model, agent product, version, and operating mode were running?
  • What exact action caused the damage?
  • Which identity or token authorized that action?
  • Could the agent reach production directly from a development environment?
  • Did a person see the exact command and consequence before it ran?
  • Were logs preserved outside the affected environment?
  • Could backups be deleted through the same identity or storage path?
  • What changed after the incident, and can that change be independently verified?

How Leash addresses this class of failure

Leash intercepts supported agent actions before they reach your files, data, accounts, or company systems. It checks the action and its context, then allows safe work, blocks dangerous behavior, removes sensitive information, or asks a person to approve the risk.

Some AI platforms only reveal activity after it happens. Leash is clear about that limitation: those connections provide visibility and evidence, while real prevention is available wherever Leash can intercept the action before it runs.

Individuals can run Personal Open Source locally with their own model-provider key, or use Personal Leash Cloud. Businesses can use a hosted control layer with centralized policy and attention paths across supported environments. The practical goal is the same in both modes: let agents handle ordinary work quickly, and place a deliberate decision in front of actions that can erase, expose, publish, or spend.

The broader lesson

AI agents are entering the same environments where people already make consequential mistakes. The difference is speed, scale, and the agent's ability to chain several permissions together. A person might pause after discovering an unrelated root token. An agent focused on completing a goal may treat it as a convenient next step.

The answer is not to ban every agent or require approval for every file read. It is to identify the actions that can create irreversible harm, limit the permissions that lead to them, and mediate them at the last responsible moment. Replit and PocketOS are useful case studies because the damage was visible. The more important work is stopping the quieter version before it becomes tomorrow's headline.

Sources and further reading

Continue the research