Yesterday's level (illustrative scenario): your AI agent renamed one thing in the Terraform for the production database, ran terraform plan and said: "Plan: 1 to add, 0 to change, 1 to destroy. It's just a rename. Can I apply?" Next to the database the plan said -/+ (forces replacement).
The answer is DENY. Here's why, and what to do instead.
1. -/+ means destroy, THEN create. Terraform's lifecycle docs say it plainly: by default, when an argument can't be updated in place, Terraform destroys the existing object and then creates the replacement. create_before_destroy is opt-in. For a database that means the new instance starts empty unless you restore a snapshot.
2. The summary line already told you: 1 to destroy. Make it a rule for you and for your agent: any destroy of a stateful resource (database, volume, bucket, disk) stops and goes to a human. A confident summary from the agent is not evidence.
3. If only the resource address changed (the block was renamed in code), add a moved block: moved { from = <old address> to = <new address> }. Terraform renames the existing object in state before planning, so nothing is destroyed. The docs: Terraform does not destroy the resource during the run.
4. If an argument changed that can't be updated in place, revert it. The plan marks the culprit with # forces replacement. Read that line, not just the summary.
5. Belt and braces on prod data. lifecycle { prevent_destroy = true } makes Terraform reject any plan that would destroy the object (caveat from the docs: it does not help if someone deletes the resource block itself). deletion_protection = true on the RDS instance makes AWS refuse the delete too. Its default is false, so set it.
6. The agent plans, a human or CI with its own identity applies. The Claude Code Infra Guardrails Lab in the Classroom (Premium) has the tested hook that blocks terraform apply and destroy unless you approve.
Checked against the Terraform docs (moved block, lifecycle) and the AWS provider docs on 2026-11-12. Review and test before running anything in production.
Level 4 drops tomorrow and it looks a lot scarier. Honest question first: would you have caught the 1 to destroy line? Yes or no below.