Skip to main content

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

Project description

wais-pod

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.algova.dev"],
)

@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.0.tar.gz (70.0 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.0-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wais_pod-0.2.0.tar.gz
  • Upload date:
  • Size: 70.0 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.0.tar.gz
Algorithm Hash digest
SHA256 d9eb5fb79daba156613bf77783f717a1b736f8575bf9d12ac59045b5223770f4
MD5 7962235027cfa5b765696f3a0c55783c
BLAKE2b-256 605e44f0308eee82816bb52b07ea0af52fb26e9c3c0e1de2e873240a30f80ed2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wais_pod-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2302a98d2c483f2e5ef7aab8fd74169eb222bff6f153e04c2065556329593224
MD5 5db61eff43fc531841a51b2a34e143e9
BLAKE2b-256 53d07d26b6c7677238758b9bd8a54a25d93709023cf7114471c303aba64f36a8

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