Skip to main content

AgentID — Service-side SDK for verifying AI agent JWTs and reporting activity

Project description

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-agnosticverify() 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.

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

agent_id_service_sdk-0.4.0.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_id_service_sdk-0.4.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file agent_id_service_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: agent_id_service_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for agent_id_service_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bb926d1d734bb840db5a1cfd54c5d00703154facb0be0d5941c981302f30f8a1
MD5 985da96b3ca8e5053d7cc6a647d11087
BLAKE2b-256 31ff080eb3fd939611acb3660552560af1059bb4cabd1b1b3bf383ad769d93c2

See more details on using hashes here.

File details

Details for the file agent_id_service_sdk-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_id_service_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad857a80ee7c2722285fb768ff3a085211e306b8573920b9dbb850a3a781dabf
MD5 15884fe307037ddf2283c747e84d984a
BLAKE2b-256 e80895fcf679733f9dfa4653d2ffbae62d149fcfd781ff6a02c1d52ff5f99efd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page