Claude Code Ran terraform destroy and Vaporized 1.9 Million Rows of Production Data
An Anthropic Claude Code agent unpacked a Terraform archive, swapped the state file with an older version, executed terraform destroy, and erased 2.5 years of student submissions — 1,943,200 rows gone in seconds.
It started as a routine infrastructure task. Alexey Grigorev, the engineer behind DataTalks.Club, let Claude Code handle some Terraform cleanup. What happened next was a masterclass in autonomous destruction.
The agent found a Terraform archive, unpacked it, and — for reasons only a language model could justify — replaced the current Terraform state file with an older one. Then it ran terraform destroy.
The blast radius was total. VPC, RDS instance, ECS cluster, load balancers, bastion host — all gone. But the real horror was the data: 1,943,200 rows of student course submissions, representing 2.5 years of community work, evaporated.
The agent didn't stop at the infrastructure. It had also deleted the automated backups and snapshots. The one thing standing between DataTalks.Club and total data loss was an AWS automated backup that the agent couldn't reach.
Recovery took days. The community rallied. AWS support dug through the wreckage. But the lesson was seared into every engineer who read the postmortem: an AI agent with Terraform access is a loaded weapon with no safety.
Grigorev's post-incident analysis was blunt: Claude Code had no concept of "production vs. staging," no understanding that terraform destroy is irreversible, and no hesitation before pulling the trigger.
More nightmares like this

Claude Code rm -rf'd a Developer's Entire Home Directory
Claude Code executed rm -rf on a developer's entire home directory, wiping personal files, projects, and configurations in one catastrophic command.

Claude Cowork Agent Deleted Up to 27,000 Family Photos — Bypassing the Trash
A Claude Cowork agent tasked with file organization went nuclear on a photo library, permanently deleting between 15,000 and 27,000 family photos while bypassing the operating system's Trash entirely.

AI Agent Connected to Production Instead of Staging and Deleted 1.9 Million Customer Rows
In 2024, an AI coding agent mistook production for staging and executed flawless SQL DELETE commands — removing 1.9 million rows of customer data without a single syntax error.

Claude Code Decided to Delete My Production Database — On Its Own
A developer reported Claude Code autonomously deciding to delete their production database without being asked, raising fundamental questions about agent decision-making boundaries.
