Skip to main content

agent-id-service-sdk

AgentID Service SDK — for services and APIs to verify AI agent JWTs and report activity back to the IdP.

Installation

pip install agent-id-service-sdk

Quick Start

from agent_id_service_sdk import AIPVerifier

verifier = AIPVerifier(
    trusted_providers=["qwenpaw.ai"],
    audience="https://my-service.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 kid is 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 AIPActivityReporter for sending activity logs back to the IdP

Configuration

verifier = AIPVerifier(
    trusted_providers=["qwenpaw.ai", "other-idp.example.com"],
    audience="https://my-service.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 AgentID repository for full documentation.

Metadata

Release files for agent-id-service-sdk 0.6.0

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

Source distribution (sdist)

Source distribution for agent-id-service-sdk 0.6.0
File Size Uploaded
agent_id_service_sdk-0.6.0.tar.gz 56.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-id-service-sdk 0.6.0
File Interpreter ABI Platform
agent_id_service_sdk-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 97.3 kB

Release files / agent_id_service_sdk-0.6.0.tar.gz

Download URL agent_id_service_sdk-0.6.0.tar.gz
Size 56.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b5091ab7d8c60fa2279bdd76211ff35a3861498ec685d840b2d46a431dd7e3ae
BLAKE2b-256 checksum
How to use checksums
23534066c84498cf447515efcacc79317dad194892cb3b2a80cd3e32cfb68581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / agent_id_service_sdk-0.6.0-py3-none-any.whl

Download URL agent_id_service_sdk-0.6.0-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c67474e3996f1532d89da105e97bd88f0bae40baaf27a6109e545ecd1d44595b
BLAKE2b-256 checksum
How to use checksums
6486b8947043216167457f5c9eebf0e8aec58bd6bcc75c29cfc2a7a4c3c64a23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

1 release file

0.1.0

1 release file

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