Skip to main content

WAIS — Web Agent Interaction Standard. Core library for agent authentication and site integration.

Project description

wais-pod

PyPI Python CI License: MIT

Proof of Delegation (PoD) — Open-source authentication for AI agents.

An open protocol enabling AI agents to prove they act on behalf of authenticated human users with verifiable, scoped authorization. Part of the WAIS (Web Agent Interaction Standard) ecosystem.

Install

pip install wais-pod

For FastAPI site integration:

pip install wais-pod[site]

Quick Start

Issuing a PoD Token

from pod import PoDIssuer

issuer = PoDIssuer(private_key_pem=YOUR_PRIVATE_KEY)

token = issuer.issue(
    user_hash="sha256-of-user-id",
    agent_id="agent-123",
    audience="https://api.example.com",
    scopes=["api.access", "search.execute"],
    ttl=3600,
)

print(token.compact)  # signed JWT

Verifying a Token

from pod import PoDVerifier

verifier = PoDVerifier(public_key_pem=PLATFORM_PUBLIC_KEY)
result = verifier.verify(token_string, expected_audience="https://api.example.com")

if result.valid:
    print(f"User: {result.user_hash}, Scopes: {result.scopes}")

Site Integration (FastAPI)

Add WAIS support to your existing API in minutes — no breaking changes:

from fastapi import FastAPI, Depends
from contextlib import asynccontextmanager
from pod.site import WAISAuth

wais = WAISAuth(
    site_url="https://api.yoursite.com",
    platform_urls=["https://pod.deeger.io"],
)

@asynccontextmanager
async def lifespan(app):
    await wais.setup()  # fetches platform JWKS
    yield

app = FastAPI(lifespan=lifespan)

@app.post("/v1/search")
async def search(auth=Depends(wais.require(scopes=["api.access"]))):
    if auth.is_wais:
        print(f"WAIS agent acting for user {auth.user_hash}")
    else:
        print(f"Traditional API key: {auth.client}")

What's Inside

Module Purpose
pod.token PoD token data models (JWT payload, constraints, scopes)
pod.issuer Token creation and ES256 signing
pod.verifier 12-step token verification
pod.dpop DPoP proof-of-possession (RFC 9449)
pod.sd_jwt Selective Disclosure JWTs for privacy-preserving identity
pod.scopes 30+ standard WAIS scopes with risk levels + custom x- scopes
pod.confirmation Async challenge/response for high-risk ops and payments
pod.site Drop-in FastAPI integration with dual auth

Key Concepts

  • Proof of Delegation: A signed JWT proving an AI agent is authorized to act on behalf of a specific user, with scoped permissions and time limits.
  • DPoP Binding: Tokens are bound to the agent's key pair — stolen tokens can't be replayed by another agent.
  • Hybrid Scopes: Standard scopes (fixed risk levels) + custom x- scopes (site-defined) + freeform actions.
  • Confirmation Flow: High-risk operations trigger 402 challenges. Agents poll for user confirmation or payment completion.
  • SD-JWT Passport: Users carry a privacy-preserving digital identity. Sites request only the claims they need.

Requirements

  • Python >= 3.10
  • cryptography >= 41.0.0 (only runtime dependency)

Documentation

License

MIT — see LICENSE.


Built by Deeger.

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

wais_pod-0.2.3.tar.gz (91.5 kB view details)

Uploaded Source

Built Distribution

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

wais_pod-0.2.3-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file wais_pod-0.2.3.tar.gz.

File metadata

  • Download URL: wais_pod-0.2.3.tar.gz
  • Upload date:
  • Size: 91.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for wais_pod-0.2.3.tar.gz
Algorithm Hash digest
SHA256 70c17bb024e41765ad41804f4c62d1d38024b1ba06d69e4b6d5b7c70175b7a9b
MD5 ef865628cecd8c1cb1fdf3fcf43db463
BLAKE2b-256 1b263935d152dbdf545a922ff19009b1a4db6a70fd3e955b689af5c9cbde2ea0

See more details on using hashes here.

File details

Details for the file wais_pod-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: wais_pod-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for wais_pod-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 66b7718a8ba821a4b91122546bc0915363aa9f6dc84ebb7298d3e64b37dc86bc
MD5 1a8e2777f90246ff095e51f714333058
BLAKE2b-256 e1015b2d0aa93ead1ed5abe30ba0bebcc78d9724de1964c7b731124c21c3e50a

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