github kenryu42/cc-safety-net v2.3.0

4 hours ago

This release adds team-shareable project policies with a human-confirmed policy apply, curated official rulebooks for infrastructure CLIs, and replaces the rulebook lock-and-cache with live vendored files. Installs that added GitHub rulebooks on 2.2 or earlier need a one-time rule sync per scope after upgrading.

Highlights

  • Added a project policy scope: a team lead commits .cc-safety-net/policy.json and every clone picks it up with no member action, layered over each member's own user policy. (#97)
  • Added official rulebooks for Terraform, AWS, gcloud, and Azure, installable with cc-safety-net rule add --only terraform aws --global. (#96)
  • Changed rulebooks to live files: the runtime reads each rulebook.json on every tool call, so an edit applies to the next command with no sync step. (#97)

Added

  • Added cc-safety-net policy check <file> to validate a policy proposal and print its diff, and cc-safety-net policy apply <file> to write it after an interactive terminal confirmation. Add --global to target the user policy instead of the project one.
  • Added project-scope policy merging: the project file supplies safety level, per-feature toggles, per-rule overrides, and path lists, while any field it leaves out keeps inheriting from the user policy. Per-rule overrides merge by rule id, path lists are the union of both scopes, and audit stays user scope only.
  • Added project-policy reporting across every surface: status shows the project policy path and a line-by-line list of what it relaxed, doctor prints the same deltas under Effective Safety, explain names the scope that supplied the safety preset, and the status line shows a 🔻 marker.
  • Added a "Draft project policy" mode to cc-safety-net gui: pick a project directory, mark only the fields to write, review the merged diff and relaxation warnings, and save .cc-safety-net/policy.json. (#98)
  • Added repository-wide rulebook installs: rule add owner/repo adds every rulebook on the default branch, --only <rulebook...> selects specific ones, and --ref <ref> picks a branch, tag, or commit. Running rule add --only <rulebook...> with no source selects from the official cc-safety-net/rulebooks repository. The command now prints the scope it wrote to and the rulebooks and commits it vendored.
  • Added rulebook_version 2, which replaces subcommand and block_args with an exact-token match object (command_path, any_args, exclude_args). Value-taking global options for aws, gcloud, and az are recognized when locating the command path, so options such as --profile prod do not defeat a rule. Version 1 rulebooks keep their fields and behavior.
  • Added fixture evaluation for version 2 rulebooks: their tests entries are checked against the rulebook's own rules by rule add, rule update, and rule verify, and a failing fixture rejects the source before it is written. Fixture commands are analyzed, never executed.
  • Added support for GitHub refs containing /, such as owner/repo#feature/rulebook-v2.

Changed

  • Changed remote rulebook handling: rule add validates and vendors the rulebook files into your own configuration, and nothing updates in the background. Run rule update [source] to re-fetch and rewrite the vendored copies; a source with an ordinary update failure keeps its existing copy while the others still update.
  • Changed rule list to describe version 2 rules by their command path and any_args/exclude_args instead of printing an empty Block args row.
  • Changed the /cc-safety-net skill into a full operator: it explains why a command was blocked, triages false positives, authors rules and policy proposals, manages agent CLI integrations, and diagnoses protection. It is manual-only and never triggers on its own.
  • Changed doctor to report leftover rulebook lock and cache files from an earlier version, with the command that migrates them.

Breaking Changes

  • Replaced the rule sync synchronization step: rulebooks no longer have a lock or cache, and the command now only migrates leftovers from an earlier install.
    • Migration: If you installed rulebooks from GitHub on 2.2 or earlier, run npx -y cc-safety-net rule sync once per scope after upgrading, adding --global for user-scope sources. Until then, those GitHub-sourced rules are inactive and status and doctor report the degraded sources.
  • Removed the --check option from every rule subcommand; passing it is now an error.
    • Migration: Use cc-safety-net rule verify for offline validation of config and rulebooks.

Security

  • Blocked agents from applying policy proposals: cc-safety-net policy apply is denied when an agent runs it, including through package runners such as npx, pnpm dlx, and npm exec, and it refuses to run without an interactive terminal. cc-safety-net policy check stays available so an agent can show what a proposal would change.
  • Extended policy-file protection to the project .cc-safety-net/policy.json, so an agent can no longer create or modify the project policy that the guards enforce.

Don't miss a new cc-safety-net release

NewReleases is sending notifications on new releases.