Skip to main content

Agent Passport System: Python SDK

PyPI

Enforcement and accountability layer for AI agents. Bring your own identity. Python implementation of the Agent Passport Protocol, cross-language compatible with the TypeScript SDK. Signatures created in Python verify in TypeScript and the reverse. The Python port is a strict subset of the TS SDK. See the note under "What's Included" below for the current scope boundary.

Install

pip install agent-passport-system

Current stable: 2.8.0, installed by default with pip install agent-passport-system. The 2.4 line adds the Wave 1 accountability primitives (ActionReceipt, AuthorityBoundaryReceipt, CustodyReceipt, ContestabilityReceipt, APSBundle), Cognitive Attestation (Paper 4), and Instruction Provenance Receipts (v0.2). It also adds evidentiary type safety: a claim and evidence registry, a claim verifier, and a contestation cascade. All primitives are tested for byte-identical canonical JSON against the TypeScript SDK npm 3.1.0 fixtures.

Quick Start

Lead with the minimum you need to get a signed passport and a verifiable delegation: identity, delegation, and policy evaluation. Import the rest from agent_passport when you need it. Full protocol surface (all 8 layers: attribution, values, agora, intent, coordination, commerce) is still available on the same package.

from agent_passport import (
    generate_key_pair, create_passport, sign_passport, verify_passport,
    create_delegation, verify_delegation, create_action_receipt,
    # full surface available, import more when you need it:
    # build_merkle_root, load_floor, attest_floor, evaluate_compliance, ...
)

# Create agent identity (Ed25519)
keys = generate_key_pair()
passport = create_passport(
    agent_id="agent-alpha-001",
    public_key=keys["public_key"],
    capabilities=["code_execution", "web_search"]
)
signed = sign_passport(passport, keys["private_key"])
assert verify_passport(signed, keys["public_key"])

# Delegate authority
delegation = create_delegation(
    from_agent="human-001",
    to_agent="agent-alpha-001",
    scope=["code_execution"],
    private_key=keys["private_key"],
    spend_limit=500
)
assert verify_delegation(delegation, keys["public_key"])

# Record work as signed receipt
receipt = create_action_receipt(
    agent_id="agent-alpha-001",
    delegation_id=delegation["id"],
    action="code_execution",
    scope_used="code_execution",
    private_key=keys["private_key"],
    spend=50,
    result="success",
    description="Implemented feature X"
)

# Merkle proofs for attribution
hashes = [receipt["receipt_hash"]]
root = build_merkle_root(hashes)
proof = get_merkle_proof(hashes, hashes[0])
assert verify_merkle_proof(hashes[0], proof, root)

What's Included

Module Layer What It Does
crypto base Ed25519 key generation, signing, verification
canonical base Deterministic JSON serialization (cross-language compatible)
passport 1 Agent identity creation, signing, verification, expiry
delegation 1 Scoped delegation chains, sub-delegation, revocation
values 2 Human Values Floor: load YAML/JSON, attestation, compliance, graduated enforcement
attribution 3 Merkle proofs, beneficiary tracing, contribution tracking
agora 4 Signed message feeds, topics, threading, agent registry
intent 5a Roles, deliberation, consensus, tradeoff evaluation, precedents
policy 5b 3-signature chain, FloorValidatorV1, action intents
coordination 6 Task lifecycle: briefs, evidence, review, handoff, deliverables
integration 7 Cross-layer bridges (commerce+intent, coord+agora, etc.)
commerce 8 4-gate checkout, human approval, spend tracking, receipts

Cross-Language Compatibility

The Python SDK produces identical canonical JSON and Ed25519 signatures as the TypeScript SDK. This means:

  • A passport signed in Python can be verified in TypeScript
  • Delegation chains can span Python and TypeScript agents
  • Merkle roots computed from the same receipts match across languages
from agent_passport import canonical_json

# Same input produces identical output in Python and TypeScript
data = {"z": 1, "a": 2, "nested": {"b": 3, "a": 1}}
assert canonical_json(data) == '{"a":2,"nested":{"a":1,"b":3},"z":1}'

Protocol Layers

This Python SDK implements all 8 Agent Passport Protocol layers:

  1. Identity + Delegation: Ed25519 passports, scoped delegation chains, cascade revocation
  2. Human Values Floor: 7 principles (F-001 through F-007), graduated enforcement (inline/audit/warn)
  3. Beneficiary Attribution: Merkle proofs for contribution tracking
  4. Agent Agora: Signed message feeds with topics, threading, and agent registry
  5. Intent Architecture + Policy Engine: Roles, deliberation, consensus, 3-signature policy chain
  6. Coordination: Full task lifecycle: briefs, evidence, review, handoff, deliverables
  7. Integration Wiring: Cross-layer bridges (commerce+intent, coordination+agora)
  8. Agentic Commerce: 4-gate checkout, human approval, spend limits

Cross-language parity with the TypeScript SDK at npm v3.3.0. Python SDK 2.8.0 ships the full Wave 1 surface: ActionReceipt, AuthorityBoundaryReceipt, CustodyReceipt, ContestabilityReceipt, APSBundle (with balanced Merkle commitment), Cognitive Attestation (Paper 4: three-stage verification, typed dispute primitives), and Instruction Provenance Receipts v0.2 (path canonicalization, context-root binding, action-time recompute). The four evidentiary type safety primitives also ship in 2.8.0. All surfaces are tested against TS-issued fixtures for byte-identical canonical JSON. Cross-language signature verification covers every signed primitive in the SDK. Also available via the MCP server.

Links

Tests

pip install -e ".[test]"
pytest tests/
# 568 passed, 1 skipped, 6 xfailed. Coverage spans all 8 protocol layers
# plus the v2 evidentiary type safety, Wave 1 accountability, Cognitive Attestation,
# and Instruction Provenance Receipt surfaces. The cross-impl byte-parity tests assert
# byte-identical canonical JSON against TS-issued fixtures (rfc8785 ships in the test
# extra). Two cross-language tests also need the agent-passport-system TS SDK checked
# out next to this repo; without that sibling they skip (566 passed, 3 skipped).

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_passport_system-2.10.0.tar.gz (154.5 kB view details)

Uploaded Source

Built Distribution

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

agent_passport_system-2.10.0-py3-none-any.whl (211.3 kB view details)

Uploaded Python 3

File details

Details for the file agent_passport_system-2.10.0.tar.gz.

File metadata

  • Download URL: agent_passport_system-2.10.0.tar.gz
  • Upload date:
  • Size: 154.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for agent_passport_system-2.10.0.tar.gz
Algorithm Hash digest
SHA256 0e391e9e1251403c56f8761e99b47e3ffeaf8ebe7b404766587cc04435620e67
MD5 0ea271fe938a1148a2b0f558c831fe8a
BLAKE2b-256 2d3e10a7981b6d122292b7e49d7ef8d2339ef65a10ce5a558bb519651ea23a5b

See more details on using hashes here.

File details

Details for the file agent_passport_system-2.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_passport_system-2.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae84bf418095b01e0c74db0f343103787af875e2e2aaea607bb502e705eafebe
MD5 df4f2a4609b86dfb3ee1f85f0c035abd
BLAKE2b-256 d3a3da7c2764ea2acbea1e7e5caa8591f3d8fb28f493483138f5b6de52e54cbd

See more details on using hashes here.

Release history Release notifications | RSS feed

3.0.0

2 files

2.11.0

2 files

This release

2.10.0 This release

2 files

2.9.0

2 files

2.8.1

2 files

2.8.0

2 files

2.7.0

2 files

2.6.0

2 files

2.5.0

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.0.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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