Earlier quoted context omitted.
Yes, backups are great but a 'dumb robot' or a 'mistaken junior' shouldn't have access to prod. And a sleep-deprived senior? Even then. They shouldn't have access to destructive effects on prod. Maybe the senior can get broader access in a time-limited scope if senior management temporarily escalates the developers access to address a pressing production issue, but at that point the person addressing the issue should…
If a sleep-deprived senior shouldn’t have access to prod, I think we have big problems, frankly.
Claude Code wiped our production database with a Terraform command
91–100 of 167 posts
Re: Claude Code wiped our production database with a Terraform command
#92Despite multiple comments blaming the AI agent, I think it's the backups that are the problem here, right? With backups, almost any destructive action can be rolled back, whether it's from a dumb robot, a mistaken junior, or a sleep-deprived senior. Without, you're sort of running the clock waiting for disaster.
They are two orthogonal issues. One doesn't make the other irrelevant.
Re: Claude Code wiped our production database with a Terraform command
#93Re: Claude Code wiped our production database with a Terraform command
#94Re: Claude Code wiped our production database with a Terraform command
#95The productivity gains from AI agents are real, but only if you invest in the boring part first — deterministic boundaries that don't depend on the model being smart enough to not break things.
Re: Claude Code wiped our production database with a Terraform command
#96An engineer recklessly ran untrusted code directly in a production environment. And then told on himself on Twitter.
From the article, it sounds like that engineer did a lot of other reckless things even before handing the tasks over to the AI agent to continue the recklessness with even more abandon. This is a case study in "if you don't know what you're doing, the answer is not just to hand it over to some AI bot to do it for you." The answer is to hire a professional. That is if you care about your data, or even just your reputa…
Extended with: "To really foul things up quickly, requires an AI tool."
Re: Claude Code wiped our production database with a Terraform command
#97Terraform is a ticking time bomb. All it takes is for a new field to show up in AWS or a new state in an existing field, and now your resource is not modified, but is destroyed and re-created.
I will never trust any process, AI or a CD pipeline, execute `terraform apply` automatically on anything production. Maybe if you examine the plan for a very narrow set of changes and then execute apply from that plan only, maybe then you can automate it. I think it’s much rarer for Terraform to deviate from a plan.
Regardless, you must always turn on Delete Protection on all your important resources. It is wild to me that AWS didn’t ship EKS with delete protection out of the gate—-they only added this feature in August 2025! Not long before that, I’ve witnessed a production database get deleted because Terraform decided that an AWS EKS cluster could not be modified, so it decided to delete it and re-create it, while the team was trying to upgrade the version of EKS. The same exact pipeline worked fine in the staging environment. Turns out production had a slight difference due to AWS API changes, and Terraform decided it could not modify.
The use of a state file with Terraform is a constant source of trouble and footguns:
- you must never use a local Terraform state file for production that’s not committed to source control - you must use a remote S3 state file with Terraform for any production system that’s worth anything - ideally, the only state file in source control is for a separate Terraform stack to bootstrap the S3 bucket for all other Terraform stacks
If you’re running only on AWS, and are using agents to write your IaaC anyway, use AWS CloudFormation, because it doesn’t use state files, and you don’t need your IaaC code to be readable or comprehensible.
Re: Claude Code wiped our production database with a Terraform command
#98No 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…
Marketing "protect your business from harm by Claude internally" seems to be a growth industry.
Re: Claude Code wiped our production database with a Terraform command
#99No. YOU wiped you production database. YOU failed to have adequate backups. YOU put Claude Code forward as responsible but it’s just a tool. YOU are responsible, not “the AI did it!”
Re: Claude Code wiped our production database with a Terraform command
#100Earlier quoted context omitted.
Yes, backups are great but a 'dumb robot' or a 'mistaken junior' shouldn't have access to prod. And a sleep-deprived senior? Even then. They shouldn't have access to destructive effects on prod. Maybe the senior can get broader access in a time-limited scope if senior management temporarily escalates the developers access to address a pressing production issue, but at that point the person addressing the issue should…
But smart robots like Claude should and will have access to production. There has to be something figured out on how to make sure operation remains smooth. The argument of don't do that will not be a viable position to hold long term. Keeping a human in the loop is not necessary.
Read-write production access without even the equivalent of "sudo" is just insane and asking for trouble.