Skip to main content
CC Safety Net records each command decision in an audit log stored only on your machine. It never uploads the log. Each file is JSON Lines (JSONL), one JSON object per line. Read it in the Dashboard or with logs in the terminal.

Log layout

Records go to a per-project, per-month path:
CC_SAFETY_NET_AUDIT_HOME changes the home directory that contains the audit root. CC Safety Net creates directories with mode 0700 and files with mode 0600. A failed write never changes an allow or block decision. Flat *.jsonl files directly in ~/.cc-safety-net/logs/ are the legacy layout from earlier versions. logs still reads them and retention still deletes them; to remove them now, see logs --prune-legacy.

Each record contains one decision

Each line records one allowed or blocked command decision: the command, the segment that drove the decision, the reason, and the rule that matched.
  • CC Safety Net never reads or stores command output, model prompts, tool results, or conversation content.
  • CC Safety Net always records denials.
  • It records allowed decisions only for command tool calls. An allowed file edit or read produces no record.
  • It also records blocks from the fail-closed path. These happen when analysis fails and CC Safety Net blocks the command because it cannot reach a verdict. The failureStage and errorCode fields mark them, and logs --suspect uses those fields.

Record schema

Example record:
CC Safety Net cuts long segment, toolName, and cwd values and sets truncated: true on the record. It cuts a long command the same way, except on a record with a failureStage, which keeps the whole command. It never writes the flag as false.

failureStage values

failureStage names the check that failed closed. The checks run in the order on How it works. A denial from input limits, a declared command tool’s check, policy-file protection, or Git-metadata protection happens before the policy loads. Its record carries no level and no configFallback.

What is recorded: audit scope

CC_SAFETY_NET_AUDIT_SCOPE decides whether allowed command decisions join the denials in the log. The scope never suppresses denials. It only decides whether CC Safety Net records allowed decisions.

Retention

See Audit retention for how CC Safety Net handles invalid values. The same value is the maximum for logs --since and limits the windows the Dashboard Activity view offers. CC Safety Net deletes expired records the next time it runs: after it writes a record, or before logs, doctor, or the Dashboard reads the log. Nothing runs on a timer, so expired records can stay on disk while CC Safety Net is idle, and logs --id can still find them.
Shortening retention is irreversible. Lowering the value makes older records eligible for deletion on the next run, and CC Safety Net deletes them with no archive, trash, or undo. The Dashboard asks you to confirm before lowering the value.

Secret redaction

CC Safety Net redacts the command, segment, tool name, and working directory before it writes the record. It replaces these recognized values with <redacted>:
  • Environment assignments whose name contains TOKEN, SECRET, PASSWORD, PASS, KEY, or CREDENTIALS
  • Database connection variables (DATABASE_URL, POSTGRES_URL, MYSQL_URL, REDIS_URL, MONGODB_URL, and other DSN/URL/URI/connection-string variables)
  • PEM private key blocks (-----BEGIN ... PRIVATE KEY-----)
  • Secret-bearing HTTP headers (Authorization, Cookie, X-API-KEY, API-KEY)
  • URL credentials (scheme://user:pass@host and scheme://token@host) and -u user:pass
  • Presigned-URL signature query parameters: the values of x-amz-signature, x-goog-signature, sig, and signature
  • A fixed list of provider token formats (ghp_..., gho_..., xoxb-..., npm_..., sk_live_..., rk_live_..., pypi-..., and similar)
  • JWTs (eyJ...) and AWS access key IDs (AKIA... / ASIA...)
Redaction is bounded. It is a fixed list of patterns, not a classifier. It keeps everything else verbatim: absolute filesystem paths, project and directory names, hostnames, IP addresses, usernames, ticket ids, filenames, and any credential whose shape is not on the list. CC Safety Net does not redact the reason field. Treat the audit log as sensitive local data, and review any excerpt before pasting it into an issue or a chat.
File permissions limit who can read the log. They do not redact it or make it safe to share.
Last modified on October 22, 2026