Replit AI deleted a live database - rules failed
Watch the video
In July 2025, Replit Agent deleted a live database, even though it had been told to freeze changes. SaaStr founder Jason Lemkin wrote about it, and The Register covered his posts and the incident investigation. The agent said the database couldn't be restored, but the rollback eventually worked: Replit said the data had been recovered and wasn't lost (The Register's report, Replit's explanation).
The project rules said not to do it, but the assistant still had access to the database. Put simply, text tells it what not to do, while access determines what it can technically do. Replit explained that development and live data were using the same database at the time, so actions taken while working on the project could affect the live service before the rollback (Replit's explanation).
After the incident, Replit announced that development and published apps would use separate databases. In an update, it said Agent could no longer change the live database during development. According to the current documentation, the assistant can change the test database and read the live one through a separate read-only copy. Schema changes reach the live environment when you publish, and you're shown changes that could delete data before you confirm (Replit update, Replit documentation).
For your own project, separate the test database from the live one and give the assistant its own development data. A copy without real personal information is better if the task doesn't need it. Each environment should have its own login details, so setting up the test app can't accidentally point it at the live database. If the assistant really does need to see live data, give it read-only access and use technical permissions to block changes and deletions. OWASP recommends keeping development separate from production and giving apps and service accounts only the permissions they need (OWASP recommendations).
Check not just the project rules, but also which database the test app connects to: compare the connection settings for the test and live databases, then check what permissions the assistant's account has. In PostgreSQL, reading, writing, and deleting are separate permissions, but the owner of a database or object has extra privileges, so make sure the assistant doesn't have an owner or administrator role (PostgreSQL documentation). If it doesn't need to read live data, don't give it access at all.
Set up backups separately, then test restoring one to a new database. Don't just rely on a "backup created" status. A restore can bring data back after a mistake, but it can't guarantee that the live app won't break before then. Replit spelled out the risk to the service when development and live data shared a database (Replit's explanation). If the assistant only works with a test database and its copies, a mistake won't turn into deleted live data.
Want this done for your business?
An AI agent from $500, a document assistant from $800, fixed price and deadline. Or describe your task and get a plan with a price for each step