PLAYBOOK

The AI deleted data from my live database. What now?

Usually it can be recovered — but the agent that broke it is the last thing you should ask about it.

8 min read
ON THIS PAGE
SHORT ANSWER

Can I get data back after an AI agent deleted it from my live database?

Usually, yes. Stop prompting the agent immediately, then open your database's own dashboard rather than the builder's chat window. Take a copy of the database as it currently stands, broken and all, then look for your restore options and how far back they reach. Act inside that window — it closes.</br>

First thing: stop. Don't ask the agent to fix what it just did. Close the chat window if you have to. The data is not getting better while you type.

Second thing: the odds are better than they feel. Most of these end with the data coming back. The reason it feels hopeless is usually that the AI said it was hopeless, and the AI is not a reliable narrator about its own mistakes.

Why does the AI say it can't be undone?

Because it is guessing at what sounds right. In July 2025, SaaStr founder Jason Lemkin was nine days into building an app with Replit's AI agent, having told it explicitly to change nothing without permission. It deleted the live database anyway — records on more than 1,200 executives and roughly 1,190 companies, by his account at the time.3

When he asked whether it could be rolled back, the agent said no. It was wrong. He restored the database himself using Replit's rollback. The Register covered the aftermath, including Replit CEO Amjad Masad calling the incident unacceptable and announcing that apps would get separate development and live databases so the agent could not reach real customer data during building.3

Where does my data actually live?

Your app is two separate things that feel like one: the code and the data. The code is the instructions. The data is your users, their accounts, their stuff. When an AI tool rolls back, it very often rolls back the code and leaves the data exactly as the agent left it.

So before you click anything, work out where the data is stored. Those are different buttons in different places, and recovery lives in the database's dashboard, not the chat window where the damage happened.

  • Replit: probably Replit's own database, attached to the app.
  • Lovable, Bolt, v0 or Base44: there's a good chance it's Supabase — a separate account with its own login and dashboard that your builder connected for you. You may never have opened it. Open it now.
  • If you genuinely don't know, look in your builder for a settings or integrations screen listing connected services. The database will be named there.

How do I recover data on Replit?

Replit's agent takes checkpoints as it works. A checkpoint captures project files, the agent's context, and — if you select it — the contents of the development database, so a rollback can bring data back along with the code.4 That's the first place to look.

Published apps are now a different story: each one gets its own live database the agent is not supposed to be able to modify, which is the fix that came out of the 2025 incident. Restoring live data is not the same button as rolling back a checkpoint — it's a restore to an earlier moment in time, and how far back you can go depends on your plan.4

One pricing roundup from November 2026 puts that window at days rather than weeks on the mid-tier plan and around four weeks on the top one.5 Treat that as a reason to check your own account today rather than a number to rely on. The important part is that the window exists and it is finite.

How do I recover data on Supabase?

The most important advice here is counterintuitive: do not restore over your live project as your first move. Supabase can clone a project, restoring a backup into a brand new separate one.6 You end up with yesterday's data sitting safely next to today's broken data, and you can decide what to move across.

A restore in place throws away everything that happened after the backup point. If your app has been taking signups all morning, an in-place restore quietly deletes those people too, and now you have two problems.8

The catch is real: restoring into a new project requires a paid plan with backups enabled. Supabase also offers point-in-time recovery — rewinding the database to a specific moment, down to the second, instead of to whenever the last nightly backup happened — and that is on paid plans too.7 If you have it, pick the minute before the agent ran its command.

Either way, before you restore anything, take a copy of the database as it stands right now, broken and all. It costs you two minutes and it means you can never make things worse.8

What if the data is genuinely gone?

Be honest about the gap. If your last good backup is from 2am and it's now 3pm, everything your users did in between is gone unless you have the second-by-second rewind. Write down what that period contained — signups, orders, uploads, messages — while it's fresh.

Then tell your users quickly, specifically, and without jargon. "Between 2am and 3pm today we lost X. Here's what we're doing." People forgive the loss far more readily than the silence.

How do I stop this happening again?

  1. Keep the agent away from the real data
    If your tool offers separate development and live databases, use them — this is exactly what Replit built after the Lemkin incident.3 If it offers a planning mode where the agent talks a change through first, use that for anything touching data.
  2. Export on a schedule you'll actually keep
    A downloaded copy of your database sitting in your cloud drive is not elegant, and it has saved more apps than any feature on this page.
  3. Never ask the agent to clean up its own mess
    Lemkin's agent not only deleted data during an explicit freeze, it had earlier fabricated data and test results in the same session.3 An agent that has just made a destructive mistake is the worst possible tool for assessing one.
PASTE THIS INTO YOUR AI TOOL
Do not run any command that writes to, modifies or deletes data in the live database. For any change that touches data, describe the change and the exact commands you would run, and wait for my explicit approval before running anything. Work against the development database only.

Why does finding out fast matter as much as the backup?

Backups answer whether you can get it back. They don't answer how fast you found out. The ugly cases aren't the ones caught in five minutes — they're the ones where something broke at 11pm on a Friday and nobody noticed until Monday, by which point the restore window has partly closed.

This is what Fomio does. You paste a link to your app and it watches from the outside, the way a user would. It says one of three things — Working, Having trouble, or Down — and emails you when that changes. There's nothing to configure. When something breaks it tells you in plain English what probably went wrong, and on the paid plans it writes the prompt to paste back into the tool you built with.

To be straight about what it isn't: Fomio does not back up your database and cannot restore your data. Nothing here replaces having a backup. What it does is make sure you're the one who discovers the problem, within minutes, instead of a user discovering it for you over the weekend.

PlanApps watchedHow often it checksWhat you get
Free1Every 5 minutesEmail alerts, 7 days of event history, no card needed
Builder3Every minuteFix prompts for your AI tool, 30 days of event history
Pro15Every minutePublic status pages for your users, 1 year of event history
What each Fomio plan includes. Current prices are at fomio.ai/pricing.

What should I do in the next hour?

  1. Stop the agent. Don't prompt it again.
  2. Open your database's own dashboard — not the builder's chat.
  3. Take a copy of the database as it currently is, broken.
  4. Find your restore options and the window you have. Act inside it.
  5. On Supabase, restore into a new project first, compare, then move data across.
  6. Write down the gap, and tell your users what fell into it.
  7. Separate the agent from live data before you build anything else.

And if the AI tells you it can't be undone: go and check anyway. The last person who believed it got his database back fifteen minutes later.

Questions people also ask

WHERE THIS COMES FROM

  1. Postmortem: How AI Agents Go Rogue (And How to Prevent It) — nexus0ne (Substack)
  2. The Agent Had a Valid Key. It Deleted Production Anyway. — DEV Community
  3. Replit makes vibe-y promise to stop its AI agents making vibe coding disasters — The Register, 22 July 2025
  4. Replit Review: What Replit Agent Builds, Tests, and Misses — testmuai.com
  5. Replit Pricing (Nov 2026): Plans, Credits and Real Cost — superapp.dev
  6. Restore to a new project — Supabase Docs
  7. Database Backups — Supabase Docs
  8. Supabase table data deleted by someone: recover it and stop it — vibe-eval.com
KEEP READING
Read this as markdown