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
src/**/parse*/**,src/**/parser*/**,src/**/engine*/**-> Command safety evaluation pipelinesrc/**/shell*/**,src/**/powershell*/**,src/**/heredoc*/**,src/**/tool*input*/**-> Command and tool-input parsingsrc/**/analy*/**,src/**/guard*/**,src/**/secret*/**,src/**/protected*path*/**-> Semantic command analysis and guardssrc/**/decision*/**,src/**/explain*/**,src/**/audit*/**,src/**/trace*/**-> Safety decisions, explanations, and audit trailsrc/api/**,src/**/public*api*/**-> Programmatic safety APIsrc/**/policy*/**,src/**/rule*/**,config/**-> Policy and rule managementsrc/**/policy*store*/**,src/**/snapshot*/**,src/**/policy*schema*/**-> Policy storage and snapshotssrc/**/rulebook*/**,src/**/custom*rule*/**,rules/**-> Rulebook resolution and customizationsrc/**/integration*/**,src/**/agent*/**,plugins/**-> Agent integrationssrc/**/hook*/**,src/**/adapter*/**,src/**/tool*call*/**-> Hook routing and tool adapterssrc/**/install*/**,src/**/detect*/**,src/**/system*info*/**-> Integration installation and detectionsrc/**/connectors/**,src/**/claude*/**,src/**/codex*/**,src/**/copilot*/**,src/**/cursor*/**-> Agent connector implementationssrc/cli/**,src/**/gui*/**,src/**/doctor*/**-> Operator interfacessrc/cli/**,src/**/command*dispatch*/**,src/**/statusline*/**-> CLI command workflowssrc/**/doctor*/**,src/**/audit*log*/**,src/**/explain*command*/**-> Diagnostics and audit interfacessrc/**/gui*/**,src/**/browser*/**,src/**/frontend*/**,public/**-> Browser GUI- package.json,
scripts/**,.github/**, tsconfig*.json -> Build, packaging, and release engineering - scripts/build*.ts, scripts/prepare*.ts, scripts/generate*license*.ts, package.json -> Build and package orchestration
- scripts/verify-package.ts, scripts/release*.ts,
.github/workflows/**, scripts/verify*.ts -> Release and verification workflows