# keryn explain

Describes Keryn 0.5.2 and keryn-rules 0.8.0.

> a rule's message, severity, confidence, edge, CWE/OWASP/NIST, remediation, references (offline)

Source: https://keryn.dev/docs/reference/cli/explain/

> **Caution: Next release: keryn explain id --from file explain a saved finding by fingerprint or rule ID (offline)**
> `keryn explain <id> --from <file> explain a saved finding by fingerprint or rule ID (offline)` is on main; not in Keryn 0.5.2, the latest release.

A rule's message, severity, confidence, edge, CWE/OWASP/NIST, remediation, references (offline).

```text
keryn explain <rule-id>
keryn explain <id> --from <file> explain a saved finding by fingerprint or rule ID (offline)
```

## Options

```text
Usage: keryn explain <rule-id> [--json] [--rules <file|bundled:pack>]
       keryn explain <fingerprint-or-rule-id> --from <result.json> [--json]
       keryn explain --help
  --from explains saved finding locations, proof, excerpts, flows, remediation and coverage without running analysis.
  A recorded scan subdirectory is shown when present. Finding paths stay repository-relative for these scans.
  --from requires a regular result file no larger than 32 MiB.
  A matching fingerprint takes precedence over a rule ID. Rule IDs select primary and contributing matches, including suppressed findings.
  Saved evidence is not independently verified, and a rescan of current code is not implied. --rules and --from cannot be combined.
  Prints what a rule's author wrote for the reader: message, severity, confidence, false-positive risk, the edge it sits on
  (reaches, calls, reads, writes, sends, grants, depends_on, trusts, or none) and its trust boundary, CWE / OWASP / NIST AI RMF /
  MITRE ATLAS ids, remediation and references. Detection patterns, sources and sinks are never shown.
  --rules accepts a comma-separated list of local files or bundled packs and defaults to bundled:all.
  The first source containing the rule ID wins.
  Supply --rules once. Each source must be readable and valid even when an earlier source matches.
  --json writes a rule card or a keryn.dev/finding-explanation/v1 document, depending on the input.
  Runs offline. Exit 0 on success or help. Exit 2 for an unknown selector, invalid input or bad usage.
```

## Examples

```sh
# What the rule says, its edge, CWE and remediation.
keryn explain keryn.agentclient.codex-sandbox-full-access

# Every saved occurrence with proof and flow.
keryn explain keryn.agentclient.codex-sandbox-full-access --from result.json --json
```

## Exit codes

| Code | Meaning |
|---|---|
| 0 | explained or help shown |
| 2 | unknown selector, invalid input or bad usage |
