Skip to main content

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_hash placeholder rule, and the witness-event event_hash rule (SHA-256(canonicalize(event without event_hash))).
  • Receipt verification — independent v0.2 receipt verification: recompute receipt_hash over the S1 pre-image and verify the Ed25519 signature (RFC-002 §6 ed25519: 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_range match + per-receipt integrity cross-checked against each companion event.
  • Unified verificationverify_artifact discriminates on schema_version and routes to the right verifier (v0.1 receipt, v0.2 receipt, or evidence package).
  • Keyless inspectioninspect summarizes 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 CLIverify receipt|evidence|artifact and inspect (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

Not yet published to PyPI. Install from source:

# with uv
uv pip install git+https://github.com/WitSeal/witseal-py

# or from a clone
git clone https://github.com/WitSeal/witseal-py
cd witseal-py
uv sync

Requires Python 3.11+.

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

License

Apache 2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

witseal-0.1.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

witseal-0.1.0-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file witseal-0.1.0.tar.gz.

File metadata

  • Download URL: witseal-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for witseal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88ec63f21813a390ab92e6a89124da0954b2289416f0ee7f1fd928a658bff5a0
MD5 2230709a4b46dfca2b0adcc34f71b41e
BLAKE2b-256 07e28a2704db970fb8a7c1eb568d6eb267653edcb5217fad2ef94c530d5dab41

See more details on using hashes here.

Provenance

The following attestation bundles were made for witseal-0.1.0.tar.gz:

Publisher: release.yml on WitSeal/witseal-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file witseal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: witseal-0.1.0-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

Hashes for witseal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2ccd6d6f64b021b1e286ba644d3cf10ee656f3d08cb7281b141efc27443b5b9
MD5 920cbb9991f014cf7017447add7c9f60
BLAKE2b-256 2986dac5a2ae8c5d9eacd10d84574505e7911c634b780cb24eb89d107978e2a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for witseal-0.1.0-py3-none-any.whl:

Publisher: release.yml on WitSeal/witseal-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page