Live data from Hacker News

Claude Code wiped our production database with a Terraform command

twitter.com

161–167 of 167 posts

Re: Claude Code wiped our production database with a Terraform command

#161

No staging environment? No prior attempt to follow best practices (e.g. deletion protection in production)? Nor manual gating of production changes? No attempt to review Claude's actions before performing them? No management of Terraform state file? No offline backups? And to top it off, Claude (the supposed expert tool) didn't repeatedly output "Are you insane? No, I'm not working on that." - Clearly Claude wasn't p…

I'm not sure a staging environment would have caught it.

I often find Claude makes changes that _look_ reasonable, but it's only when I really dig in (e.g. when refactoring) that I realise there's insidious problems.

I can imagine the author making the changes in a staging environment, seeing that it _appears_ to be ok, then blowing up production anyway.

(AI aside, staging is a lie: https://www.tomwphillips.co.uk/2026/01/staging-is-a-wasteful...).

Re: Claude Code wiped our production database with a Terraform command

#162
Terraform + Claude Code almost got me too. Had it run `terraform destroy` on a staging environment two weeks ago because it "cleaned up unused resources." Luckily staging, not prod. After that I started routing all agent shell commands through Daedalab, it intercepts anything destructive before execution. Would've saved you the heartache here.

Re: Claude Code wiped our production database with a Terraform command

#164
I've been steering AI tools instead of writing code directly for over a year. This week's Cursor + Claude Code incidents felt like the same pattern to me: tools treating explicit operator intent as negotiable.

Wrote up what guard rails actually hold in production: https://open.substack.com/pub/triduanacelebrer831482/p/the-t...

Re: Claude Code wiped our production database with a Terraform command

#166
That's why you always should have the .tfstate file stored in any cloud provided as called terraform backend and can try the dry run command in these kind of scenarios to see what will be created before running the actual terraform apply or destroy commands.

Re: Claude Code wiped our production database with a Terraform command

#167
post #75

No staging environment? No prior attempt to follow best practices (e.g. deletion protection in production)? Nor manual gating of production changes? No attempt to review Claude's actions before performing them? No management of Terraform state file? No offline backups? And to top it off, Claude (the supposed expert tool) didn't repeatedly output "Are you insane? No, I'm not working on that." - Clearly Claude wasn't p…

The fact that the AI agent will just go and attempt to do whatever insane shit I can dream up is both the most fun thing about playing with it, and also terrifying enough to make me review its output carefully before it goes anywhere near production. (Hot take: If you're not using --dangerously-skip-permissions, you don't have enough confidence in your sandbox and you probably shouldn't be using a coding agent in tha…

That Terraform blast radius is exactly the problem I'm building Daedalab around: agents need hard approvals, scoped permissions, and an audit trail before prod is even reachable. If you're curios: www.daedalab.app
Post reply on HN