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_atandcredencestack_version;settings: the effective settings, without secrets;environment:python_version,platform, keypackages(Inspect, pydantic, LangChain…), andgit_commitandgit_dirtyif 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),seedand whether it was drawn,connector,agent, themodelsseen inmodel_callevents,epochsandruntime_sources;run: UTCstarted_atandfinished_at, andseeds(the seed of every epoch, by scenario);otel: the run's trace id and theotel/ids.jsonsidecar;visibility:confidentialif any scenario is;outputs: every file exceptmanifest.jsonandsignature.json, with path, SHA-256 and size, sorted by path;merkle_rootover 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.
--signsigns 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.jsonholds 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:
- the manifest parses;
- every listed path is a safe relative POSIX path, listed once, and the bundle holds no symbolic links;
- every listed file exists and matches its SHA-256 and size;
- no file is present that the manifest does not list;
- every trace chain is intact;
- the Merkle root matches the one recomputed from the manifest;
signature.jsonis canonical, its statement matches this manifest and root, it was signed by the expected key (if--public-keyis 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
.gitdirectory or file in the directory or any parent). There is no override. *.key,*.pub,*.pemandkeys/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.