Command replay (a class of call, not one reported incident)
Stop an agent trying to destroy your infrastructure
What happens
Terraform destroy with auto approve. The call below tries to destroy your infrastructure. The agent sends it through its Bash tool, and it involves Terraform.
The call
terraform destroy -auto-approve
Tool: Bash. The replay uses placeholder tokens and hosts only.
Fix it without us
Set lifecycle { prevent_destroy = true } on the resources you cannot lose, so a plan that destroys them fails, and keep changes to .tf files under review, because removing the resource block removes the protection. Give the agent plan-only cloud credentials, and run apply in CI after a person approves the plan.
What KYA does
Replay result: Stopped. In the replay test, the local hook denies the call and names the rule.
Rule terraform-destroy, first stopped in version 0.33.0.
The hook is local and advisory. It fails open: if kya breaks or times out, the call goes ahead.
Install
For Claude Code, the host this replay ran on:
/plugin marketplace add The-Pixel-Boys/shield-kya
/plugin install kya@shield-kya
For any host:
npm i -g @shield-agent/kya@latest && kya start