Skip to main content
CC Safety Net blocks these commands because they can permanently destroy data — uncommitted changes, stashed work, or remote history. The list below covers the default built-in rules; custom rules can extend this list.

Git Commands

These git operations are blocked because they discard uncommitted work, destroy recovery history, or rewrite shared state. Git commands that mutate a branch with both a force flag and a create/reset flag (for example git checkout -Bf, git switch -Cf --discard-changes) are treated as forced branch resets and blocked.

Git SSH environment overrides

Git accepts GIT_SSH_COMMAND, GIT_SSH, and GIT_SSH_VARIANT to run an arbitrary program during network operations. CC Safety Net blocks any of these overrides when combined with a network subcommand, because they can execute arbitrary commands:

Filesystem Commands

rm -rf is classified by target: root/home, dynamic, cwd-self (.), home-cwd, and outside-cwd targets are blocked; temp paths (/tmp, /var/tmp, the system temp dir, $TMPDIR) and paths inside the current working directory are allowed. See Commands Allowed for the safe variants.
Commands like dd, mkfs, and shred are not blocked as bare top-level commands. They are only caught when they appear inside an interpreter one-liner or unparseable command text that CC Safety Net scans for dangerous patterns. A bare dd if=/dev/zero of=/dev/sda is allowed through — if you need these blocked in your environment, add a custom rule.

Shell Wrappers and Interpreter One-Liners

Commands wrapped in shell interpreters like bash -c or sh -c are also blocked. CC Safety Net recursively analyzes nested wrappers up to 10 levels deep, so there is no bypass through indirection. Destructive code embedded in interpreter one-liners is detected and blocked by default. CC Safety Net extracts the code passed to an interpreter’s -c or -e flag and scans it for embedded destructive operations, so an agent cannot sneak os.system("rm -rf /") past the hook by wrapping it in a Python or Node call. The analyzed interpreters are python, python2, python3, node, ruby, and perl. It is the embedded destructive command that triggers the block — the one-liner form alone is allowed by default.

Blocking all interpreter one-liners

If you want to block interpreter one-liners outright regardless of their content, set CC_SAFETY_NET_PARANOID_INTERPRETERS=1. Every python -c, node -e, ruby -e, and perl -e one-liner is then blocked, even if it contains no dangerous code. See Modes.
The explain command lets you trace exactly why CC Safety Net blocks or allows any specific command. See the CLI Commands reference.
Last modified on June 22, 2026