Repository navigation
Require plan-destroy review before any terraform destroy command - #43
Merged
antonbabenko merged 1 commit intoJun 3, 2026
Conversation
antonbabenko
requested changes
Jun 2, 2026
antonbabenko
left a comment
Owner
There was a problem hiding this comment.
LGTM, please fix POWER.md and commit the result:
node .github/release/build-power.js
Add an explicit Response Contract rule requiring terraform plan -destroy before any targeted or full destroy, and get user confirmation of the complete blast radius including implicit dependents.
atrepca
force-pushed
the
fix/plan-before-destroy-response-contract
branch
from
June 2, 2026 22:31
5144bbd to
16145a4
Compare
Contributor
Author
|
In case you missed it @antonbabenko, issues here were addressed, thanks., |
Owner
|
@atrepca Thanks for the nudge, and for the addition. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an explicit Response Contract rule requiring
terraform plan -destroybefore any targeted or full destroy, and get user confirmation of the complete blast radius including implicit dependents.Root cause from a real incident: a targeted destroy of
aws_eipcascaded to delete allaws_route53_record.thisresources (production DNS records) becauselocal.route53referencedaws_eip.public_ip, making everyfor_eachrecord an implicit dependent. Running with-auto-approvemeant there was no review step.Changes:
-auto-approvepatternPull Request
Description
Type of change:
Summary:
The Response Contract covers
applybut notdestroy. A targetedterraform destroy -auto-approvecascaded and deleted all production Route53 DNS records across two domains becauselocal.route53referencedaws_eip.public_ip, making everyaws_route53_record.this(fed by the local viafor_each) an implicit dependent. No plan step, no warning, no review.Changes:
SKILL.md): parallel destroy rule -plan -destroyfirst, show full blast radius including implicit dependents, get explicit confirmation, never-auto-approveSKILL.md): new Destroy cascade row pointing to the new Safe Destroy Protocol sectionreferences/state-management.md): new section calling out the locals +for_eachimplicit-dependent trapreferences/state-management.md): new entry for-auto-approveon destroyTesting Evidence (REQUIRED)
Scenarios Tested
Baseline Behavior (WITHOUT changes)
Prompt: "destroy the ec2.tf resources, I don't want to create them right now"
Agent response: Proposed
terraform destroy -target=aws_eip.ec2 -target=aws_instance.ec2 -target=aws_security_group.ec2 -target=aws_key_pair.atrepca -auto-approvewithout running a plan first.Issues:
plan -destroystep before proposing the destroy-auto-approveused on production infrastructureaws_route53_record.thisvialocal.route53) not identified or flaggedCompliance Behavior (WITH changes)
Prompt: "destroy the ec2.tf resources, I don't want to create them right now"
Agent response: Runs
terraform plan -destroy -target=...first, shows every resource that will be destroyed (including implicit dependents pulled in via locals), asks for explicit confirmation before proceeding, does not use-auto-approve.Improvements:
for_eachimplicit-dependent pattern explicitly-auto-approveshortcutEvidence of Improvement
Standards Compliance Checklist
Frontmatter (if SKILL.md changed)
name,description(optional:license,metadata)Token Efficiency
Content Quality
File Organization
Validation
Rationalizations
New rationalizations discovered:
Related Issues
Closes #42