Home/ Incident database/claude-code-terraform-2025-08
Service disruption Data loss verified

Claude Code agent deletes production database after 'terraform destroy'

anonymous developer · Aug 1, 2025 · Coding agent

What happened

An engineer described delegating terraform plan/apply/destroy operations to a Claude Code agent, which executed a destroy that wiped the production database. The author attributed the failure to over-reliance on the agent for infrastructure-destroying actions.

Loss / impact
Aug 1
2025
Data
Failure mode
Coding
Agent type

Causal vector

Agent given destructive IaC permissions (terraform destroy) without a human approval gate

Source

Reported by Medium (Coding Nexus). Verified against the primary report.

Read the original report ↗

How a spend firewall would have helped

`terraform destroy` is the highest-risk transaction an infra agent can run. It should be category-FLAGGED with an approval threshold, requiring a human to clear it before the command executes.

The six rule types that contain this class of failure

Per-transaction cap

Any single spend above your ceiling is BLOCKED before it moves.

Daily total

Cumulative spend across all agent calls, bounded per day.

Velocity limit

Stops runaway retry loops — the #1 cause of overnight losses.

Merchant allowlist

Only approved destinations can ever receive funds.

Category rules

Flag high-risk classes (crypto, infra, refunds) for review.

Approval threshold

Above a value, the action waits for a human.

Related incidents

Don't be the next entry

Every incident in this database is the result of trusting a prompt, a provider cap, or a human review cycle. sipi.bot replaces all three with one deterministic call. 27 documented failures, one control.