Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    Evidence bundles

    View as Markdown

    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.

    • 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.

    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.

    Terminal window
    keryn verify-bundle ../run.bundle.json
    OK: 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:

    Terminal window
    keryn bundle . --out ../a --no-cache
    keryn bundle . --out ../b --no-cache
    cmp ../a.bundle.json ../b.bundle.json && echo identical
    wrote evidence bundle -> ../a.bundle.json
    wrote evidence bundle -> ../b.bundle.json
    identical

    That 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.

    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.