Skip to main content
The 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 by explain --json.

ExplainTrace

TraceStep variants

Each step in a trace is a TraceStep 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 from parse → 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.
Last modified on June 22, 2026