Skip to main content

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

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)

Source distribution for context-passport 2.0.0
File Size Uploaded
context_passport-2.0.0.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for context-passport 2.0.0
File Interpreter ABI Platform
context_passport-2.0.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page