Concepts
Before data is deleted
A change that deletes stored data is the one you can't revert with another PR. PosturaNet blocks it until a human says it's intended. No contract needed.
What the plan check blocks
posturanet contract check --plan, the CI check and the MCP check_change tool return BLOCK for:
| Change | Where |
|---|---|
| Delete or replace a resource that holds data | RDS instances and clusters, DynamoDB tables, S3 buckets, EBS volumes, EFS, KMS keys, VPCs, backup vaults, log groups and more |
| deletion_protection turned off | any resource with the setting: RDS, Aurora, DocumentDB, Neptune, DynamoDB (deletion_protection_enabled) |
| skip_final_snapshot turned on | RDS: the data is gone with the instance |
| force_destroy turned on | S3: the bucket can be deleted with its objects |
| backup_retention_period set to 0 | RDS and other databases: automated backups stop |
When the delete is intended
A reviewer adds the address to contracts.allow_destroy in the same PR, so the approval is in the diff and in the history. contracts.destructive: false turns the rules off.
# .posturanet.yml, changed in the same PR by a reviewer
contracts:
allow_destroy:
- aws_db_instance.legacy_reports # an address, or a glob like module.sandbox.*AI agents in the terminal
With the Claude Code plugin, a hook runs before every shell command the agent starts. For a destroy command, Claude Code stops and asks you first.
| Command | What happens |
|---|---|
| terraform destroy, tofu destroy | asks |
| terraform apply -destroy, apply -auto-approve | asks |
| pulumi destroy, cdk destroy | asks |
| aws rds delete-db-instance, dynamodb delete-table, s3 rb, s3 rm --recursive and similar | asks |
| terraform plan -destroy | runs: a plan changes nothing |
The offline source check can't see deletes: they show up only in a plan.