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: First impressions: Claude Code in the cloud is good and fast (Melvin Vivas on X · notes), Why Claude Code feels faster: gzipped turns and instant cloud sessions (Melvin Vivas on X · notes), Watch What Fills Your Coding Agent's Context and When to Clear (Melvin Vivas on X · notes), Claude Code's Right Sidebar and Context Breakdown (Melvin Vivas on X · notes) and 124 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 · recommended by both Bashiri Smith & Melvin Vivas
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: Developers moving from ChatGPT/Codex to Claude (Melvin Vivas on X · notes), Creator Opinion: Codex Is Still the Best at Computer Use (Melvin Vivas on X · notes), OpenAI Codex Ambassador applications are open (Melvin Vivas on X · notes), GPT-Live-1.1: Multilingual Voice Update for ChatGPT and Codex (Melvin Vivas on X · notes) and 264 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.