# agent well-known audit lab

- Status: `experiment`
- Track: [agent discovery, auth & protocol bridges](https://aifoc.us/labs/agent-bridges-and-discovery/)
- Layer: 9. Agent Discovery, Auth & Protocol Bridges
- Updated: 2 December 2026
- Live demo: https://agent-well-known-audit-lab.kinlan-test.workers.dev
- Source: https://github.com/PaulKinlan/agent-well-known-audit-lab

## Inspired by

- [hyper content negotiation](https://aifoc.us/hyper-content-negotiation/)
- [A link is all you need](https://aifoc.us/a-link-is-all-you-need/)
- [webmcp is the new web intents ... maybe](https://aifoc.us/webmcp-is-the-new-web-intents/)

## Why this matters

Websites increasingly expose machine-readable files under [RFC 8615 `/.well-known/`](https://www.rfc-editor.org/rfc/rfc8615) and root paths—such as `/agents.md`, `/llms.txt`, `/.well-known/agent-card.json`, `/.well-known/mcp.json`, [OAuth RFC 9728](https://www.rfc-editor.org/rfc/rfc9728) metadata, [RFC 9421 Bot Auth Directory](https://datatracker.ietf.org/doc/draft-meunier-http-message-signatures-directory/) keys, `/.well-known/agent-skills/index.json`, and [IETF `aipref`](https://datatracker.ietf.org/wg/aipref/about/) rules—so automated clients can inspect capabilities without scraping HTML. In production, discovery fails silently when SPA routers serve HTTP `200 text/html` pages for missing files, ephemeral serverless keys reset across restarts, skill SHA-256 digests drift, or redirect chains leak internal IP addresses.

## What this opens up

Reliable, verifiable machine-readable site discovery across all 12 `/.well-known/` and root conventions, letting automated tools validate Ed25519 HTTP signatures, exact `SKILL.md` file digests, media types, and [HTTP `QUERY`](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/) filters before trusting a site.

## How the tests work

1. Click **Audit This Live Worker** to check all 12 real endpoints hosted on this Worker, verifying persistent SQLite Durable Object Ed25519 signatures, RFC 9530 `Content-Digest` headers, and exact `SKILL.md` SHA-256 bytes.
2. Click **Run 5-Fixture Gauntlet** to run the auditor against five intentionally broken routes (`soft-404`, `bad-digest`, `bad-sig`, `bad-mime`, and `redirect-loop`) and confirm each triggers its specific fault code.
3. Click **Run HTTP QUERY + SSRF Suite** (or use the HTTP `QUERY` form) to filter `/api/skills/query` with a safe request body and watch private/local targets (`127.0.0.1`, `169.254.169.254`, `[::1]`, `file:///etc/passwd`) fail closed with HTTP `400`.
4. Click any audited row to inspect its headers and reconstructed RFC 9421 signature base, then click **Verify in Browser WebCrypto** to repeat the cryptographic checks locally in your browser tab.


## Hypothesis

- **Claim:** Pairing a persistent SQLite Durable Object Ed25519 key store with an SSRF-hardened WebCrypto auditor that checks HTTP status, strict MIME/JSON structure, RFC 9421 signatures, RFC 9530 `Content-Digest`, and `SKILL.md` SHA-256 digests catches silent SPA soft-404s, digest drift, signature tampering, and unsafe redirects across all 12 discovery conventions.
- **Confirms it:** Auditing this Worker passes all 12 live endpoints—including cross-isolate Ed25519 signature verification and HTTP `QUERY /api/skills/query`—while the five broken fixtures deterministically report `SOFT_404_HTML`, `BAD_SKILL_DIGEST`, `BAD_SIGNATURE`, `BAD_MIME`, `REDIRECT_LOOP`, and `SSRF_REDIRECT_BLOCKED`.
- **Bounds or disproves it:** Many hosting stacks return catch-all `200 text/html` pages for missing `/.well-known/*` paths or strip draft HTTP `QUERY` requests at reverse proxies, breaking naive discovery clients that only check `res.ok`.


## Under the hood

[Agent Well-Known Audit Lab](https://agent-well-known-audit-lab.kinlan-test.workers.dev) ([source on GitHub](https://github.com/PaulKinlan/agent-well-known-audit-lab)) runs as a Cloudflare Worker backed by a single-writer SQLite Durable Object (`WellKnownKeyStore`) that persists one Ed25519 keypair so signatures stay valid across isolate restarts.

- **12 live discovery routes (zero `/demo/*` stubs):** Serves `/agents.md`, `/llms.txt`, `/.well-known/agent-card.json` (A2A v1.0), `/.well-known/mcp.json` (backed by live `POST /api/mcp`), `/.well-known/oauth-protected-resource` ([RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)), `/.well-known/http-message-signatures-directory` (Ed25519 JWKS with [RFC 9421](https://www.rfc-editor.org/rfc/rfc9421) self-signature), `/.well-known/web-island.json`, `/.well-known/ai-plugin.json` (linked to `/api/openapi.json`), `/robots.txt`, `/.well-known/security.txt` ([RFC 9116](https://www.rfc-editor.org/rfc/rfc9116)), `/.well-known/agent-skills/index.json` + `/SKILL.md` (exact WebCrypto SHA-256 match), and `/.well-known/aipref` (IETF `Content-Usage`) plus `QUERY /api/skills/query`.
- **SSRF-hardened auditor (`POST /api/audit`):** Rejects non-HTTPS schemes, non-443 ports, IPv4/IPv6 private and metadata ranges, and unsafe redirect hops with HTTP `400` or `SSRF_REDIRECT_BLOCKED`, while enforcing manual redirect tracking and a 128 KiB body cap.
- **Shared browser & edge WebCrypto module (`public/lib/verify-crypto.js`):** The same verification code runs inside the Worker, Node.js tests, and the browser tab so visitors can independently verify `Content-Digest` ([RFC 9530](https://www.rfc-editor.org/rfc/rfc9530)), Ed25519 `Signature` headers, and `/SKILL.md` SHA-256 bytes alongside five broken fault routes (`/fixtures/soft-404/*`, `/fixtures/bad-digest/*`, `/fixtures/bad-sig/*`, `/fixtures/bad-mime/*`, `/fixtures/redirect-loop/*`).


## Key terms & further reading

- [RFC 8615 (/.well-known/)](https://www.rfc-editor.org/rfc/rfc8615) — Standard URL prefix where sites publish machine-readable metadata files without colliding with application routes.
- [RFC 9421 HTTP Message Signatures & Bot Auth Directory](https://datatracker.ietf.org/doc/draft-meunier-http-message-signatures-directory/) — A signed JSON key directory at `/.well-known/http-message-signatures-directory` paired with [RFC 9421](https://www.rfc-editor.org/rfc/rfc9421) headers so clients verify responses cryptographically.
- [OAuth Protected Resource Metadata (RFC 9728)](https://www.rfc-editor.org/rfc/rfc9728) — Discovery JSON at `/.well-known/oauth-protected-resource` pointing automated clients to an API's authorization server and scopes.
- [IETF aipref (Content-Usage)](https://datatracker.ietf.org/wg/aipref/about/) — Standard vocabulary for declaring how automated crawlers and AI systems may train on or index published content.
- [HTTP QUERY Method](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/) — Draft safe, idempotent HTTP method that sends structured filter payloads in the request body instead of encoding them into long URLs.
- [Cloudflare Durable Objects](https://developers.cloudflare.com/durable-objects/) — Single-writer edge compute objects with embedded SQLite storage that keep Ed25519 signing keys stable across Worker restarts.

## Open questions to iterate on

- Which subset of these 12 discovery files will consolidate into a single canonical manifest versus remaining separate `/.well-known/` entries?
- How widely do CDNs and reverse proxies currently pass or reject the draft HTTP `QUERY` method?

## Iteration log

- **2026-12-02:** Deployed Cloudflare Worker + SQLite Durable Object (`WellKnownKeyStore`) serving 12 live non-stub agent discovery endpoints, HTTP `QUERY /api/skills/query`, 5 intentionally broken conformance fixtures, and an SSRF-hardened WebCrypto auditor (`POST /api/audit`).

## Primitives tested

- `/.well-known/* Agent Discovery (12 Endpoints)`
- `WebCrypto Ed25519 (WellKnownKeyStore DO)`
- `RFC 9421 & RFC 9530 Verification`
- `SHA-256 SKILL.md Digest Check`
- `HTTP QUERY Method`
- `SSRF-Hardened Auditor`

## Connected labs in other tracks

- [web bot auth & aipref gate](https://aifoc.us/labs/web-protocols/web-bot-auth-aipref-gate/) — Enforces `/.well-known/http-message-signatures-directory` and `Content-Usage` on live protected routes.
- [/agents.md vs. mcp onboarding lab](https://aifoc.us/labs/agent-bridges-and-discovery/agents-md-vs-mcp-onboarding-lab/) — Races `/agents.md` discovery against Streamable HTTP MCP from one shared tool registry.
- [mcp oauth 2.1 handshake lab](https://aifoc.us/labs/agent-bridges-and-discovery/mcp-oauth-handshake-lab/) — Executes full OAuth 2.1 flows bootstrapped from `/.well-known/oauth-protected-resource`.

---
Canonical: https://aifoc.us/labs/agent-bridges-and-discovery/agent-well-known-audit-lab/
