Skip to main content

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",
)

# In your request handler:
agent = await verifier.verify(request.headers["Authorization"])
print(f"Agent: {agent.agent_id}, Principal: {agent.principal}")

Features

  • 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=["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

aip_identity_verify-0.1.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

aip_identity_verify-0.1.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file aip_identity_verify-0.1.2.tar.gz.

File metadata

  • Download URL: aip_identity_verify-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for aip_identity_verify-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0816f31ff8b4fa0c06e42458db2bc5b5e61cb3124bff616732445ff5b095205d
MD5 78e5b4b634497f598a724a2709bcc153
BLAKE2b-256 b44a232fe14d99e9820bbe3b2089de3ed7966acdd1e09792b0f07230eb51c830

See more details on using hashes here.

File details

Details for the file aip_identity_verify-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for aip_identity_verify-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cae6d9f36e363162a834d2bf9c4140060bc142eee651a83764d049b8419539f
MD5 904594c07fc7a27b4616ed788b8f6a0b
BLAKE2b-256 793ee1f17de9600943aa1a718456b04f41b864bfd428af36ecb494ada611b25c

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