Context Passport — Python Reference Implementation
A reference implementation of the Context Passport v2.0 specification in Python.
v2.0: Adopts RFC 8785 (JSON Canonicalization Scheme) for cross-implementation byte-equivalence. v1.x records remain verifiable via context_passport.compat.v1. See the migration guide.
Specification: https://github.com/contextpassport/spec License: Apache-2.0
Install
pip install context-passport
Optional extras:
pip install "context-passport[signing]" # Ed25519 signing support
pip install "context-passport[langgraph]" # LangChain/LangGraph callback handler
Usage
from context_passport import make_passport, verify_chain
# Root commit
root = make_passport(
agent_id="agent-researcher-01",
agent_name="Research Agent",
payload={"input": "Analyze Q1 earnings", "output": {"summary": "APAC up 34%"}},
role="researcher",
provider="anthropic",
model="claude-opus-4-6",
)
# Child commit
child = make_passport(
agent_id="agent-writer-01",
agent_name="Writer Agent",
payload={"input": root["payload"]["output"], "output": "Draft prepared."},
parent=root,
)
# Verify the chain
assert verify_chain([root, child])
Conformance
This implementation targets Core conformance with the Context Passport v1.0 conformance test suite. Signed conformance is planned.
To run the conformance tests against this implementation:
git clone https://github.com/contextpassport/conformance-tests.git
cd conformance-tests
python runner/python/run.py --implementation context_passport
Contributing
See CONTRIBUTING.md in the spec repository. Bug reports and pull requests welcome on this repo.
Related repositories
- contextpassport/spec — the specification
- contextpassport/typescript — TypeScript reference implementation
- contextpassport/conformance-tests — conformance test suite
Metadata
Release files for context-passport 2.0.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 |
|---|---|---|---|---|
| context_passport-2.0.0.tar.gz | 17.2 kB | Without provenance | Details for context_passport-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| context_passport-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for context_passport-2.0.0-py3-none-any.whl |
Total release size: 33.0 kB
Release files / context_passport-2.0.0.tar.gz
| Download URL | context_passport-2.0.0.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e402018571d6f5d042001897f720e587067eedebb8b2017c7c2bc8dc9a883203
|
|
BLAKE2b-256 checksum How to use checksums |
5a1e7200ed2c76052c7f9443bbdef65c22ac12a270a4f97516652b16bdc2e550
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / context_passport-2.0.0-py3-none-any.whl
| Download URL | context_passport-2.0.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f8b745cf8385a32c6e18a95f7a4ae99eb2ea6301d76e16c4b2edc2025967d7c
|
|
BLAKE2b-256 checksum How to use checksums |
bcd2babbe3e24ab3c8258df180cbdbc34c08fabf7c92fcc02e978854875634c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for context-passport 2.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.