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

While the spec is in draft (v1.0 prerelease), pip will install the latest prerelease automatically. To pin to a specific version:

pip install "context-passport==1.0.0"

For 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.0.tar.gz (15.2 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.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: context_passport-1.0.0.tar.gz
  • Upload date:
  • Size: 15.2 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.0.tar.gz
Algorithm Hash digest
SHA256 10bef44ba00d30440ba27d976da1683be7d11142287b20fd7df6c3bb6d90fa9d
MD5 ba807220b07cc176ec41b19b56582fcc
BLAKE2b-256 f9393adaa1aca0eb57695b5fb0daa30db92890343e509e63829e48e4c892e4c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for context_passport-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13981239c3d866613815eaa6c28ffa336c3fe9f1bb22756d2a943113cdcda72a
MD5 9f704c981483ddf463ae3dee02f22ebe
BLAKE2b-256 5c80f0f9323e6e572da20606a8c2f8854b37c5313ab86d27dc41c0589c03bc51

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