Agent Identity Protocol - Hub Verification Library
Project description
aip-identity-verify
Agent Identity Protocol verification library — for hubs and services to verify AI agent JWT tokens.
Installation
pip install aip-identity-verify
Quick Start
from aip_identity_verify import AIPVerifier
verifier = AIPVerifier(
trusted_providers=["copaw.ai"],
audience="https://my-hub.example.com",
)
# HTTP (REST)
agent = await verifier.verify(request.headers["Authorization"])
# WebSocket / gRPC / MCP — use verify_token() with the raw JWT
agent = await verifier.verify_token(raw_jwt_string)
print(f"Agent: {agent.agent_id}, Principal: {agent.principal}")
Features
- Transport-agnostic —
verify()for HTTP headers,verify_token()for raw JWTs (WebSocket, gRPC, MCP) - Multi-algorithm support — Verifies JWTs signed with ES256 (ECDSA P-256) or EdDSA (Ed25519)
- Key rotation resilience — Automatically refetches JWKS when an unknown
kidis encountered - Clock skew tolerance — Configurable leeway (default 30s) for JWT expiry checks
- JWKS caching — Caches provider public keys with configurable TTL (default 1 hour)
- Activity reporting — Built-in
AIPActivityReporterfor sending activity logs back to the IdP
Configuration
verifier = AIPVerifier(
trusted_providers=["copaw.ai", "other-idp.example.com"],
audience="https://my-hub.example.com",
cache_ttl=3600, # JWKS cache TTL in seconds (default: 1 hour)
clock_skew_seconds=30, # Clock skew tolerance (default: 30s)
provider_urls={ # Optional: override base URLs (e.g. for local dev)
"localhost": "http://localhost:8000",
},
)
Documentation
See the Agent Identity Protocol repository for full documentation.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aip_identity_verify-0.1.3.tar.gz.
File metadata
- Download URL: aip_identity_verify-0.1.3.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd5c69fa350721a18ab8fbf93d712c9cb887553e31f35b894f75799e997ae983
|
|
| MD5 |
ac8823eec74a6bec206dd1ba5abd524b
|
|
| BLAKE2b-256 |
464ba0bacaada70d048734034b9ab1ca9fb81a9be475eeb084d709d4db4b650b
|
File details
Details for the file aip_identity_verify-0.1.3-py3-none-any.whl.
File metadata
- Download URL: aip_identity_verify-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c03588cc43d765e3a22fc763e88b0bd2145cfef1384393fa447b5817c83e368
|
|
| MD5 |
a064468f7d4ecaa9874fe00d5242975d
|
|
| BLAKE2b-256 |
0a8ccf6a75c906246eca1b03e9b105eb2e138ee47adfa11c151034c7acaa888e
|