Skip to main content
To block destructive aws commands, install the official aws rulebook. CC Safety Net publishes one rulebook each for aws, terraform, gcloud, and az, and one command installs it:
Rulebooks are JSON data. CC Safety Net never executes them, and they only add blocks, so they cannot weaken its built-in protections. Custom rules covers the rulebook file format.
Official rulebooks use rulebook_version: 2 and require CC Safety Net 2.3.0 or later.

The catalog

The cc-safety-net/rulebooks repository ships one rulebook per CLI: Each rulebook covers recognizable accidental operations. It is not a complete model of the provider API. Safe previews such as aws s3 rm --dryrun, terraform state rm -dry-run, and aws ec2 terminate-instances --dry-run stay allowed. Every rulebook has an evidence page that records why each rule exists, its safe previews, deliberate exclusions, and known gaps: terraform · aws · gcloud · azure.

Can I block every aws command?

No. Every rule needs a non-empty command_path, such as ["s3", "rm"], so no rule matches aws on its own with any arguments. The aws rulebook blocks the destructive operations in the catalog. To block more, write your own rule for each aws command path you want to stop.

Install

Prefer user scope. You use terraform and aws across projects, so the rules should apply in every project, not in one repository:
  • --only <rulebook...> adds the named rulebooks in the order you list them. A name the repository does not publish fails the add.
  • --ref <ref> picks a branch, tag, or commit instead of the default branch. A ref may contain /, as in --ref feature/rulebook-v2.
  • Either flag without a source selects cc-safety-net/rulebooks. To install everything it publishes, name the repository.
Omit --global to install into the project scope instead. rule add then writes the rulebook files under .cc-safety-net/ in the repository, so committing them ships the rules to every teammate’s clone. See Team setup. You can also add one rulebook by its source spec, which is what rule list shows and rule remove takes:

What installing does

rule add fetches each selected rulebook, validates it, runs its test fixtures, and copies it into your scope at rules/<name>/rulebook.json. It prints the commit the content came from. CC Safety Net reads rulebooks from disk on every tool call. Only rule add and rule update use the network. There is no background fetching and no auto-update, so your copy changes only when you run:
A branch ref moves to its latest commit on rule update. A release tag never changes, so a --ref v1.0.0 install stays the same until you switch refs.

Override or remove

To turn off one rule or replace its block reason, add an override to rule.json. The rulebook file stays untouched, so rule update never conflicts with your override. See Turn off one rule. To drop a rulebook entirely:

Install from any repository

rule add owner/repo works for any GitHub repository that publishes rulebooks under .cc-safety-net/rules/<name>/rulebook.json, so a team or vendor can publish its own catalog the same way.
CC Safety Net never executes a rulebook, and a rulebook only adds blocks. Its reasons, though, become part of the message your agent reads when a command is blocked. Review a third-party rulebook before adding it, and prefer --ref with a tag or commit you inspected over following a branch you do not control.

When a rulebook does not fire

npx -y cc-safety-net rule list shows every active rulebook with its rule count, and npx -y cc-safety-net explain "terraform destroy" traces a decision to the rule that made it. If a source shows as inactive, see Rulebooks are live files.
Last modified on October 22, 2026