Skip to main content

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 v1.0 specification in Python.

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

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

context_passport-1.0.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

context_passport-1.0.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file context_passport-1.0.1.tar.gz.

File metadata

  • Download URL: context_passport-1.0.1.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for context_passport-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8b7f00e8ed960912b76482565a66bfed07145a523aa91bed3ce35871349424dd
MD5 b2455ab6d2b5edc0b2560ba4d0c3f8eb
BLAKE2b-256 278f7808230011bd1c32d2c7eedb2cf9eb3f622a4847e2a03d26efa222896ec6

See more details on using hashes here.

File details

Details for the file context_passport-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for context_passport-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e4a1b69f66c9ecfdc5e286cf08430f47e697f71c0ddeceaffa28ce30812195e
MD5 e0877df4c38e81c8ebf12efc6c64089b
BLAKE2b-256 1a260ce46b01e7c2fce71286d86126963e5ffbb15bc2593f8d07db8cd2094bc8

See more details on using hashes here.

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