Repolode
kenryu42

kenryu42/cc-safety-net

A pre-execution guard that blocks destructive Git and file system commands and secret-file access for AI coding agents like Claude Code and Codex.

Stars
1,742
Forks
88
Open issues
6
Last commit
1 hour ago

What is it?

CC Safety Net sits in front of AI coding agent tool calls and blocks destructive commands, such as git reset --hard, git push --force, and rm -rf on dangerous targets, before they run. It parses what a command actually does, so wrapping it in bash -c or python -c, or reordering flags, does not hide it. It also blocks access to secrets like SSH keys, .env files, ~/.aws, and coding-CLI credentials, from both the shell and the agent's file tools.

It supports a long list of coding CLIs on Windows, macOS, and Linux, including Claude Code, Codex, Cursor, Gemini CLI, OpenCode, and Hermes Agent. Policy can be tuned through a GUI with Standard, Strict, and Paranoid presets, extended with official rulebooks for Terraform, AWS, gcloud, and Azure or custom JSON rules, and shared across a team by committing the .cc-safety-net/ directory.

CC Safety Net is a guardrail, not a sandbox. It does not isolate processes, change filesystem permissions, or monitor network traffic. The checker can also be called from Node.js through checkCommand without installing the hook.

Key features

  • 01Blocks destructive Git and rm commands, including those wrapped in bash -c or python -c.
  • 02Blocks access to SSH keys, .env files, ~/.aws, and CLI credentials.
  • 03Offers Standard, Strict, and Paranoid presets configurable through a GUI.
  • 04Supports official rulebooks for Terraform, AWS, gcloud, and Azure, plus custom JSON rules.
  • 05Lets teams share policy by committing the .cc-safety-net/ directory.

Use cases

  • Running AI coding agents such as Claude Code or Codex on a machine with real repositories and credentials.
  • Enforcing a shared safety policy across a team's clones and cloud agent sessions.
  • Adding guardrails for infrastructure tools like Terraform or cloud CLIs used by agents.

Topics

FAQ

What is cc-safety-net?
A pre-execution guard that blocks destructive Git and file system commands and secret-file access for AI coding agents like Claude Code and Codex. CC Safety Net sits in front of AI coding agent tool calls and blocks destructive commands, such as git reset --hard, git push --force, and rm -rf on dangerous targets, before they run. It parses what a command actually does, so wrapping it in bash -c or python -c, or reordering flags, does not hide it. It also blocks access to secrets like SSH keys, .env files, ~/.aws, and coding-CLI credentials, from both the shell and the agent's file tools.
Is cc-safety-net free to use? What license does it have?
cc-safety-net is open source under the MIT license. Check the license terms before using it in commercial products.
Is cc-safety-net still maintained?
Actively maintained. The last commit to cc-safety-net was on Oct 22, 2026.
What can I use cc-safety-net for?
Running AI coding agents such as Claude Code or Codex on a machine with real repositories and credentials. Enforcing a shared safety policy across a team's clones and cloud agent sessions. Adding guardrails for infrastructure tools like Terraform or cloud CLIs used by agents.
Where can I get cc-safety-net?
The source code and installation instructions are on GitHub: https://github.com/kenryu42/cc-safety-net

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects