Skip to content

Evidence bundles and verification

Every credencestack run writes an evidence bundle: one output directory that holds everything needed to review the run. Anyone holding the bundle can detect tampering and, with the producer's public key, confirm who produced it.

credencestack-out/run-<YYYYMMDD>-<id>/
  manifest.json                     credencestack.evidence/v1: settings, environment,
                                    inputs (packs, profiles, seed, connector, agent,
                                    models), SHA-256 of every file, Merkle root
  results.json                      run metadata, scenario catalogue, per-epoch results
                                    and findings, statistics, oversight metrics, judge
  authority/<file>                  exact authority profile(s), mandate(s) and domain
                                    policies used
  traces/<scenario>/<epoch>.jsonl   every event of every episode, hash-chained
  inspect_logs/*.json               Inspect's logs (with each episode's full record)
  runtime/<source>.jsonl            imported runtime decisions (with --runtime-log)
  reconciliation.json               three-way reconciliation (with --runtime-log)
  mappings.json                     findings by pillar, then framework references
  report.html                       the six-pillar report (static, no external assets)
  confidential/                     confidential scenarios only: their traces, Inspect
                                    logs, profiles and reconciliation rows
  signature.json                    added by `--sign` (run, report)

Authority sources and policies keep their original file names (for example authority/demo_ap_agent.yaml, authority/fincrime_policy.yaml), because a run can use more than one profile or mandate.

Confidential scenarios in a bundle

Confidential scenarios (from your own packs marked visibility: confidential; see your own packs) are graded like any other, but their content is never in the shareable files. results.json, reconciliation.json and report.html show for them only the scenario id, pillars, finding types, severity and a generic description; finding messages, tool arguments, prompts, documents and injection payloads are left out. Their traces, their packs' Inspect logs, any profile only they use and their full reconciliation rows go to confidential/. The report never reads confidential/.

To share a bundle without that material:

credencestack evidence export credencestack-out/latest-run --redact
credencestack evidence verify credencestack-out/latest-export --public-key signing.pub

The export is an export-<id>/ directory: its own manifest.json (kind: export, naming the source) and a copy of the run under bundle/, without confidential/. The copied manifest still lists those files with their SHA-256 and "redacted": true, so the Merkle root is unchanged; verify checks every file that is present, lists the redacted ones, and checks the run's signature against its manifest as it was before redaction, so a bundle signed before export still verifies. Only files under confidential/ can be redacted, and changing any file that is present still fails verification. Without --redact, the export copies the whole bundle. To send an export as one file, archive the directory; the recipient unpacks it before running evidence verify, which reads directories only.

The manifest file

Every output directory (run, bench, export, and the later generate and env export) has one manifest.json in the same format, credencestack.evidence/v1. For a run it records:

  • kind, id (the directory's name), created_at and credencestack_version;
  • settings: the effective settings, without secrets;
  • environment: python_version, platform, key packages (Inspect, pydantic, LangChain…), and git_commit and git_dirty if run from a git checkout;
  • inputs: packs (name, version, digest, visibility, scenario ids), profiles (each with its SHA-256 and the scenarios that used it), seed and whether it was drawn, connector, agent, the models seen in model_call events, epochs and runtime_sources;
  • run: UTC started_at and finished_at, and seeds (the seed of every epoch, by scenario);
  • otel: the run's trace id and the otel/ids.json sidecar;
  • visibility: confidential if any scenario is;
  • outputs: every file except manifest.json and signature.json, with path, SHA-256 and size, sorted by path;
  • merkle_root over those files.

Outputs and manifests lists every field, and credencestack packs schema manifest prints the JSON Schema (schemas/manifest.schema.json).

Integrity mechanisms

Canonical JSON (credencestack._internal.canonical):

  • keys are sorted and there is no extra whitespace;
  • text is UTF-8;
  • whole-number floats are written as integers; other floats use Python's shortest round-trip form;
  • NaN and infinity are rejected.

Everything that is hashed or signed uses this one helper.

Hash-chained traces. Each line of traces/<scenario>/<epoch>.jsonl is one trace event (kind, ts in simulated time, tool, args, result, meta) plus seq, prev_hash and hash, where:

hash = SHA-256( canonical_json(record without "hash") || prev_hash )

The first record's prev_hash is 64 zeros. Lines must also be in canonical form. Editing, reordering, inserting or deleting a record breaks the chain at that record. Deleting records from the end keeps the chain intact, but the file hash then no longer matches.

Merkle root.

  • Each leaf is SHA-256(0x00 || path || 0x00 || file_sha256) for one listed file, in path order.
  • Each interior node is SHA-256(0x01 || left || right).
  • An odd node at any level is promoted unchanged.

Signature.

  • --sign signs the canonical statement {manifest_sha256, merkle_root, id, signed_at} with Ed25519.
  • The signature covers the DSSE pre-authentication encoding of that statement, with payload type application/vnd.credencestack.evidence-statement+json.
  • signature.json holds the algorithm, public key, key id (SHA-256 of the raw public key), Merkle root, signed_at, the signature, and the DSSE-style envelope. It is written in canonical form, so any edit to it is detected.

Sign and verify

# once: create a keypair OUTSIDE any repository (refused inside a git working tree);
# writes signing.key (private, mode 0600) and signing.pub, and prints both paths
uv run credencestack evidence keygen ~/.credencestack/keys

CREDENCESTACK_EVIDENCE_SIGNING_KEY=~/.credencestack/keys/signing.key uv run credencestack report evidence/safe/latest-run --sign
uv run credencestack evidence verify evidence/safe/latest-run \
    --public-key ~/.credencestack/keys/signing.pub

verify checks, in order:

  1. the manifest parses;
  2. every listed path is a safe relative POSIX path, listed once, and the bundle holds no symbolic links;
  3. every listed file exists and matches its SHA-256 and size;
  4. no file is present that the manifest does not list;
  5. every trace chain is intact;
  6. the Merkle root matches the one recomputed from the manifest;
  7. signature.json is canonical, its statement matches this manifest and root, it was signed by the expected key (if --public-key is given), and the Ed25519 signature is valid.

It prints PASS, or FAIL with the first failure, for example:

FAIL: traces/PAY-001/0.jsonl: SHA-256 does not match the manifest; first broken trace record at seq 4, line 5: seq 4: record hash mismatch (content changed)

Pin the key. Without --public-key, verify uses the key embedded in signature.json. That proves the bundle has not changed since someone signed it. Anyone could edit a bundle and re-sign it with their own key. Always pass the producer's public key, obtained through a channel you trust, to confirm who signed it.

--sign first re-renders report.html so its title block names the signing key, then refreshes the manifest and signs. The key is the evidence.signing_key setting (CREDENCESTACK_EVIDENCE_SIGNING_KEY).

credencestack report <bundle> [--open] regenerates report.html from results.json and refreshes the manifest. On a signed bundle it refuses unless you pass --force, which also removes the now-invalid signature; then sign again.

The report

report.html is one self-contained page (inline CSS, no scripts, no external assets) that opens offline and prints cleanly, built by the shared report engine (credencestack.reports). Its parts, in order: a title block (system under test, profiles, run id, date, packs, epochs, signature); summary metrics; an executive summary (overall pass rate with its interval, the top five findings by severity, a plain-English verdict, results by domain); one section per pillar (purpose, risk, control, oversight, resilience, assurance) with what was tested, the pass rate, the findings and links to the traces, plus the oversight metrics, kill-switch and fault results, and reproducibility and integrity status; a financial crime and onboarding controls section when domain packs ran; the authority compliance matrix; an expandable trace for every failing episode with the step-level reasons and the grader's rule ids; the runtime reconciliation (when a runtime log was given); the secondary framework tables (SR 26-2, FINOS AIGF, AIUC-1, OWASP, and for the domain packs FATF, OFAC and US CDD themes) with versions and an indicative badge; and the method, limitations and disclaimer. mappings.json holds the same mapping as data.

Keys

  • keys generate --out <dir> writes <dir>/signing.key (PKCS#8 PEM, mode 0600) and <dir>/signing.pub, creating <dir> with mode 0700, and prints where both went. It refuses to overwrite an existing key without --force.
  • It refuses any directory inside a git working tree (a .git directory or file in the directory or any parent). There is no override.
  • *.key, *.pub, *.pem and keys/ are git-ignored as a second line of defence.
  • Keep the private key in your secrets manager or HSM, and publish the public key where reviewers can find it.