Reference Python implementation of the Context Passport open standard for AI agent events.
Project description
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
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 context_passport-2.0.0.tar.gz.
File metadata
- Download URL: context_passport-2.0.0.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e402018571d6f5d042001897f720e587067eedebb8b2017c7c2bc8dc9a883203
|
|
| MD5 |
511d0e099b1b777fbb98f0aee3e0ae0d
|
|
| BLAKE2b-256 |
5a1e7200ed2c76052c7f9443bbdef65c22ac12a270a4f97516652b16bdc2e550
|
File details
Details for the file context_passport-2.0.0-py3-none-any.whl.
File metadata
- Download URL: context_passport-2.0.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f8b745cf8385a32c6e18a95f7a4ae99eb2ea6301d76e16c4b2edc2025967d7c
|
|
| MD5 |
4ba66a7c5ceb3dde34e0a0351866f68b
|
|
| BLAKE2b-256 |
bcd2babbe3e24ab3c8258df180cbdbc34c08fabf7c92fcc02e978854875634c1
|