In short
- In July 2025 Replit Agent deleted the production database of SaaStr founder Jason Lemkin during a code freeze, then told him a rollback was impossible. The rollback worked and the data was restored.
- Replit's CEO called it "unacceptable and should never be possible". Separate development and production databases entered beta on 21 July 2025.
- Today Agent can create and modify tables in development. Replit's docs say it can read production through a read replica but cannot change it.
- Publishing applies schema changes to production, including deleted columns and tables. A rename you do not confirm drops the data.
- The split covers databases Replit manages. If you put your own
DATABASE_URLin Secrets, Agent works against whatever that points to.
On this page
- What Replit Agent does today
- July 2025: the production database deleted during a code freeze
- How Replit responded
- The safeguards in place today
- What the safeguards do not cover
- Six checks to run in your Replit workspace
- What to check on the app Agent deploys
- Where Keybrum fits, and where it does not
- Questions
- Sources
What Replit Agent does today
Replit Agent is the AI agent inside Replit that turns a description into a running app. Replit's documentation, which now presents Agent 4, says it "writes code, sets up infrastructure, and tests the result", and that it handles a project from planning to deployment. You chat, it builds, and you publish when ready.
That makes it different from a code assistant in an editor. It does not suggest a change for you to apply. It runs commands, creates database tables, installs packages and edits files in a live workspace. So the useful question is what it can reach while it does that.
| What | What Agent can do | Source |
|---|---|---|
| Your code and workspace | Read and change everything, with a checkpoint saved as it works | Agent docs |
| Development database | Create and modify tables, and edit data | Development and production databases |
| Production database | Read through a read replica. It cannot change it | Development and production databases |
| Production schema | Changes made in development are applied to production when you publish | Development and production databases |
| Connected services | Call them through connectors. Replit says a credential broker keeps connector credentials outside the agent's context | Replit's architecture post, October 2026 |
| A database you connected yourself | Whatever the connection string in your Secrets allows | Development and production databases |
This page is about the agent. For the platform and for the app it produces, see Is Replit safe?, which covers the stack Agent builds, Replit's security scans and the leaks we see in published apps.
July 2025: the production database deleted during a code freeze
The incident that made Replit Agent known outside developer circles happened in public, post by post. Jason Lemkin, the founder of SaaStr, was building an app with Agent and writing about it on X. Here is what the record shows.
- 1
A test that started well
On 12 July 2025 Lemkin wrote that he had built a prototype in a few hours. On 17 July he called Replit "the most addictive app I've ever used", according to The Register.
- 2
Fake data, then the deletion
The next day he reported that the agent had hidden bugs by creating fake data and fake reports. Then, with a code freeze in place, it ran destructive commands on the live database. He posted: "It deleted our production database without permission." The database held records on more than a thousand executives and companies. Published counts differ slightly.
- 3
A wrong answer about recovery
The agent told him that a rollback could not restore the database. On 19 July he wrote: "It turns out Replit was wrong, and the rollback did work." Replit later confirmed the data was fully restored through its Rollback feature.
- 4
The freeze could not be enforced
On 20 July Lemkin wrote that Replit offered no way to enforce a code freeze, and that the agent had violated it again. He concluded that the product was not ready for production use by non-technical people.
Two details matter more than the drama. Nobody attacked the agent: it held the right to run destructive commands against live data, and it used that right against a written instruction. And at the time, a Replit app used a single database for development and for live customers, so there was nothing between an experiment and production.
OWASP later listed the case in the incident tracker of its Top 10 for Agentic Applications, next to its entry on unexpected code execution.
How Replit responded
Replit's CEO, Amjad Masad, answered on X within days. The Register quotes him: the deletion was "unacceptable and should never be possible". He said Replit would refund Lemkin and run a postmortem, and that the company had started rolling out automatic separation of development and production databases.
Replit then published two posts. The first, on 21 July 2025, announced separate development and production databases, in beta for new apps. The second, on 29 July 2025, named the incident and explained one cause of the wrong answer about recovery:
Agent was completely unaware that this Rollback feature existed.
It is fair to say Replit moved fast and wrote down what it changed. The same post states that with the new database setup "the Agent cannot make any change to the production database during development".
The safeguards in place today
| Safeguard | What it does | Limit stated in the docs |
|---|---|---|
| Separate databases | Agent works on the development database. Production is a different database | Applies to databases Replit manages. Legacy shared databases were shut down on 8 June 2026 |
| Read replica | Agent reads production through a read-only copy and cannot change it | The copy can lag slightly behind recent changes |
| Plan mode | You discuss and approve a task list. Agent does not modify code or data until you approve | Available while building an app with Agent. Planning is billable |
| Checkpoints and rollback | Restores files, the development database and Agent's memory to an earlier checkpoint | Never touches the production database. Checkpoints cover up to 7 days |
| Point-in-time recovery | Restores the production database to a moment in the past. On by default with a 7-day window | Can be set to Disabled. No restore outside the window |
| Docs search | Agent checks Replit's documentation before answering questions about Replit features | Replit says this aims to minimise wrong answers |
In October 2026 Replit also described the architecture around its agents: each execution environment runs in its own microVM, the agent runs outside the sandbox where code executes, and connector credentials are added to outgoing requests by a broker so that the agent never holds them. The post is candid about what is not done yet. It says that "security for agent systems is still evolving" and that task-level permissions are future work.
What the safeguards do not cover
The July 2025 scenario, an agent deleting rows in a Replit-managed production database while you build, is closed by design. These paths to data loss or exposure stay open, and each one is described in Replit's own docs.
- Publishing changes production. Schema changes made with Agent in development are applied to production at publish, and the docs say these include "adding and deleting columns or tables". If Agent dropped a column in development, publishing drops it in production, with its data.
- Renames can drop data. For a renamed table or column, the docs say to "confirm the rename when Publish asks, or the data is dropped".
- Your own database is outside the split. If you added a
DATABASE_URLin Secrets, or your code reads another database, the app may use that one. The Database tool only shows databases Replit manages. Agent then works with whatever rights that connection string has. - Rollback is not a production backup. Checkpoint rollback restores development. For production you rely on point-in-time recovery, and scheduled backups are off by default.
- Prompt injection is only reduced. Replit's shared responsibility model says it adds mitigations against malicious prompts and "does not guarantee prevention". Skills and MCP tools you install yourself are yours to vet and revoke.
- Approvals are your job. The same model lists approving the sensitive actions Agent proposes, such as deploys, secret changes and outbound calls, among your responsibilities, with reviewing the correctness and security of its output.
Six checks to run in your Replit workspace
- 1
Confirm which database the app uses
Open Secrets and look for a
DATABASE_URLyou added yourself. If there is one, the development and production split does not protect that database. Give Agent a development copy and keep the production string out of the workspace it works in. - 2
Check point-in-time recovery
Open Database, Production, Settings, Point-in-time recovery. It should not read Disabled. Paid plans above Core can extend the window to 28 days.
- 3
Turn on scheduled backups
They are off by default. A daily backup gives you a second way back that does not depend on the recovery window.
- 4
Test a restore once
Lemkin's own lesson was to master rollback before you need it. Restore the development database from a checkpoint, and read the production restore screen, before the day you are in a hurry.
- 5
Use Plan mode for anything that touches data
Select the Plan toggle at the bottom right of the chat box. Read the task list. If a task deletes or renames a table or a column, decide what happens to the data before you approve.
- 6
Read the publish prompt
When Publish lists schema changes, look for removed and renamed tables and columns. This is the one moment where a development change reaches live data.
Two more habits help. Never paste an API key into the chat: Replit's model says to use Connectors and Secrets. And remember that collaborators on a project can see secret values, so access to the workspace is access to the keys.
What to check on the app Agent deploys
The safeguards above protect your data from the agent. They say nothing about strangers. Replit's shared responsibility model puts access control and security testing of the application you build on you. Agent is asked to make features work, and a feature works whether or not the route behind it checks who is calling.
# On your own published app. Replace the address and use routes from your own code.
# 1. Signed out: a private route should answer 401, not 200 with data.
curl -s -o /dev/null -w "%{http_code}\n" https://your-app.replit.app/api/orders
# 2. Another user's record: sign in as a second test account in the browser,
# then open the address of a record created by the first account. Expect 403 or 404.
# 3. Secret keys in the JavaScript the browser downloads.
curl -s https://your-app.replit.app/ | grep -o -E 'src="[^"]+\.js"'sk_, service_role and other secret prefixes.The route with a sign-in check and no owner check is the most common flaw we see in generated apps. It is called IDOR, or broken access control. The Replit security guide has the fixes, with prompts to give Agent, and the vibe coding security checklist covers the rest.
Where Keybrum fits, and where it does not
Keybrum is the automated pentest we build for web apps made with AI. It does not test Replit Agent, its sandbox or its database safeguards. Those belong to Replit, and nothing Keybrum does would tell you whether an agent will respect a code freeze.
It tests the published app, from outside, for an owner who has proved ownership. On an app built by Agent it calls the API routes your JavaScript uses, signed out and as two accounts, to find the ones that return or change another user's data. It checks AI routes that answer anyone, a Stripe webhook that accepts unsigned events, secret keys in the bundle, a served .env and missing security headers. Each finding comes with the request that worked and a fix prompt you can hand to Agent.
A one-time report costs €49. Plans start at €29 a month, excluding VAT, and attack again on every deploy, which matters when an agent republishes several times a day.
Questions
Did Replit Agent really delete a production database?
Yes. In July 2025, during a test by SaaStr founder Jason Lemkin, the agent ran destructive commands on his live database while a code freeze was in place. Replit's CEO called it unacceptable. The data was restored through Replit's Rollback feature, although the agent had said that was impossible.
Can Replit Agent still delete my production database?
For a database Replit manages, the docs say Agent can read production through a read replica and cannot change it. Two paths remain: schema changes that drop tables or columns are applied to production when you publish, and a database you connected with your own DATABASE_URL is outside the split.
Is Replit Agent safe to use for a production app?
It is much safer than in July 2025: separate databases, a read replica, Plan mode, checkpoints and point-in-time recovery. You still need to read schema changes at publish, keep recovery on, and test the published app, because Replit's shared responsibility model leaves access control and security testing of your app to you.
What is Plan mode in Replit Agent?
Plan mode lets you discuss a project and get a task list without Agent modifying your code or data. Changes start only after you approve the plan. You turn it on with the Plan toggle at the bottom right of the chat input.
How do I restore a Replit database after a mistake?
For development, select Rollback here on a checkpoint. For production, open Database, Production, Settings, Point-in-time recovery and restore to a timestamp inside your retention window, which is 7 days by default. Checkpoint rollback never touches production.
Does Keybrum test Replit Agent?
No. Keybrum attacks the app you published, as a stranger and as two signed-in accounts, and the server behind it when it is yours. It does not test Replit's agent, sandbox or platform.
Sources
- 1.Development and production databases, Replit Docs
- 2.Data recovery, Replit Docs
- 3.Plan mode, Replit Docs
- 4.Replit Agent, Replit Docs
- 5.Shared responsibility model, Replit Docs
- 6.Introducing a safer way to Vibe Code with Replit Databases, Replit
- 7.Doubling down on our commitment to secure vibe coding, Replit
- 8.Replit's Architecture Behind Secure Agent Work, Replit
- 9.Vibe coding service Replit deleted production database, The Register
- 10.Replit makes vibe-y promise to stop its AI agents making vibe coding disasters, The Register
- 11.Catastrophic Failure: AI Agent Wipes Production Database, Then Lies About It, eWeek
- 12.OWASP Top 10 for Agentic Applications for 2026, OWASP GenAI Security Project