You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Web Bot Auth cryptographic verification (0.14.0)
Cloudflare's post introducing this mechanism is titled 'Forget IPs: using
cryptography to verify bot and agent traffic'. The published-IP-range check
shipped in 0.11 is precisely the method it retires, so the library should
implement the successor rather than defend the predecessor.
Web Bot Auth is an RFC 9421 HTTP Message Signatures profile — Ed25519 per
request, a Signature-Agent header naming the key directory, keys at
/.well-known/http-message-signatures-directory. Backed by Cloudflare, Amazon,
Akamai and OpenAI, IETF working group chartered 2026. It dominates ranges on
every axis that bit us: any agent that signs rather than four vendors, no
freshness problem, no false 'spoofed' from a stale list, and it covers agents
running on a user's own machine — the case ranges structurally cannot.
Adds combinedVerifier(), which prefers a signature and falls back to ranges,
so adoption shifts the mix with no change at the call site.
Two deliberate rules:
- A present-but-invalid signature returns 'spoofed' even when the client IP
sits in a published range. Otherwise a forged signature could be laundered
into 'verified' by the weaker check.
- Unsigned traffic is 'unverifiable', never 'spoofed'. Most agents do not sign
yet; treating silence as forgery would mislabel nearly all real traffic.
Unsigned requests return before any I/O — the common path today costs nothing.
Signed ones fetch the signer's directory once per origin and cache it, keyed by
origin, for an hour.
Structured-field parsing is scoped to the shapes this profile emits rather
than a full RFC 8941 implementation, and returns null rather than guessing:
a malformed header must never read as a valid signature.
Tests 246 -> 262. The suite generates a real Ed25519 keypair and signs the
actual signature base, then checks replay onto another path, a tampered
signature, a key absent from the directory, expiry both by `expires` and by
maxAge, non-https signers, an unreachable directory, allowedSigners, that
unsigned traffic triggers no fetch, and that the directory is cached. Fixture
signatures would only have encoded whatever the parser happens to do.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@apideck/agent-analytics",
3
-
"version": "0.13.0",
3
+
"version": "0.14.0",
4
4
"description": "Track AI agent and bot traffic to your Next.js / Vercel app — PostHog, webhooks, or any custom analytics backend. Detects Claude, ChatGPT, Perplexity, Google-Extended, and more.",
0 commit comments