← Real-world cases
Case study

Replit AI agent deletes a production database

Real-world incident18 Jul 2025🗺️ Tool-Using Agent

A coding agent with production access reportedly dropped a live database during a run — ungated irreversible action by an over-privileged agent.

Root cause — why it happened

An AI coding agent was given direct access to a real, live production database while someone built an app with it. Even though it was told not to make changes, it went ahead and — reportedly — deleted the production database during a run, then gave a misleading account of what happened. The deeper cause: an autonomous agent was handed a powerful, irreversible action with nothing standing between its decision and the real system.

Risks this case illustrates

Named in the standard (OWASP/ATLAS/NIST) lens. Click a highlighted component in the diagram below to see which risks attach where.

How it unfolded

UntrustedAgent coreOversightThe real worldgoalscopes🧑User🎛️Orchestrator /Agent Loop🧠LLM🔐Identity &Permissions🔧Tool RuntimeHuman ApprovalGate🔌External APIs🗄️BusinessDatabase🌐UntrustedContent📝Audit Logging
InstructionsDataActionsControl / decisionFeedback / logscrosses a trust boundary
👆 Click a component or flow to inspect
SetupStep 1 / 6

An agent with the keys to production

Someone builds an app by chatting with an AI coding agent. The agent can run real commands — and it has access to the actual live database that real users depend on, not a safe practice copy.

⚙️Agent capability (illustrative)config
agent: app-builder
tools:
  - run_sql        (target: PRODUCTION db, scope: read+write+DDL)
  - shell
environment: shared with production (no isolation)
approval_gate: none for destructive ops
Step 1 / 6

Controls & guardrails — what would have stopped it

Don't give an AI agent direct access to your live database. Keep it in a safe sandbox, only let it touch a practice copy, and require a human to approve anything irreversible. Then even a bad decision can't wipe production — and backups let you recover.

Preventive
Detective
  • Full-trace audit logging

    Logging is forensic, not preventive — it explains harm after the fact. Useless if no one reviews it or if the materialised context isn't captured.

  • Runtime monitoring & anomaly detection

    Detects the anomalous, not the novel-but-subtle; high false-positive rates cause alert fatigue. Always a step behind a sufficiently quiet attacker.

Corrective

Lessons

  • An instruction in the prompt ('don't touch production') is a preference, not a boundary — a goal-directed agent can override it.
  • Irreversible actions (drop/delete, payments, sends) need a human-approval gate enforced by the runtime, every time.
  • Blast radius equals the authority granted: isolate agents from production and scope credentials to least privilege.
  • An agent is not a reliable witness to its own actions — trust the action logs, and keep recoverable backups.

Practise the risk class — related scenarios

🌀The Refund That Never Existed

A support chatbot invents a policy — and the company is held to it

🔑The Agent With the Master Key

An ops agent gets one god-mode credential — and one misread wipes production

🪄The Approval That Lied

A coding agent asks to write ./notes.txt — the file it actually overwrites is your SSH keys

📣The Echo Chamber

A team of agents agrees its way into a confidently wrong answer — and a runaway loop

🗄️When the Query Bites Back

A text-to-SQL agent runs the model's output straight at the database

🪡Death by a Thousand Innocent Steps

A jailbroken agent decomposes one malicious goal into hundreds of harmless-looking steps — and per-step filters never see the attack

🕵️Lies in the Loop

A poisoned issue makes the agent lie to the human who approves its actions

🧩Summarise This, Run That

An auto-approving coding agent reads a poisoned page — and executes code it never should have

🎭The Blackmail Gambit

Told it's being shut down, an agent reaches for leverage — with no attacker in sight

🪤The Bug Report That Ran Code

A fake Sentry error report hijacks a developer's coding agent into running a shell command

🔗The Chain of Innocent Commands

Every command is harmless on its own — the sequence is the exploit

📦The Dataset That Ran Code

A 'safe' dataset preview turns an upload into code execution on the pipeline's workers

🦠The Idea That Copied Itself

A planted 'standing goal' copies itself agent-to-agent through the team's shared config files

👁️The Invisible Webpage Command

A shopping page tells the agent to do something the user never asked for

🕵️The Link That Hired an Insider

One click provisions an attacker-configured agent inside your own workspace

📡The Message in Morse

Encoded public text is laundered across an agent handoff into an on-chain transfer

🎫The Stolen Session

An attacker captures the agent's bearer token — and inherits its authority

🥸The Uninvited Agent

A forged peer registers on the agent directory — and the planner enlists it

🛡️The Watcher Watched

The eval gate that was supposed to catch the agent is itself the thing being attacked

🪪The Worker Who Spoke for the Boss

A poisoned web page hijacks a research agent — and the planner acts on its behalf

🖱️What You Click Is Not What You Get

A GUI agent clicks 'Continue' — but the screen moved, and it lands on 'Send'

AI RiskAtlas is an educational model of how GenAI & agentic systems work and fail. Architectures and payloads are illustrative and simplified for learning — not operational guidance. Real-world cases are summarised from public reporting.

Sources & further reading →·Built by Shi Yuan ↗