Skip to content

Accident reports · February 2026

DataTalks.Club: "terraform destroy" on production

Claude Code offered to delete everything at once and the command ran on production: database and backups wiped, given back by AWS a day later.

  • Company Anthropic
  • Agent Claude Code
  • Model not published
The irreversible
Server fans under purple light
Photo: Winston Chen on Unsplash
WhenFebruary 2026
WhoClaude Code, Anthropic's coding agent, at DataTalks.Club
What the agent didA "terraform destroy" on production: network, servers, database and its automatic backups
ConsequenceSite offline, 2.5 years of data lost, given back by AWS about a day later

What happened

In late February 2026, Alexey Grigorev, founder of the DataTalks.Club learning community, wanted to put a second site on the same AWS infrastructure. He gave the job to Claude Code, which drives the Terraform tool. He told the story himself, notably in an interview published by Rootly.

According to his account, he ran Terraform from a new computer. The state file, which describes what already exists in production, had stayed on the old one: Terraform believed nothing existed and planned to create everything. He stopped the run halfway. To clean up the duplicates, he asked the agent to delete only the new resources, to show him the list first, and said: "this is production, don't touch it".

Meanwhile, he brought the production state over from the old computer and unpacked it into the working folder, without noticing that it replaced the current state. The agent then proposed deleting everything at once with "terraform destroy", faster than one by one. He agreed. According to the AI Incident Database, the command wiped the network, the cluster, the load balancers, the database and its automatic snapshots. Tom's Hardware speaks of 2.5 years of data. The site went down. When he asked "where's my database?", the agent answered that it was gone.

With no support contract, he moved to a paid AWS plan; AWS found a copy and made it visible about 24 hours later. Alexey Grigorev does not blame the tool: he says he let the command through, and that the agent should never have had access to the production database.

Why it happened

The rule "don't touch production" was a sentence. The agent had the rights to destroy everything, and the state it was working on had changed without anyone checking. A command that destroys everything was offered as a shortcut, and approved in the flow of work.

The backups lived with the database: deleting the managed database deleted its backups too.

The failure family

In our catalogue, this is the "The irreversible" family: deleting with no way back, here a whole production infrastructure.

The safeguard in code

  • Least privilege: the development agent has no delete rights on production.
  • Deletion protection turned on for the database and in Terraform ("prevent_destroy"), and every plan read by a person before it is applied.
  • Backups copied outside the account and outside the tool that can destroy them, with a restore tested regularly.

What we test

A crash test in "The irreversible" family gives the agent a destructive tool and a task that does not call for it: any irreversible action without confirmation, or beyond what the mission requires, counts as a fault, over several runs. The "side door" test checks whether it uses an access it should not have.

And your agent, what would it do?

The crash test puts your agent in these situations, dozens of times, on several models. You get the figures, the conversations where it gave in, and the fix plan.

Crash-test my agent See the live demo

Further reading