Metadata-Version: 2.4
Name: agentpki
Version: 0.2.0a1
Summary: Python SDK for AgentPKI — cryptographic identity for AI agents. PASETO v4 passports, Ed25519 signing, RFC 9421 HTTP Message Signatures.
Project-URL: Homepage, https://agentpki.dev
Project-URL: Specification, https://agentpki.dev/spec/v0.1
Project-URL: Repository, https://github.com/agentpki/sdk-python
Project-URL: Issues, https://github.com/agentpki/sdk-python/issues
Author: AgentPKI
License-Expression: MIT
License-File: LICENSE
Keywords: agentpki,ai-agents,ed25519,identity,paseto,pki,rfc9421
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security :: Cryptography
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: cryptography>=42.0
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# @agentpki/sdk — Python

Python SDK for AgentPKI — cryptographic identity for AI agents.

- **Spec:** https://agentpki.dev/spec/v0.1
- **Companion TS SDK:** https://npmjs.com/package/@agentpki/sdk

```bash
pip install agentpki
```

```python
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
