explain --json command returns a structured trace of every analysis step CC Safety Net performs on a command. This page documents that JSON shape, for anyone scripting against the trace or building tooling on top of it. For the command itself, see CLI Commands.
ExplainResult
The top-level object returned byexplain --json.
ExplainTrace
TraceStep variants
Each step in a trace is aTraceStep discriminated by its type field. The table below lists every variant and what it captures. Parse the type first, then read the variant’s key fields.
Reading a trace
A typical trace flows fromparse → per-segment env-strip / leading-tokens-stripped → detection (shell-wrapper / interpreter / busybox) → rule-check (or custom-rules-check) → a decision. Recursion appears as recurse steps with increasing depth. When you only need the verdict, read result (and reason / segment) at the top level instead of walking the trace.
Secret values in trace output are redacted —
KEY=value appears as KEY=<redacted> — so traces are safe to share in bug reports. See the Audit Log reference for the redaction system.Related pages
- CLI Commands —
explainflags and examples. - Analysis Engine — the behavior each trace step corresponds to.
- Troubleshooting — using
explainto diagnose unexpected blocks.