Evidence bundles
Turn a scan into one file that proves it has not been edited since it was written: the result, the SARIF and the AI-BOM with a SHA-256 for each, and a content digest for every finding that is anchored in the code. Then check it, anywhere.
For what to hand an auditor around the bundle, see evidence for auditors. This page is the mechanism.
Before you start
Section titled “Before you start”- A repository, or a result you saved earlier with
--json. - To reproduce the successful verification below, use a scan with at least one finding anchored to a non-blank source line.
- Nothing else. Building and verifying a bundle never touches the network.
1. Make the bundle
Section titled “1. Make the bundle”In Keryn Web, open the result and choose Export, Evidence bundle. The file is generated in the tab by the same Rust core as the CLI, and nothing is uploaded.
keryn bundle . --out ../runwrote evidence bundle -> ../run.bundle.jsonThis scans like keryn scan (the same inputs and flags) and writes run.bundle.json. It exits 0 once the file is written; gating stays the job of keryn scan. Write the bundle outside the scanned tree so a later scan does not include earlier exports.
To bundle a result you already have, with no scan at all:
keryn scan . --json ../result.json --quiet || truekeryn bundle --from ../result.json --out ../from-result(The scan exits 1 because this repository has findings; the saved result is complete either way.)
In Keryn for VS Code, run Export evidence bundle from the command palette. See editors.
2. Verify it
Section titled “2. Verify it”keryn verify-bundle ../run.bundle.jsonOK: 7 verified anchor(s), 4 unanchored, 0 digest mismatch(es)A bundle with zero digest-backed code anchors exits 1, even when all document digests match. This can happen when the scan has no findings.
verify-bundle recomputes every digest and exits 0 only when all of them match and the bundle is publishable in the sense its own publicSafety field states. A bundle whose item or finding cites a line by the SHA-256 of an empty line (e3b0c442...) fails with a blank-anchor mismatch: that digest would verify against any file. Keryn anchors a match at the first non-blank line it cites and gives an all-blank range no evidence, so a bundle it wrote does not carry one. A bundle that quotes your code is marked for internal use, so read that field before you pass the file on.
3. Check that the same input gives the same bytes
Section titled “3. Check that the same input gives the same bytes”The creation time is fixed unless you pass --timestamp now, so two bundles of the same tree are identical, byte for byte:
keryn bundle . --out ../a --no-cachekeryn bundle . --out ../b --no-cachecmp ../a.bundle.json ../b.bundle.json && echo identicalwrote evidence bundle -> ../a.bundle.jsonwrote evidence bundle -> ../b.bundle.jsonidenticalThat is what makes a bundle comparable: archive one per release and any later bundle of the same code matches it. For a real attestation, pass --timestamp now (or a fixed ISO time) so the file says when it was made.
What you just proved
Section titled “What you just proved”You sealed a claim about a repository so that the claim and the evidence cannot be separated, and showed that changing either one is detected. The check is local and needs only Keryn. It does not prove the right code was scanned: record the commit (--revision) and scan a clean checkout. What a bundle does not prove is spelled out in evidence for auditors.
- Hand it over with the rest of the evidence: evidence for auditors.
- Make one per release: CI.
- Verify somewhere with no network: air-gapped use.