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
failureStageanderrorCodefields mark them, andlogs --suspectuses those fields.
Record schema
Example record:
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.
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, orCREDENTIALS - 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@hostandscheme://token@host) and-u user:pass - Presigned-URL signature query parameters: the values of
x-amz-signature,x-goog-signature,sig, andsignature - 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...)