Sanning Proof
Offline verification for the Sanning evidence plane. If someone handed you an evidence pack and asked you to check it, this package is the whole answer: no account, no API key, no network call, and no relationship with Sanning. Sanning is never in the trust path.
Two kernels, one contract. This page covers the Python one.
- Python:
sanning-proofon PyPI. A library, with no command of its own. - TypeScript:
@sanning/proofon npm, browser and Node ≥ 20. Ships theproofcommand.
If instead you are producing evidence, the write SDK is
sanning-anchor and the hosted
plane is console.sanning.io. For what the
evidence plane is and how anchoring, reading and verifying fit together, see
the Sanning documentation.
Install
pip install sanning-proof
Check a pack you were handed
A pack is one zip holding bundle.json beside a logs/ directory. Unzip it
and check it from your terminal:
sanning-proof verify pack/bundle.json --logs pack/logs
--logs reads a regular file named <event_id>.json as that record's
disclosed bytes, and nothing else in the folder: a link is never followed, a
subdirectory is never entered, and a file of any other name (<event_id>.txt
included) is not a disclosure. Each of those is named on stderr, so no file is
left out without a line saying so. Both kernels read a folder by this one rule
(evidence-bundle §5.1.4).
A report opens with a verdict, one of three, read off six claims about the pack: signed (the key it names signed it), unchanged (the bytes agree with what was signed), witnessed (a stamp covers each record), complete (the pack holds what its own declaration and stamp say it holds), agreed (the two sides of each hand-off agree) and follows the rules (each record follows the vocabulary it names). Each claim is proven, disproven, or not proven; a claim with nothing in scope is not printed.
- Verified: every claim in scope is proven.
- Failed: a claim is disproven.
--jsoncarries a reason kind:changedwhere any other claim is disproven (a record altered, a signature that does not hold, a hand-off whose sides disagree), andnonconformingwhere the only disproven claim is that a record does not follow its vocabulary (a producer's error, nothing proven altered). - Incomplete: nothing is disproven, and a claim is not proven. This is not a pass with a caveat: do not rely on the parts that are not proven.
The report prints the person layer first (the title, one line per claim that is disproven or not proven, the next action, the notes, the sandbox line and the witness line), then the detail. This is a real report, for a stamp no witness has published (exit 2):
Incomplete: not everything could be checked.
Witnessed: not proven for 1 pack. No stamp covers it.
Next: Wait for the stamp, then run it again.
Note: this pack does not say what it holds, so whether it is complete is unknown.
Witness: Not checked: no lookup was run
--json carries the same words as person, with the verdict, the claims
and every reason behind them, so a script can render the report from --json
alone.
Exit codes are the contract, so a script can read them, and every verb shares
one table: 0 verified, or the export was written, 1 failed (either
reason kind), 2 incomplete, 3 sandbox (the verdict is verified and a
record is signed environment: "dev"), 4 could not run (a bad flag, a
missing file, or an input that is not a pack or a case at all). 2 is
deliberately not 1: incomplete means a claim could not be proven, and
reporting that as failed would say the evidence is bad when it is not.
A pack whose records are signed environment: "dev" is sandbox evidence, not
production evidence. Sandbox is a label, never a verdict: the verdict keeps its
own word, the report prints the line Sandbox: these records are sandbox records, not production evidence., and a run whose verdict is verified exits
3 where it would exit 0. A pack that fails still exits 1 and one that is
incomplete still exits 2. --json carries environment_marker, dev where
every record is signed dev and mixed where only some are; for a production
pack it is absent and no sandbox line prints. No flag turns 3 into 0.
Several things leave a run incomplete. A stamp no witness has published leaves
witnessed not proven. A record nobody hashed leaves unchanged not proven
and the PACK incomplete: the headline is the verdict on the pack, the signed
bundle plus whatever disclosed bytes travelled beside it, which is the same
verdict the verify page prints. A pack can be incomplete while the bundle it
carries is impeccable, so both verdicts are printed whenever they differ, along
with every reason the pack is not verified. An unreachable gateway does not
leave a run incomplete: a lookup that does not settle moves nothing, and the
witness line says so.
Add --gateways <url,url> to look up the on-chain half as well; omit
them for a fully offline verification, which needs no account, no API key and
no network. Only arweave witnesses are re-fetched. A witness of any other
kind is not looked up, and the witness line says so; the verdict and the exit
code do not move. Only a lookup that finds other bytes or another time
disproves witnessed, and that exits 1. A sandbox plane's simulated witness
is never fetched, and a run whose only witnesses are simulated says nothing was
looked up and writes "on_chain_checked": false.
The same command exists in the TypeScript kernel as
npx @sanning/proof verify. A cross-kernel leg runs both over the same
bundles and compares their exit codes, including the --logs lanes, so a
verdict cannot drift between them unnoticed. Their printed output is not
identical: the TypeScript command reports more per-event detail.
Or from Python, if you would rather have the result as an object than as an exit code:
import json
import pathlib
from sanning_proof import verify_evidence_bundle
pack = pathlib.Path("pack")
bundle = json.loads((pack / "bundle.json").read_text())
content = {p.stem: p.read_bytes() for p in (pack / "logs").glob("*.json")}
result = verify_evidence_bundle(bundle, content=content)
print(result.status) # "verified"
print(sum(1 for e in result.events if e.ok), "verified")
content= binds each disclosed raw log to the commitment inside its own signed
record. Omit it and every event's content check is not proven rather than
failed: absence of a disclosure is not evidence of tampering.
Nothing leaves your machine. The kernel does no I/O of its own.
Check the files that came with a pack
A pack proves what its records signed. To ask whether it vouches for the files
you were handed beside it, such as a screenshot, a report or an export, name
them after --files. Each file is hashed with SHA-256 and looked up among what
the pack's signed records commit to. A folder stands for every regular file
inside it, so one argument covers a whole download on any operating system,
the Windows command prompt and PowerShell included (they do not expand a
wildcard such as evidence/*, and this command does not either):
sanning-proof verify pack/bundle.json --logs pack/logs --files evidence/
The report lists the files the pack vouches for, the files that match no record and the commitments no file was offered for. A match is by hash alone: file and folder names are never compared, and the verdict and the exit code never move.
- A folder is read recursively, and hidden files count. Its files are listed as
<folder>/<path inside>in UTF-16 code unit order of that path, so both kernels print one list in one order. Files and folders can be mixed in one command. - A symbolic link inside a folder is never followed. It is listed as skipped, with the reason, as is anything that is not a regular file (a pipe, a socket) and a file or folder the command cannot read. Nothing is dropped without being named, and a skipped file is not a verdict about it.
- Two files with one hash are both listed, each under its own name. An empty
file is an ordinary file with the empty digest. A file is read in
pieces and hashed, so it is never held in memory. A file you name yourself is
read at any size; the files found inside folders share 1 GiB per run, the cap
the
.zipreader uses, and one that would push past it is listed as skipped (too_large) and not read, so a sparse file of a terabyte cannot hold the command.casebounds its other reads of files on disk as well; the README section oncaselists them. - A folder nested more than 32 levels deep, one holding more than 50,000 files
and folders, or one with a name that is not valid UTF-8, exits 4, as
casedoes. A path that is not a readable file or folder exits 4.
Read several packs together: a case reading
When a case spans more than one pack (two agents, two organizations, one hand-off between them), check the packs together:
sanning-proof case audit-file.zip # a whole download, one command
sanning-proof case assessor-pack/ challenger-pack/
sanning-proof case case/ --json # the full reading, for a script
Each argument is a folder, or a case file named as a .zip. A folder is one
pack (bundle.json plus logs/), or a folder that holds several packs, such as
an unzipped folder of packs. A .zip is read as the folder
unzip <name>.zip -d <name> would make, so the archive and its unpacked folder
give one reading, with no unzip step and on any operating system. A .zip
inside a folder is a file like any other: it is hashed, never unzipped.
Packs are found by the verify page's splitting rule, so the page and this
command apply the same rule to the same unpacked tree: every bundle.json is a
pack, a file belongs to the deepest pack whose bundle.json or logs/ it sits
in, and every other file is listed as outside every pack and is never read as part
of a pack. Several folders are read as
one folder holding them, each under its own name. Each bundle.json is read
with verify's own reader, so the two commands classify one bundle the same
way.
The files outside every pack are checked too, with no flag. A download
usually holds more than packs: a screenshot, a report, an export. case hashes
each file that sits outside every pack, with SHA-256 over its exact bytes, and
looks the digest up among what every pack's signed records commit to, the same
check verify --files makes. The report lists each as vouched for, naming the
record and its pack, or as matching no record:
sanning-proof case audit-file.zip
This is information beside the case reading and never inside it: the verdict,
the exit code and the summary are the same whether a file matches or not, and a
changed file reads as no match, nothing more. A match is by hash alone, so no
name or folder is compared. Files after --files are offered as well. The first
line of the section counts the files; each file that cannot be hashed, such as a
link, a pipe, a zip entry the reader refused (with the reader's own words) or a
file that cannot be read, is listed as skipped with the reason, so every file
outside a pack is matched, unmatched or skipped. Two files with one hash are
both listed; an empty file is an ordinary file; a file is read in pieces. The
files share 1 GiB in all, the cap the .zip reader uses: one that would push
past it is listed as skipped (too_large) and not read, so a sparse file of a
terabyte in a download cannot hold case at that step. Every other read case makes of a file on disk is bounded too, so a sparse file of a terabyte can neither stall case nor exhaust its memory. The index comparison hashes every file under packs/ and report/ in pieces, within its own 1 GiB, the files the index lists first, and a listed file it has no room left for is reported as case_index_file_too_large, never as a match and never as absent. A pack's own files (bundle.json, logs/), contents.json and witness-cache.json are read whole within one 1 GiB total across the run: a pack's own file with no room left exits 4 at once, naming the file (the words say the run's total is used up, not that the file is itself over 1 GiB), a contents.json with no room left reads as an unreadable index (case_index_unreadable), and a witness-cache.json with no room left reads as no cache, with a note line saying so. A .zip larger than 1.25 GiB on disk exits 4 before it is read. A file outside every pack, contents.json and witness-cache.json included, therefore never keeps case from its verdict, and one a pack owns, or an archive that large, is refused promptly instead. Without
--files the report lists each file read and then one line, N recorded commitment(s) matched no loose file and no log in their own pack, without a
line for each record; --files and --json list every commitment no file
matched, those the count leaves out included. The section is printed
when a file sits outside every pack or --files is given, so a case with
neither prints no files section. The files member of --json follows
the same rule.
The walk is bounded and follows no link:
- A symbolic link is never followed. It is listed as outside every pack and not
read, even under a pack's
logs/, and a link named on the command line exits 4. - A folder nested more than 32 levels deep, more than 50,000 files and folders in all, or a name that is not valid UTF-8 exits 4. A bad name is refused rather than escaped, because two different names would then read as one.
- A
bundle.jsonnested more than 512 levels deep exits 4, fromcaseand fromverifyalike.
Known differences from the verify page: the page opens a dropped .zip; the
page drops a leading byte-order mark from bundle.json, which verify's reader
refuses; the page reads whatever the browser hands it for a link, a bad name or
a very deep tree; and the page loses a record named __proto__, which this
command keeps.
The first lines are the person layer, which opens with the case verdict. Then come the kernel's one-line summary and every exception the reading names, in the kernel's own words, followed by the packs, the files outside them, and the on-chain half.
| Verdict | Exit |
|---|---|
verified |
0, or 3 where a record is signed environment: "dev" |
failed |
1, either reason kind |
incomplete |
2 |
| could not run | 4 (a bad flag, a missing file, or an input that cannot be read as a case, or an unexpected error in the command) |
A case reads its worst pack: failed, then incomplete, then verified. A proven
failure keeps the headline: if anything in the case failed a check, the case
reads failed and exits 1, and everything else the reading found is still
listed beside it (evidence-bundle §5.5.4). A failed case carries the reason
kind nonconforming where the only disproven claim is that a record does not
follow its vocabulary (signed and intact, nothing proven altered), and changed
otherwise. A real report, for a hand-off whose two sides signed different
messages (exit 1):
Failed: do not rely on this evidence.
Agreed: disproven for 2 records. The two sides of a hand-off signed different messages.
Unchanged: not proven for 2 records. No event bytes are in the pack.
Next: Do not rely on this hand-off. Ask both sides which message was sent.
Sandbox: these records are sandbox records, not production evidence.
Witness: Not checked: no lookup was run
What a case reading establishes. Every pack is verified offline. Every record every pack supplied is read in one pile under the hand-off rules of envelope-spec §4.1, never partitioned by pack, issuer or organization. A hand-off record with no counterpart among the case's records is always named, and when a pack signed by the key it names is in the case, the reading says that pack holds no counterpart, unless every candidate it had was accounted for by another record, which reads as no counterpart and names no pack.
What it does not establish. That the case is complete, since a party can
decline to hand over a pack. That a party which presented no pack under the
named key recorded nothing. That two organizations are independent of each
other. That any witness was re-fetched on chain: the reading makes no network
call, and the witness line reads Not checked unless you pass
--gateways <url,url>. With gateways, each pack's witnesses are re-fetched
pack by pack and reported beside the reading, which they never change. A
witness that does not match exits 1, and a lookup that could not be settled
moves nothing.
An unexpected error inside the command exits 4, never 1, so a defect in the command is never reported as failed evidence.
The same command exists as npx @sanning/proof case, and a cross-kernel leg
runs both over every case/ corpus vector and every tree in
ts/vectors/case-split.json, and requires identical output, identical --json
and identical exit codes.
Compose an attested export
An attested export (sanning.evidence.export/v2, specs/evidence-export.md)
carries operator attestations over a source bundle, signed with your own
Ed25519 key:
sanning-proof export source.json --attestations attestations.json --key exporter.key --out export.json
sanning-proof verify export.json
export exits 0 when it wrote the export, 1 when the recomputed export is
failed (it still writes it, so you can inspect it), and 4 on a bad flag or an
input that is not a bundle at all. The TypeScript kernel ships the same command, and
cross-kernel/run_export_cli.sh requires the two to write the same bytes.
What a verdict claims
A verdict is recomputed from the artifact, never read off it. A bundle carries
no verdict: a wrapper verdict member, where an older producer wrote one, is
never read.
A verified verdict is offline, and it does not mean the chain was
consulted. A bundle names the witness that holds its bytes; asking that
witness whether it does is a separate, online act.
What a verifier can prove, and what it must not claim, is specified in
specs/evidence-bundle.md §5.3.4, under
"The standard". It draws four boundaries, covering
completeness, the chain, identity and per-agent slices. Read it before you
write down what a pack proved. A verifier that overclaims is worth less than no
verifier. The plain reading is at
what a verdict means.
The rest of the family
To check one signed envelope on its own, rather than a whole bundle:
from sanning_proof import verify_envelope
result = verify_envelope(envelope)
result.ok # spec_version accepted + payload binding + Ed25519 signature
Three arguments cover the rest:
verify_envelope(envelope, expected_content_hash=...)binds an artifact you already hold to the provenance an envelope commits to, and reports which role it matched.verify_envelope(envelope, payload_bytes=...)checks an external-commitment envelope against the committed bytes.
The TypeScript kernel has parity, including the RFC 9162 Merkle primitives.
Read an agent event record
To read an agent.* event record under the sanning.agent/1 vocabulary
(agent-events.md §10), after the envelope layer has verified it:
from sanning_proof import read_agent_event, read_agent_record
read_agent_record(record) # steps 1 to 6: the record on its own
read_agent_event(subject, held=held) # steps 1 to 7: with the records held beside it
Each returns an AgentReading: one of the three verdicts (verified, failed
or incomplete, or None for a record outside the vocabulary), and, when it is
not verified, every reason with its JSON Pointer (reasons, in step order;
reason and at are the first), then the findings. Steps 1 to 6 stop at the
first problem; step 7 runs every sub-step, and a closing record names each
record it lists and the verifier does not hold. A version the kernel does not
know, and a listed record not held, read incomplete, never verified; every
other reason reads failed. The JSON Schemas ship inside the package, so the
check runs offline with no file outside it.
verify and case call this reading on every sanning.events/v2 record a pack
holds. A type outside the closed set reads failed, whether or not the record
names a vocabulary; a record of one of the seven types outside it (event,
checkpoint, declaration and the four runner.* types) with no
event_schema gets no reading, unless its context.salt is not 32 lowercase
hex characters, which reads failed:
verifyreads the pack's agent records as one pile and prints each reading under its event;--jsonlists them asagent_records.casereads the agent records of every pack as one pile, so an end pairs with a start in another pack, and lists each reading asrecords[].agent.- Each reason of an agent record that reads
faileddisprovesfollows_rules: the pack isfailedwith the reason kindnonconforming, exit 1, nothing was proven altered, and a pack that also disproves another claim has the reason kindchanged. A reason that readsincomplete(a version this kernel does not know, or a listed record not held) holds the pack atincomplete, exit 2, and the person line counts the records not held. - A finding (
unended,start_absent,plumbing,handoff_parts_mismatch,ran_after_refusal,seq_gap,closing_not_heldand the rest) is printed beside the record as a note and never moves the verdict or the exit code. - A hand-off record that reads
failedmakes the record it pairs with readcounterpart_nonconforming.
read_agent_records(items) is the pile reading both commands use.
Sign an envelope
Most producers never call this kernel to sign: the anchor SDKs sign through it, and reaching for
sanning-anchor is the shorter
path. For a custom producer:
from sanning_proof import jcs, sha256_hex, sign_envelope, signing_key_from_seed_hex
key = signing_key_from_seed_hex(SEED_HEX)
envelope = sign_envelope({
"spec_version": "sanning.events/v2",
"event_id": EVENT_ID,
"signed_at": "2026-01-01T00:00:00Z",
"environment": "production",
"payload_hash": sha256_hex(jcs(record)),
}, key)
Replace SEED_HEX with a 32-byte hex Ed25519 seed, EVENT_ID with the
event's UUID and record with the event record the envelope commits to, which
stays with you. sign_envelope takes the envelope minus signature and returns
it with public_key and signature filled in, per the spec.
The standard
The specifications live in specs/, beside the kernel that
implements them, so the contract and the implementation claiming to satisfy it
can be read against each other:
| Specification | Covers |
|---|---|
envelope-spec.md |
The producer-neutral Verifiable Event Envelope family contract |
evidence-bundle.md |
The sanning.evidence/v1 report wrapper, its body types, and the verdict boundaries in §5.3.4 |
evidence-export.md |
The sanning.evidence.export/v2 wire format |
log-store.md |
The sanning.logstore/v1 store a pack's logs/ is materialized from |
architecture.md |
The kernel, producer, connector and transport factoring standard |
governance.md |
Who decides, and how |
Two envelope profiles are registered against the family contract:
sanning.mlflow/v1, an external-commitment profile, and
sanning.events/v2, the anchor SDK's minimal-disclosure profile. This Python kernel
accepts both. Additive minors are accepted within a major, while unknown majors and
malformed versions fail closed.
Conformance discipline: both kernels reproduce one pinned corpus (tag
test-vectors-v5.0, manifest test-vectors/CORPUS-v5.md) byte for
byte, across JCS-canonical bytes, payload hashes, envelope-for-signature bytes,
deterministic signatures, Merkle roots and audit paths. Neither passes by
agreeing with the other. If this package disagrees with a vector, the package
is wrong and the vector is not.
Kernel scope
Deliberately small: canonicalization (RFC 8785), SHA-256 hashing, Ed25519 sign
and verify, RFC 9162 binary Merkle inclusion proofs, the profile registry, and
the sanning.agent/1 schema check. No I/O, no networking, no key lifecycle.
The library reads no file but the JSON Schemas it ships as package data. Gateway
fetching, attestation polling and key storage belong to the products that import it.
Three dependencies, and adding to them is a design decision rather than a
convenience: PyNaCl and
jcs for the kernel primitives, and
cryptography for RSA-PSS
attestation verification.
A malformed envelope returns a failed result rather than raising. A verifier that crashes on a hostile artifact has handed that artifact a way to avoid being checked, so both kernels treat adversarial input as something to report on, not something to fall over on.
Security
Report vulnerabilities to security@sanning.io. We support responsible disclosure and ask for a reasonable opportunity to investigate before public disclosure.
License
MIT. The verifier is deliberately open-licensed so anyone can audit it and verify evidence independently of Sanning.
Metadata
Release files for sanning-proof 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sanning_proof-0.20.0.tar.gz | 240.6 kB | With provenance | Details for sanning_proof-0.20.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sanning_proof-0.20.0-py3-none-any.whl | Python 3 | none | any | Details for sanning_proof-0.20.0-py3-none-any.whl |
Total release size: 522.5 kB
Release files / sanning_proof-0.20.0.tar.gz
| Download URL | sanning_proof-0.20.0.tar.gz |
|---|---|
| Size | 240.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee9258f9e1718fb414cedc0bf33dff7d2b93bb62f0aa259b8c6ccadb2a4fd4aa
|
|
BLAKE2b-256 checksum How to use checksums |
bd8a4d6b716920a2ae5d7e80f73efc4ab86b4544d802b6802a7b5630b01cc7b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / sanning_proof-0.20.0-py3-none-any.whl
| Download URL | sanning_proof-0.20.0-py3-none-any.whl |
|---|---|
| Size | 281.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91e27277adbb9f143e109e1ebedbb8ee2b664be66462fb7ed8f02deaf7191861
|
|
BLAKE2b-256 checksum How to use checksums |
663537d4c0a60b5d2f367591175f8e141ced6a0325f99828651507d3c865bb72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for sanning-proof 0.20.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sanning_proof-0.20.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.