Skip to main content

PACT — Protocol for Agent Credentials and Trust

Project description

PACT Python SDK

Trust infrastructure for autonomous AI agents. Implements the PACT Protocol (Protocol for Agent Credentials and Trust) -- DIDs, mandates, attestations, pacts, and handshakes for machine-to-machine identity and delegation.

Installation

pip install pact-trust-sdk

Optional extras:

pip install pact-trust-sdk[server]   # HTTP server (starlette + uvicorn)
pip install pact-trust-sdk[mcp]      # MCP tool integration

Quick Start

from pact import Agent, Mandate, Attestation

# Create an agent identity
agent = Agent.create(name="Wren")
print(agent.did)  # did:pact:z6Mk...

# Issue a delegation mandate
mandate = Mandate.issue(
    issuer=principal.did,
    subject=agent.did,
    scope=["trade:read", "trade:execute"],
    expires_in_days=90,
)

# Create a trust attestation
attestation = agent.attest(
    subject=peer.did,
    interaction_type="task_completion",
    outcome="success",
    metrics={"accuracy": 0.95},
)

Features

The SDK implements all five PACT primitives:

  • Agents -- Ed25519 key pairs with did:pact: decentralized identifiers
  • Mandates -- Scoped, time-bound delegation from principal to agent
  • Attestations -- Signed records of interaction outcomes that build trust
  • Pacts -- Bilateral agreements between agents with lifecycle tracking
  • Handshakes -- Cryptographic mutual authentication between agents

Plus: DID resolution, delegation chain validation, and trust evaluation.

Links

License

Apache 2.0

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

pact_trust_sdk-0.5.0.tar.gz (50.1 kB view details)

Uploaded Source

Built Distribution

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

pact_trust_sdk-0.5.0-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

Details for the file pact_trust_sdk-0.5.0.tar.gz.

File metadata

  • Download URL: pact_trust_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 50.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pact_trust_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 eb299d5a0db806224d2cecf08cfbd2c832f86c8c0e1793b6496f4cc73743c9ed
MD5 002fb68b7e6815f0294cb32923a9c4a3
BLAKE2b-256 78bf56d3cf92bbefb73e724f86c12e27d8f9e3610cf6cd4841168b126c03f0db

See more details on using hashes here.

File details

Details for the file pact_trust_sdk-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pact_trust_sdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pact_trust_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a9fa9cef97c07d57e20999897b8ca510efb3fb2d6aa904fa467f37ab12128bf
MD5 a9935231500021fa2c6a66ad6f4f726e
BLAKE2b-256 7f4efdddcdb6453968b150b755297ca7508840c2fc39169955c685c6c2becd4f

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