Skip to main content

Sovereign Agent Authentication Protocol — Python SDK

Project description

pact-auth

Sovereign Agent Authentication Protocol — Python SDK

Cryptographic identity, delegation chains, and capability-based authorization for AI agents. Zero trust, zero registry — the public key IS the identity.

Install

pip install pact-auth

Quick Start

import pact
from datetime import timedelta

# Create identities (Ed25519 keypairs)
human = pact.new_identity("human", "alice")
agent = pact.new_identity("agent", "my-agent")

# Delegate capabilities with expiry
delegation = pact.new_delegation(
    from_identity=human,
    to_identity=agent,
    capabilities=["storage:read", "storage:write"],
    ttl=timedelta(hours=24),
)

# Sign HTTP requests
req = pact.HttpRequest("GET", "https://api.example.com/data")
pact.sign_request(req, agent, [delegation])

# Verify (provider side)
result = pact.verify_request(req)
assert result.valid

Features

  • Self-sovereign identity — Ed25519 keypairs, sha256:hex IDs, no registry
  • Delegation chains — Signed capability transfers with narrowing-only constraint
  • Capability URIsresource:action,constraint=value format with wildcard support
  • HTTP signing — Content digest + signature headers compatible with RFC 9421
  • Session management — Ephemeral session keys delegated from persistent root
  • Revocation — Instant revocation with cryptographic proof
  • Zero dependencies beyond cryptography>=41.0

Protocol Spec

See SPEC.md for the full 968-line protocol specification.

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_auth-0.1.1.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

pact_auth-0.1.1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file pact_auth-0.1.1.tar.gz.

File metadata

  • Download URL: pact_auth-0.1.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pact_auth-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2e21b472022ac011322e0158ab07133ea9875a783fdce8d3b3813be624ef4927
MD5 0f2824e10ee0662490fbde1a2440937c
BLAKE2b-256 d0fc71ea47f1977ebd943495a8d5580039330396149fc1f9bb0d2ca36527ceec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pact_auth-0.1.1.tar.gz:

Publisher: publish-python.yml on anzal1/pact

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pact_auth-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pact_auth-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pact_auth-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93121fd61443f60df386c61b0368ee46682a5c0db6c9249e2b4aac933ea9f814
MD5 9960cd01ad40b5b6bcb60fb10ea9f791
BLAKE2b-256 f62a4af9259ca4ece3267caa7a6c2dfb8f9d83dc11eee3a42744fb51622926a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pact_auth-0.1.1-py3-none-any.whl:

Publisher: publish-python.yml on anzal1/pact

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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