Introducing a new way to review your PRs.

Read the announcement

kenryu42 / cc-safety-net

A pre-execution guard for AI coding agents. It blocks destructive Git and file system commands, plus common attempts to access sensitive files, before a tool call runs. Supports Amp Code, Antigravity CLI, Claude Code, Codex, Cursor, DeepSeek Harness, Devin CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, Kimi Code, OpenClaw, OpenCode, and Pi.

View on GitHub

20 documents · Updated Nov 23, 2026

overview

Knowledge Base updated: 2026-11-22

cc-safety-net knowledge base

cc-safety-net protects coding-agent tool activity by intercepting commands and tool inputs, evaluating them against safety policy and rules, and returning decisions, explanations, and audit information.

Its main parts are the command-analysis pipeline, policy and rule management, agent integrations, operator interfaces, and delivery tooling. Critical state includes policy configuration and snapshots, rulebook sources and resolved rules, integration artifacts, and audit records.

flowchart LR
  Agents[Coding agents] --> Hooks[Hooks and tool adapters]
  Hooks --> Parse[Command parsing]
  Parse --> Analyze[Semantic analysis]
  Analyze --> Guards[Guards and policy rules]
  Policy[Policy, snapshots, rulebook] --> Guards
  Guards --> Decision[Safety decision]
  Decision --> Explain[Explanations and audit]
  Decision --> API[Programmatic API]
  Hooks --> CLI[CLI and diagnostics]
  CLI --> GUI[Browser GUI]
  Build[Build and package tooling] --> Release[Release and verification]
  Release --> Dist[Published distribution]
  Dist --> Agents

Glossary

  • Safety pipeline — the parsing, semantic analysis, guard, and decision sequence used to evaluate an intercepted action.
  • Rulebook — built-in and custom safety rules resolved with policy scope, locking, and resource constraints.
  • Policy snapshot — immutable evaluation context assembled from applicable policy configuration.
  • Tool adapter — integration-specific conversion of an agent tool call into a common safety evaluation.
  • Audit trail — persisted or displayed record of safety decisions and related command traces.

Invariants

  • Intercepted agent actions enter the common safety pipeline through hook routing and adapters (src/**/hook*, src/**/adapter*).
  • Safety outcomes are derived from parsed command structures and semantic facts before guard enforcement (src/**/parse*, src/**/analy*, src/**/guard*).
  • Evaluation context is governed by resolved policy, rules, and snapshots rather than agent-specific decision logic (src/**/policy*, src/**/rulebook*, src/**/snapshot*).
  • Distribution verification is part of delivery safeguards, including package checks in scripts/verify-package.ts.
  • Build and release workflows are driven by package scripts and repository automation (package.json, scripts/**, .github/**).

Routing table