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

(Not yet on PyPI — install from source while v1.0 is in draft.)

pip install git+https://github.com/contextpassport/python.git

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.0a1.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.0a1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: context_passport-1.0.0a1.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.0a1.tar.gz
Algorithm Hash digest
SHA256 ee4c23d0e873532bc495a982ca0a38368873c9ebdc41569a00f2e573fce8f6dd
MD5 1770060f4e7a7ee76c53b71dba0cf928
BLAKE2b-256 c59f519bae663bc861493a6e530241cc1227765af51f6e6faa8ae1d49e0e00a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for context_passport-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 d935444edcc4d9308da7b01f8573d2787a7cca747cc1b1b70f29c7a11aa7c90f
MD5 5c384b7913592e41b1579e65fa12fba3
BLAKE2b-256 f40ee20956442c038bcb2f18249f7317b1dcf9963d28ddc0b9811beb8803685b

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