Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

@agentpki/sdk — Python

Python SDK for AgentPKI — cryptographic identity for AI agents.

pip install agentpki
from agentpki import generate_key_pair, sign_passport, verify_passport
import time

kp = generate_key_pair()
now = int(time.time())

token = sign_passport(
    {
        "v": 1,
        "iss": "example.com",
        "sub": "agent:example.com/research-bot-v1",
        "iat": now,
        "exp": now + 3600,
        "jti": "0e4f8a2c91b34e7b9c5d8a1e2f3b4c5d",
        "tier": 1,
        "scope": ["read:articles"],
    },
    private_key=kp.private_key,
    kid="example-2026-q2",
)

result = verify_passport(token, kp.public_key)
assert result.valid
assert result.payload["iss"] == "example.com"

See examples/round_trip.py for a complete sanity check covering signing, parsing, verification, tamper detection, expiry enforcement, lifetime cap, and RFC 9421 HTTP Message Signatures.

License

MIT

Metadata

Release files for agentpki 0.2.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentpki 0.2.0a1
File Size Uploaded Provenance Actions
agentpki-0.2.0a1.tar.gz 12.8 kB Without provenance Details for agentpki-0.2.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentpki 0.2.0a1
File Interpreter ABI Platform Actions
agentpki-0.2.0a1-py3-none-any.whl Python 3 none any Details for agentpki-0.2.0a1-py3-none-any.whl

Total release size: 27.7 kB

Release files / agentpki-0.2.0a1.tar.gz

Download URL agentpki-0.2.0a1.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
819316e3121d0488c20021868de0960637efd19c47ac4213d73acc0abdf26c5c
BLAKE2b-256 checksum
How to use checksums
75e570d8da1a8a59377114ba55aa40e2dd816ecfef1319b9ea5fea5480a9b2bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / agentpki-0.2.0a1-py3-none-any.whl

Download URL agentpki-0.2.0a1-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18ef6393c24333cdd6f424c93f7b0ad45812f093ed56246b4478ae923be0dde8
BLAKE2b-256 checksum
How to use checksums
c14b88aab22d169b9eb7acce8cd6472f44d1900ce0ac3b272fc22a67fc6ccdd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for agentpki 0.2.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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