Metadata-Version: 2.4
Name: context-passport
Version: 1.0.0
Summary: Reference Python implementation of the Context Passport open standard for AI agent events.
Author: Context Passport maintainers
License: Apache-2.0
Project-URL: Homepage, https://contextpassport.com
Project-URL: Specification, https://github.com/contextpassport/spec
Project-URL: Repository, https://github.com/contextpassport/python
Project-URL: Issues, https://github.com/contextpassport/python/issues
Keywords: ai,agents,context-passport,audit,verification,provenance
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: signing
Requires-Dist: cryptography>=42.0; extra == "signing"
Provides-Extra: langgraph
Requires-Dist: langchain-core>=0.3.0; extra == "langgraph"
Requires-Dist: langgraph>=0.2.0; extra == "langgraph"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: langchain-core>=0.3.0; extra == "dev"
Requires-Dist: cryptography>=42.0; extra == "dev"
Dynamic: license-file

# Context Passport — Python Reference Implementation

A reference implementation of the [Context Passport](https://github.com/contextpassport/spec) v1.0 specification in Python.

**Specification:** https://github.com/contextpassport/spec
**License:** Apache-2.0

## Install

```bash
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:

```bash
pip install "context-passport==1.0.0"
```

For optional extras:

```bash
pip install "context-passport[signing]"        # Ed25519 signing support
pip install "context-passport[langgraph]"      # LangChain/LangGraph callback handler
```

## Usage

```python
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](https://github.com/contextpassport/conformance-tests). Signed conformance is planned.

To run the conformance tests against this implementation:

```bash
git clone https://github.com/contextpassport/conformance-tests.git
cd conformance-tests
python runner/python/run.py --implementation context_passport
```

## Contributing

See [CONTRIBUTING.md](https://github.com/contextpassport/spec/blob/main/CONTRIBUTING.md) in the spec repository. Bug reports and pull requests welcome on this repo.

## Related repositories

- [contextpassport/spec](https://github.com/contextpassport/spec) — the specification
- [contextpassport/typescript](https://github.com/contextpassport/typescript) — TypeScript reference implementation
- [contextpassport/conformance-tests](https://github.com/contextpassport/conformance-tests) — conformance test suite
