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=["qwenpaw.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=["qwenpaw.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.
Metadata
Release files for aip-identity-verify 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aip_identity_verify-0.1.5.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aip_identity_verify-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.4 kB
Release files / aip_identity_verify-0.1.5.tar.gz
| Download URL | aip_identity_verify-0.1.5.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68dd2c97f923e26492ae20c669b4c7f4d3006226dd98e54e2aaf2e3ccb292256
|
|
BLAKE2b-256 checksum How to use checksums |
0a21b247a4a7e605c8f6bbd086ea4fbf89031cde333529e5db149cb1c97842cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.14
|
Release files / aip_identity_verify-0.1.5-py3-none-any.whl
| Download URL | aip_identity_verify-0.1.5-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4568a112c0b3e7b22e0b5f6ef245903c38360cd0d2e5516d3928820f6d83922c
|
|
BLAKE2b-256 checksum How to use checksums |
67efaa7263e5bee051d67162a07d027df111fb43a9a40645815cd04315316c8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.14
|