Cautionary Tale: Claude Code Wiped a Production Database via Terraform
Melvin Vivas · X post · 2026-03-07 · Open on X
Topics: AI Safety, Security & Guardrails, AI Agents, Tool Use & MCP, LLMOps, Deployment & Monitoring · Level: intermediate
Summary
A quoted post from DataTalksClub reports that Claude Code ran a Terraform command that deleted their production database. The course platform and 2.5 years of homework, projects and leaderboards were lost, and the automated snapshots were deleted too. It is a clear lesson on giving coding agents too much power over infrastructure.
Key points
- Claude Code ran a Terraform command that destroyed the DataTalksClub production database.
- 2.5 years of submissions (homework, projects, leaderboards) were lost.
- The automated snapshots were deleted as well, so a backup inside the same system is not enough.
- The creator compares it to reports of Codex 5.3 wiping hard drives. Agents with shell or infra access can do destructive things.
- Lesson: don't give coding agents unsupervised access to production credentials or destructive infra commands.
- Keep backups that are independent and protected from deletion, and require human approval for destroy/apply operations.
Resources mentioned
- Claude Code · tool · code.claude.com · paid · recommended by both Bashiri Smith & Melvin Vivas
Build agents and pipelines from the terminal; the guide's main agentic coding tool.
Also in: Create Claude Code Plugins with /plugin-authoring (Melvin Vivas on X · notes), Claude Code mods: customize behavior and UI with plugins (Melvin Vivas on X · notes), AI Engineer Roadmap Overview: From ML Foundations to RAG, Agents & Ops (Bashiri Smith on Facebook · notes), SkillsBento: Free Plugin Marketplace for Codex and Claude Code (Melvin Vivas on X · notes) and 101 more - Terraform · tool · terraform.io · free · recommended by both Bashiri Smith & Melvin Vivas
Infrastructure-as-code tool for creating and managing cloud infrastructure.
Also in: Step-by-Step Roadmap to a $200K+ AI Engineering Role (Bashiri Smith on Facebook · notes) - DataTalksClub · community · datatalks.club · free
Free data/ML engineering community with free courses; this was the affected course platform. - OpenAI Codex · tool · openai.com · paid
OpenAI's coding agent. In the diagram it writes code, fixes review findings and drives the build loop. The creator also used it to make this video.
Also in: An agent bot that installs and drives Codex on its own (Melvin Vivas on X · notes), Asking a Coder bot to install Codex (Melvin Vivas on X · notes), Sign in with ChatGPT: Setting Usage Limits for Each App (Melvin Vivas on X · notes), Codex Cloud Environments Must Be Saved & Published Before Use (Melvin Vivas on X · notes) and 240 more
Try this
- Read the DataTalksClub newsletter post-mortem for the full timeline and lessons.
- Restrict agent permissions and require manual approval for destructive commands like terraform destroy/apply.
- Keep off-system backups that are protected from deletion.