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.2.tar.gz (91.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.2-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wais_pod-0.2.2.tar.gz
  • Upload date:
  • Size: 91.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.2.tar.gz
Algorithm Hash digest
SHA256 c7ba4c3291f11f06649d6e261e686bd142e2a85c8f22d56033ae02e0bcb6afc4
MD5 a32c8bb7a5603acc913265bebcd24e11
BLAKE2b-256 048a8184d50631f72c805e098a70fb94e5c244b24f201e1a881d92c0998fd5e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wais_pod-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 39.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b686e59846ce39cda22c23408cdb568e38095d60a254615c60e5a7d48f3407d
MD5 2fcb286da707c2f0c5ade4e43dc30d62
BLAKE2b-256 861fb30ad16aecf6fce0b7ccb8e6773c921d51df087ceea57f8c9e730acb8993

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