Ed25519: Initializing… Directory: Checking… ReplayGuard DO: Syncing…

Track 5 · Web Protocols · Request-Side RFC 9421 + IETF aipref + RSL 1.0

Web Bot Auth & aipref Gate

Publishers currently guess which bots are crawling their site from spoofable User-Agent strings and binary RFC 9309 robots.txt files that cannot distinguish real-time search/RAG grounding from model training. This lab tests request-side IETF Web Bot Auth (RFC 9421 Ed25519 signatures) with a SQLite Durable Object replay guard and an interactive IETF aipref policy conflict resolver.

Why this matters

IP allowlists and User-Agent headers are easy to spoof and brittle to maintain. Meanwhile, sites increasingly publish four overlapping preference layers—robots.txt, Content-Usage, Content-Signal, and RSL 1.0—that often contradict one another.

What this opens up

Cryptographic crawler identity paired with explicit per-purpose rules: origins can allow verified real-time ai-input grounding while blocking bulk train-ai crawls, stopping replayed signatures with an atomic SQLite nonce window, or requesting an RSL license token.

How the tests work

Sign live requests with a browser Ed25519 key enrolled in /.well-known, replay a captured nonce to trigger 409, run all 5 red-team attacks against /protected/*, and toggle policy controls to see how three precedence modes resolve contradictions.

3 Live Tests to Try

Initializing browser Ed25519 keypair…

1. Send a Verified RAG Request (200)

Signs an HTTP request in your browser with Ed25519 for /protected/article declaring purpose ai-input. Passes signature verification, replay protection, and policy checks.

2. Replay the Same Signed Request (409)

Re-sends the exact captured signature headers and nonce. The ReplayGuard SQLite Durable Object catches the duplicate nonce and returns 409 REPLAY_DETECTED.

3. Request Model Training Access (403)

Sends a fresh, valid signed request declaring purpose train-ai. Identity checks pass, then the aipref rule (train-ai=n) blocks it with 403 AIPREF_DENIED.

5 Live Red-Team Attacks Against the Edge Gate

Each button sends a real signed HTTP request against /protected/* to prove that replays, tampered URLs, unlisted keys, expired windows, and disallowed purposes fail closed.

0 / 5 executed
Attack Vector Expected Observed Gate Stage / Code Edge Timing
Run any attack button above to execute live verification failures against the Worker and ReplayGuard DO.

Live Browser Ed25519 Crawler Signer

Private key stays in browser RAM; only the public JWK is enrolled in ReplayGuard SQLite.

Trusted Browser Key (RFC 7638 kid) generating…
Unlisted Rogue Key (Attack #3) generating…
No signed request sent yet GET /protected/article
Client Sign: — Edge Verify: — DO Replay: — Edge Total: — RTT: —
Click "Sign & Send Request" or any preset above to inspect the live Worker verification receipt.

Durable Object ReplayGuard SQLite State

Persisted Ed25519 directory keys, sliding-window sig_nonces table, and verified vs. rejected counters.

200 Verified 0
409 Replay 0
401 Sig / Exp 0
403 Untrusted 0
403/402 Policy 0

Active Sliding Replay Window (sig_nonces)

Nonce Key ID Path Expires In
No active nonces in sliding window.

Interactive Policy Conflict Matrix Editor

Toggle robots.txt, IETF Content-Usage, Content-Signal, and RSL 1.0 rules for /protected/article, then verify live on the Worker.

1. robots.txt (RFC 9309)

2. Content-Usage (IETF aipref)

3. Content-Signal

4. RSL 1.0 (/rsl.json)

Deterministic Resolution Matrix (Shared policy-matrix.js)

Purpose robots Content-Usage Content-Signal RSL 1.0 Outcome

Emitted Policy Wire Headers & RSL 1.0 Snippet

RFC 9421 Signature Base, Directory & Protocol Wire Inspector

0 events recorded
1. Live RFC 9421 Signature Base & Request/Response Wire Trace
Send a signed request to inspect the exact RFC 9421 @signature-params, canonical signature base, and HTTP response headers.
2. Live /.well-known/http-message-signatures-directory & Self-Signature Proof
Not verified yet
Loading /.well-known/http-message-signatures-directory…
3. Live /robots.txt, /rsl.json (RSL 1.0 XML) & DO Audit Events

Live /robots.txt & RSL 1.0 XML

Loading /robots.txt and /rsl.json…

Recent ReplayGuard DO Audit Log

Waiting for ReplayGuard audit records…
Architecture Request-side RFC 9421 Ed25519 verification, DO replay window & aipref policy gate
Live HTTP Protocol Flow · Browser WebCrypto Signer -> Cloudflare Edge Worker -> SQLite Durable Object
Client Signer

Browser WebCrypto Ed25519 Bot

Signature-Agent + Signature-Input + Signature
  • Generates an Ed25519 keypair in RAM; enrolls only the public JWK (RFC 7638 kid) into /.well-known/http-message-signatures-directory
  • Signs canonical RFC 9421 base over @authority, signature-agent, @method, and @target-uri with a unique nonce
Edge Gate + DO SQLite

Worker & ReplayGuard src/router.ts

  1. Validate alg="ed25519", tag="web-bot-auth", and created/expires window
  2. Match Signature-Agent & keyid against trusted directory JWKs
  3. Verify Ed25519 signature over received request components
  4. Insert (kid, nonce) atomically in SQLite sig_nonces table
  5. Resolve robots.txt, Content-Usage, Content-Signal, and RSL 1.0

Shared pure modules (rfc9421-shared.js, policy-matrix.js) keep client preview and edge evaluation identical.

200 ALLOW

Verified Crawler & Permitted Purpose

X-Bot-Auth-Status: VERIFIED
Content-Usage Content-Signal Link: </rsl.json> Server-Timing
401 / 402 / 403 / 409

Fail-Closed Auth, Replay & Policy

REPLAY_DETECTED · SIG_INVALID · AIPREF_DENIED

Blocks replayed nonces (409), tampered or expired signatures (401), rogue directories or disallowed purposes (403), and unlicensed RSL crawls (402).

SQLite Durable Object ReplayGuard src/replay-guard-core.ts

new_sqlite_classes

Persists the origin's Ed25519 directory signing key across Workers isolates (preventing per-isolate key drift), enforces an atomic sliding replay window in sig_nonces, and tracks verified vs. rejected request counters in gate_stats.

Identity proof (RFC 9421 Ed25519 + DO nonce window) is decoupled from usage terms (robots.txt, Content-Usage, Content-Signal, and RSL 1.0), allowing origins to allow verified RAG retrieval while rejecting unlicensed training crawls.
How This Is Set Up

Request-Side RFC 9421 Web Bot Auth + aipref / RSL Policy Gate

Replacing spoofable User-Agent allowlists and coarse robots.txt blocks with Ed25519 request signatures, a SQLite Durable Object replay guard, and explicit multi-signal usage conflict resolution.

Anonymous User-Agent + binary robots.txt
GET /protected/article HTTP/2
User-Agent: FriendlyBot/1.0

# Unverifiable string: any scraper copies User-Agent.
# Binary robots.txt cannot express:
#   ai-input=y (RAG allowed) AND train-ai=n (training denied)
# No replay resistance or machine-readable license path.
RFC 9421 Ed25519 + DO ReplayGuard + aipref
GET /protected/article HTTP/2
Signature-Agent: "https://origin/.well-known/http-message-signatures-directory"
Signature-Input: sig1=("@authority" "signature-agent" "@method" "@target-uri");
  alg="ed25519";created=1764667200;expires=1764667320;
  keyid="<rfc7638-thumbprint>";nonce="<24B-random>";tag="web-bot-auth"
Signature: sig1=:<64B-ed25519-base64>:

# Edge response headers:
Content-Usage: train-ai=n, ai-input=y, search=y
Content-Signal: ai-train=no, ai-input=yes, search=yes
Link: </rsl.json>; rel="license"
Key terms & further reading
IETF Web Bot Auth ↗
An IETF working group standardizing cryptographic crawler authentication using RFC 9421 request signatures and Signature-Agent directories.
IETF AI Preferences (aipref / Content-Usage) ↗
A standardized HTTP header vocabulary letting publishers express separate preferences for search, ai-input (RAG), and train-ai.
RFC 9421 HTTP Message Signatures ↗
The HTTP signature specification binding request authority, method, target URI, timestamp window, and nonce to an Ed25519 signature.
RFC 9309 robots.txt ↗
The Robots Exclusion Protocol allowing sites to declare path-level allow and disallow rules for automated crawlers.
RSL 1.0 (Really Simple Licensing) ↗
A machine-readable licensing format for declaring free, attribution-only, or pay-per-crawl terms alongside preference headers.
Ed25519 & Sliding Replay Window ↗
A fast public-key signature algorithm paired with a Durable Object nonce store so captured valid signatures cannot be replayed.