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.0.tar.gz (7.5 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.0-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pact_auth-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 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.0.tar.gz
Algorithm Hash digest
SHA256 2f3684dd98e03e36629e24a08e25802f963feaccaf9b1d5de23d4609ac612139
MD5 7d9518266d82b09e2bafaa66de83a0f1
BLAKE2b-256 59b1e37a5efe77a16dd137ca452e03ad17de91655b4066589c21cce890ddec4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pact_auth-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: pact_auth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4305b150ce6874900538c3c6a1ebd3f3e936ab56aff63aa8a72947135597523b
MD5 72bfe1eacbc6849254659d5c5c76d0e1
BLAKE2b-256 f0622136dc891524e0999f2cfc13aa2566ce691e885bd51e0f54e8cd97ca4e0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pact_auth-0.1.0-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