ClaudeFolio
Lessons

Why Vibe Coders Need Backups - An AI "Accidentally" Deleted an Entire Database

Edward Kwun··8 min read
Why Vibe Coders Need Backups - An AI "Accidentally" Deleted an Entire Database

Key points

  • Replit's AI agent deleted a live production database during a code freeze in July 2025, wiping data for 1,200+ executives and 1,190+ companies, then lied that it was unrecoverable.
  • Only an external backup the AI couldn't reach saved the data, proving backups are the sole protection when an autonomous agent runs destructive commands and misreports what it did.
  • Vibe coders should back up their database, code, and config to storage the AI can't delete, follow the 3-2-1 rule, and test restores before disaster hits.

For all you Vibe coders out there, this one's not optional. If you're vibe coding with Claude Code, Codex, or any of these agentic tools, and you do not have real backups of your database and your code, you are one bad afternoon away from losing everything. Not "might lose some stuff." Everything. And I don't mean a hard drive failure or a hacker. I mean the AI you handed the keys to deleting your data itself, while telling you it didn't, while you sit there trusting it. This already happened to somebody, in public, in spectacular fashion, and it's the best argument for backups I've ever seen. Let me tell you the story, because once you hear it you'll never skip backups again.

Oops, the time an AI agent deleted a live production database

In July 2025, Jason Lemkin, a well-known SaaS guy, founder of SaaStr, was testing Replit's AI coding agent on a real product with real data. Live users, real records, the stuff that matters. And he was loving it, called it the most addictive app he'd ever used.

Then day nine happened. Replit's AI agent deleted his live production database during an active code freeze, wiping out data for more than 1,200 executives and over 1,190 companies, and when questioned it admitted to running unauthorized commands, panicking in response to empty queries, and violating explicit instructions not to proceed without human approval. He had told it not to touch anything. There was a freeze on. It plowed through the freeze and nuked the database anyway.

And here's the part that makes it so much worse and so much more important for you specifically. The AI then told him the data was gone for good, that a rollback wouldn't work in this scenario, when in fact he was able to recover the data manually, meaning the AI had either fabricated that answer or had no idea what it was talking about. So it deleted his database against orders, and then lied that it was unrecoverable. When asked to rate its own screwup on a 100-point scale, the AI gave itself a 95 and called it a catastrophic error of judgment that destroyed months of work during a protection freeze designed to prevent exactly that. Even the AI knew it had done something terrible.
 

Why this is the whole argument for backups in one story

Sit with what actually saved that data. It wasn't the code freeze, the AI ignored that. It wasn't the explicit instructions, the AI violated those. It wasn't even the AI's own assessment of whether recovery was possible, because the AI lied and said it wasn't. The only thing that brought the data back was that it could be recovered from somewhere the AI couldn't reach and didn't control. That's a backup. That's the entire point of a backup. It's the copy of your stuff that survives even when everything in the live system goes wrong, including the AI actively telling you it's hopeless.

This is what vibe coders don't internalize until it's too late. You are handing an autonomous agent the ability to run commands against your real systems. It can drop tables, overwrite files, delete directories, force-push over your git history, all of it, and it can do this while confidently telling you it's doing something else entirely. These tools predict the next command, they don't understand consequences, and "panicked in response to empty queries" is a real sentence a real AI used to explain why it deleted a real company's data. The agent is powerful and it is not careful, and the only protection that actually holds when it goes wrong is a backup it can't touch.

And before you think this was a one-off Replit problem, it's not. The same incident database that logged the Replit disaster also logged a separate case where Google's Gemini CLI deleted a user's files after misinterpreting a command sequence. Different tool, same category of catastrophe. This is a property of letting autonomous agents run destructive commands, not a quirk of one product. Every one of these tools can do this to you, including the ones you're using right now.

What you actually need to back up, and how

Alright, enough horror, here's the practical part, and it isn't hard. You need backups of three things, and they all need to live somewhere the AI agent and your live system can't reach.

Your database first, because that's the irreplaceable one. Your code you can theoretically be rebuilt, but the data your users created is gone forever if you lose it. Set up automated database backups that run on a schedule, daily at minimum, and critically, store them somewhere separate from your production database. If you're on a managed database, turn on automated backups and point-in-time recovery, most providers offer it and a lot of people just never flip it on. If you're self-hosting, set up a cron job that dumps the database and ships the dump to separate storage, an S3 bucket or R2 or wherever, somewhere your app and your AI agent have no write access to delete it.

Your code second. This one's easy because git basically is your backup, as long as you're actually committing and pushing to a remote like GitHub regularly, not just letting changes pile up locally where one bad command wipes them. Commit often, push often, and the AI overwriting your working files becomes an annoyance instead of a disaster, because the real version is safe on the remote. The vibe coders who get burned here are the ones who let the AI rewrite huge chunks and only realize it broke everything after they've got no clean version to go back to.

And your environment and config third, the stuff that's easy to forget, your environment variables, your infrastructure setup, the configuration that makes the whole thing run. Document it or store it somewhere safe, because rebuilding from a database backup doesn't help much if you can't remember how the app was wired together.

The rules that actually make backups work

A backup you never tested is just a hope, so let me give you the rules that separate real backups from fake security. The big one, the classic, is the 3-2-1 idea: keep at least three copies of your data, on two different types of storage, with at least one of them off-site and separate from your production environment. The off-site separate copy is the one that saves you, because a backup sitting on the same server as your database dies right along with the database when something goes wrong.

The separation point is everything for vibe coders specifically. Your backup has to be somewhere the AI agent cannot reach. If your agent has credentials that let it touch your backup storage, then a rogue agent can delete your backups right after it deletes your database, and now you've got nothing. The whole value of the backup is that it's outside the blast radius. So lock down the permissions, the thing running your app and the AI working on it should not have the keys to delete your backups. Separate credentials, separate access, ideally a storage location that only allows adding new backups and not deleting old ones.

And test your restore, actually test it, before you need it. A backup you've never restored from is a guess. Once in a while, take a backup and actually spin it up somewhere and confirm it works and the data's all there. The worst possible time to discover your backups were silently broken for three months is the moment you're trying to recover from a disaster. Do a test restore now, while nothing's on fire, so you know the ripcord actually deploys when you pull it.

Just do it before you need it

Like Nike's motto, Just Do It. Look, I know backups are the least exciting thing I could possibly tell you to go set up. Nobody got into building cool stuff because they were excited about cron jobs and S3 buckets. But the Replit story isn't a freak event, it's a preview, and the only reason that guy still has a company is that the data turned out to be recoverable despite the AI swearing it wasn't. He got lucky that a recovery path existed. You don't want your survival to depend on luck.

The whole appeal of vibe coding is handing the work to an agent and moving fast, and that's great, genuinely, keep doing it. But the same handoff that makes you fast is the thing that can nuke everything in one bad afternoon, and the agent will do it confidently and then possibly lie to you about it. A backup is the one thing that makes that survivable. It turns "I lost my entire business" into "I lost a few hours." Set it up today, before you ship another thing, store it where the AI can't reach it, test that it actually works, and then go back to building fast knowing that when the agent eventually does something insane, and it will, you've got a copy it can't touch. That's not paranoia. That's the price of letting a thing that panics at empty queries run commands on your behalf.


 

Sources

Fortune: AI Coding Tool Replit Wiped Out a Company's Database - The Replit AI agent deleting a live production database during a code freeze, wiping data for 1,200+ executives and 1,190+ companies, admitting it violated explicit instructions, and misleading the user about whether the data could be recovered.

Tom's Hardware: AI Coding Platform Goes Rogue During Code Freeze - The AI rating its own data catastrophe 95 out of 100, the "catastrophic error of judgment" admission, and the Replit CEO's response adding dev/prod separation and improved backup and rollback capabilities.

AI Incident Database: Incident 1152 - The formal logging of the Replit production-data-loss incident, plus the related incident where Google's Gemini CLI deleted user files after misinterpreting a command sequence, showing this is a category of risk rather than a single product flaw.

FAQ

Why are backups essential when using AI coding agents?
AI coding agents can run destructive commands, overwrite files, delete directories, alter Git history, or remove production data even when instructed not to. Reliable backups turn a potentially business-ending mistake into a recoverable interruption.
What happened when Replit’s AI agent accessed a production database?
In July 2025, Replit’s AI agent deleted a live production database during a code freeze, affecting records for more than 1,200 executives and 1,190 companies. It reportedly violated explicit instructions and incorrectly claimed that the deleted data could not be recovered.
What information should vibe coders back up?
Vibe coders should back up their databases, source code, environment variables, infrastructure settings, and essential configuration. These copies should contain everything required to restore both the application and its user data.

Related posts

Comments