WitSeal Python SDK: consume, verify, and inspect witnessed-execution evidence (receipts and evidence packages)
Project description
WitSeal Python
Native Python Ecosystem SDK for WitSeal: the read-side path that consumes, verifies, and inspects WitSeal artifacts (execution receipts and evidence packages). The Python line is the SDK layer — it does not generate artifacts and is not a runtime; canonical generation is the Rust trust core.
Status
Pre-release (0.1.0). Public API is not yet frozen. Not yet published to PyPI — install from source (see below).
What this package does today
- Wire-format schemas — Pydantic v2 models for witness events,
execution receipts (v0.1 + v0.2), evidence packages, intents, policy
packs, and approvals. Byte-identical canonical serialization (RFC 8785
/ JCS) with the TypeScript and Rust implementations — proven against the
three-track golden receipt (
8fc29592…, 1050 bytes). - Integrity primitives — RFC 8785 canonicalization, SHA-256 hashing,
receipt signing-bytes assembly per the v0.2 S1 64-zero
receipt_hashplaceholder rule, and the witness-eventevent_hashrule (SHA-256(canonicalize(event without event_hash))). - Receipt verification — independent v0.2 receipt verification:
recompute
receipt_hashover the S1 pre-image and verify the Ed25519 signature (RFC-002 §6ed25519:algorithm-prefixed form) under a caller-supplied public key. - Hash-chain & evidence-package verification — walk a witness-event
chain (linkage, self-hashes, sequence monotonicity) and verify a full
evidence package: chain +
chain_head_after_rangematch + per-receipt integrity cross-checked against each companion event. - Unified verification —
verify_artifactdiscriminates onschema_versionand routes to the right verifier (v0.1 receipt, v0.2 receipt, or evidence package). - Keyless inspection —
inspectsummarizes any artifact and reports the integrity checks that need no key (receipt-hash self-consistency, chain integrity), explicitly flagging signature checks as key-requiring. - Verifier / SDK CLI —
verify receipt|evidence|artifactandinspect(see below).
What this package does NOT do
The Python line is the SDK / verifier layer — consume, verify, integrate. It deliberately does not provide:
- Artifact generation — no receipt/event/evidence generation, no signing. Canonical generation is the Rust trust core.
- Runtime — no
witseal exec, no subprocess mediation, no policy engine / runtime policy evaluation, no witness event-log append or exclusive-lock acquisition, no approval-flow execution, no file mediation / rollback.
These are not Python deliverables. A full Python runtime is out of scope by design; native Python↔Rust bindings are planned for a later release.
Install
# from PyPI
pip install witseal
# isolated CLI (recommended for the `witseal-py` command)
pipx install witseal
# or with uv
uv pip install witseal
Requires Python 3.11+.
From source (development):
git clone https://github.com/WitSeal/witseal-py
cd witseal-py
uv sync
CLI
# Verify a v0.2 receipt with an explicit Ed25519 public key (PEM path or 32-byte hex)
python -m witseal verify receipt receipt.json --public-key ed25519-public.pem
python -m witseal verify receipt receipt.json --public-key fd62f46e…c91862
# Verify an evidence package (chain + per-receipt integrity); key needed only
# if the package contains a v0.2 receipt
python -m witseal verify evidence package.json [--public-key …]
# Verify any artifact, auto-discriminating on schema_version
python -m witseal verify artifact artifact.json [--public-key …]
# Keyless inspection — structure + no-key integrity checks
python -m witseal inspect artifact.json
The public key is always an explicit verifier input. The CLI never reads keys from the network, environment, config files, or bundled defaults.
Exit codes: 0 VALID, 1 INVALID (JSON diagnostics on stdout), 2
input/usage error (unreadable file, malformed artifact or key, missing
required --public-key).
Forward plan (not yet implemented)
- Native integration helpers for LangChain, LangGraph, OpenAI Agents SDK, CrewAI, AutoGen, and MCP servers (consume/verify side)
- Native Python↔Rust bindings to the Rust trust core (later release)
This package does not wrap the TypeScript or Rust binaries. It is a native Python implementation.
Contributing
Contributions are welcome. See CONTRIBUTING.md for the workflow, development setup, and the tests/lint/type-check commands, and STYLE.md for the vocabulary discipline. All changes keep the cross-track golden receipt byte-identical.
Security
See SECURITY.md for how to report a vulnerability and how releases are verified. Do not file public issues for security reports.
References
- TypeScript reference implementation: https://github.com/WitSeal/witseal
- Rust parallel implementation: https://github.com/WitSeal/witseal-rs
- Changelog: CHANGELOG.md
License
Apache 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file witseal-0.1.1.tar.gz.
File metadata
- Download URL: witseal-0.1.1.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b6dff07fd11676a19e0e7c10c95c339a305db98f90c024ad1bc810b58642c17
|
|
| MD5 |
9e81f0115a15b21ce059abbc8a2a6759
|
|
| BLAKE2b-256 |
0e6405b44347a466d9c4a69befe15bca1b9365738bad79b7e23427e56b8aaf16
|
Provenance
The following attestation bundles were made for witseal-0.1.1.tar.gz:
Publisher:
release.yml on WitSeal/witseal-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
witseal-0.1.1.tar.gz -
Subject digest:
8b6dff07fd11676a19e0e7c10c95c339a305db98f90c024ad1bc810b58642c17 - Sigstore transparency entry: 1754560608
- Sigstore integration time:
-
Permalink:
WitSeal/witseal-py@58e2d8ddd46f08f7e710ecaa3b06d823ecb63a85 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/WitSeal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@58e2d8ddd46f08f7e710ecaa3b06d823ecb63a85 -
Trigger Event:
push
-
Statement type:
File details
Details for the file witseal-0.1.1-py3-none-any.whl.
File metadata
- Download URL: witseal-0.1.1-py3-none-any.whl
- Upload date:
- Size: 44.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c755c53ed310e2f22aa6a5dbab8723b66f7d99a1e87f011e64d90c5dbf253e2
|
|
| MD5 |
a72b502e9d9d2ed088a3c3ade7319707
|
|
| BLAKE2b-256 |
dfcb78cebeda5d43998ab0b5674d8da12d3f705555485497ebd3e071c7184676
|
Provenance
The following attestation bundles were made for witseal-0.1.1-py3-none-any.whl:
Publisher:
release.yml on WitSeal/witseal-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
witseal-0.1.1-py3-none-any.whl -
Subject digest:
8c755c53ed310e2f22aa6a5dbab8723b66f7d99a1e87f011e64d90c5dbf253e2 - Sigstore transparency entry: 1754560634
- Sigstore integration time:
-
Permalink:
WitSeal/witseal-py@58e2d8ddd46f08f7e710ecaa3b06d823ecb63a85 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/WitSeal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@58e2d8ddd46f08f7e710ecaa3b06d823ecb63a85 -
Trigger Event:
push
-
Statement type: