Cloudflare Worker implementation of the AgentPKI verification endpoint (spec §8). Stateless, sub-50 ms p99, runs at the edge globally.
- Spec: https://agentpki.dev/spec/v0.1
- Hosted instance:
https://verify.agentpki.dev(or the equivalent*.workers.devURL until the custom domain attaches)
Exposes a single primary endpoint:
POST /v1/verify
Content-Type: application/json
Implements the 12-step verification procedure of spec §8.2:
- Parse the PASETO v4.public token
- Extract
issandfooter.kid - Resolve the issuer directory (cached in-isolate, 5-min TTL)
- Select the appropriate public key by
kid - Verify the Ed25519 signature
- Check
exp,nbf, version - Check
audagainst the relying site (if provided) - Check revocation list (stub in v0.1 — see roadmap)
- If Mode B: verify the RFC 9421 HTTP Message Signature
- Apply optional site policy (min_tier, required_scopes, max_abuse_score, require_signed)
- Compute verdict (
allow/throttle/deny/unknown) - Return the structured verdict with timings
See src/verify.ts for the implementation.
git clone https://github.com/agentpki/verifier
cd verifier
pnpm install
pnpm dev # local development with miniflare
pnpm run release # deploy to your own Cloudflare account# Health check
curl https://verify.agentpki.dev/health
# {"ok":true,"ts":1779379420}
# Verify a passport (mint one first via demo.agentpki.dev/mint)
curl -X POST https://verify.agentpki.dev/v1/verify \
-H 'content-type: application/json' \
-d '{"token":"v4.public.eyJ..."}'# 1. Mint a passport
TOKEN=$(curl -s 'https://demo.agentpki.dev/mint?sub=agent:hello/world' | jq -r .token)
# 2. Verify it
curl -s -X POST https://verify.agentpki.dev/v1/verify \
-H 'content-type: application/json' \
-d "{\"token\":\"$TOKEN\"}" | jq- Workers KV-backed issuer directory cache (cross-isolate persistence)
- Bloom-filter CRL distribution per spec §10.3
- Replay-detection cache (Durable Object) for Mode B
- Abuse-score aggregation (currently returns 0.0 placeholder)
- D1-backed audit log
- Workers Analytics Engine for verification metrics
MIT. Spec it implements is Apache 2.0.