Repository navigation
fix(registry): surface declared agent_url spellings so the agents page can ask the directory - #8316
Conversation
…e can ask the directory The registry lists an agent once, under its folded identity key: `/mcp` and `/mcp/` are one agent (#7830). The directory answers authorization questions spec-exactly, trailing slash significant (#7829, #8314). Both rules are right, and together they left a hole on the public agents page: it asked `GET /v1/agents/${agent.url}/publishers` with the listed (folded) URL, so an agent whose publishers declared it as `/mcp/` showed "No indexed publisher authorizations" — the page was asking about a spelling no publisher wrote. `GET /api/registry/agents` now returns `declared_urls[]` per agent: the listed URL first, then the owner's registered spelling, then every raw `agent_url` the directory has indexed under that identity. One bulk query (`bulkDeclaredAgentUrls`) over `v_effective_agent_authorizations` for the whole page; a failure logs and falls back to the identity URL rather than failing the listing. The legacy `agent_publisher_authorizations` arm is not consulted — it is raw-matched with no canonical column, so its rows can only be found by the exact spelling the caller already has. agents.html splits the directory call out of the renderer into `fetchPublisherRecords`, asks once per declared spelling, and merges by publisher_domain with `authorized` beating `revoked`. A 404 for one spelling is an empty page, not an error — with several spellings it is the normal answer for all but one. The same split applies to the listing's own property enrichment: `getPropertiesForAgent` and `getPublisherDomainsForAgent` are spec-exact reads too, so a slash-declared agent showed no properties either. Both now run per declared spelling and merge. Single-spelling agents — nearly all of them — make exactly the same calls as before. `/publishers` itself is unchanged and stays spec-exact. Refs #7830, #7829. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, additive follow-up to #8312/#8314.
Adds declared_urls[] to GET /api/registry/agents so a consumer holding only the folded identity URL can query the spec-exact directory for every spelling a publisher declared, closing the zero-publisher rendering hole for slash-declared agents.
Checks performed:
- schema↔docs↔types↔OpenAPI coherence verified (registry.ts:1138, registry.yaml:543, types.ts:171/1263, docs/aao/directory-api.mdx:9) — same field, listed-url-first, optional.
bulkDeclaredAgentUrlsreadsv_effective_agent_authorizations(columns confirmed present in migration 625), excludes the*sentinel, and is wrapped in try/catch with a warn fallback that never fails the listing (registry-api.ts:6880).declared_urlsattached before the unenriched early-return, present in both response shapes.- Enrichment fans out per spelling and dedups; single-spelling agents make exactly the prior calls (registry-api.ts:7020).
- Integration test pins the server half end to end (registryAgentUrlKey assertion + folded-404/slashed-200 case).
- No changeset required: platform/registry-API surface, not AdCP protocol schemas under static/schemas/source/**.
Decision table: no critical/high/medium findings; gated_paths false; high_risk is true only via a (modified) route file but with no medium-or-higher finding, so row 5 does not fire; no deletions; no team gate. Falls through to row 9 → approve. (review_decision REVIEW_REQUIRED does not block since gated_paths is false and no prose hard gate applies — this is a platform API change, not a breaking protocol change.)
The registry's agent_url documentation changed upstream (adcontextprotocol/adcp#8316), so the generated-files check failed on any branch. This regenerates the two files with npm run generate-registry-types -- --sync. No hand edits.
…web-bot-auth (#3337) * test(identity): add a Web Bot Auth interop adapter and CI lane Add test/wba-interop/adapter.cjs, which speaks the four-operation JSON protocol of the adcp repository's Web Bot Auth harness (tests/wba-interop/): sign_request, sign_directory, verify_request, and verify_directory. It calls only the SDK's public entry points in the built dist/, so the harness grades the SDK against Cloudflare's web-bot-auth as a consumer would use it. The wba-interop CI job checks out the harness and the wba-profile vectors sparsely at a pinned adcp commit, installs the harness's pinned judge, and runs the harness against the adapter with the library-build output. ADCP_REF is a placeholder until the harness merges. A unit test runs the adapter one process per operation, as the harness does, so the adapter cannot drift from the SDK's API. * fix(identity): read only the web-bot-auth signature in a request verifyWebBotAuth refused any request whose Signature-Input or Signature field had more than one member, whatever the tags. WBA section 5.2.2 lets a request carry more than one signature, and the profile's verification step reads only the member tagged web-bot-auth. A CDN that adds its own signature with another tag therefore broke verification. Select the one member tagged web-bot-auth and do not read the others. A second web-bot-auth member, or a second Signature-Agent member, is still a 403. This is scenario R20 in the reference-library matrix, which Cloudflare's verify accepts when the caller passes the label. * fix(identity): ignore key-directory keys the profile cannot use verifyKeyDirectory refused a whole directory when any key had a type the profile cannot use, such as a P-256 key. WBA section 5.5.1 lets a directory list keys of any registered algorithm, Appendix B.1 asks every key to sign, and RFC 7517 section 5 says that a verifier should ignore keys it does not understand. Skip such keys and any signature they made. Every usable key must still sign the directory, and a directory with no usable key is a discovery failure. This is scenario D07 in the reference-library matrix, which Cloudflare's reference accepts. * test(identity): pin the key-directory media type rule WBA section 5.5.1 says that a key directory MUST be served as application/http-message-signatures-directory+json. The SDK refuses any other media type, but no test covered the rule, and the Go and Python SDKs accept application/json. This is scenario D08 in the reference-library matrix. Accept the directory media type with or without parameters, and refuse application/json, application/jwk-set+json, and text/plain. * feat(identity)!: restrict Web Bot Auth to Ed25519 The profile now takes Ed25519 only, as Cloudflare's edge, its Rust crate, and its directory CLI do. Cloudflare's npm verifier imports an RSA key only when the JWK carries alg PS512, which no SDK-published directory did, so SDK-signed RSA requests never verified there. Remove RSA-PSS-SHA512 from request signing and verification, from key-directory publishing and verification, and from origin revocation lists, which are signed and verified as EdDSA only. A request with alg="rsa-pss-sha512" is a 403, and a verifier ignores an RSA key in a directory as it ignores any key the profile cannot use. Remove the rsa-pss-sha512 branches from the signing crypto helpers, which only Web Bot Auth used. ES256 and Ed25519 on the AdCP RFC 9421 profile are unchanged. BREAKING CHANGE: the experimental @adcp/sdk/identity-3.3 surface refuses RSA keys for Web Bot Auth signing, directories, and revocation lists, and verifySignature and verifySignatureAsync from @adcp/sdk/signing/server no longer verify rsa-pss-sha512. * test(identity): drop governance/ from the vendored wba-profile vectors adcontextprotocol/adcp#7894 drops the governance-token checks and the governance/ vectors from the WBA profile. Governance moves to the AdCP layer under a separate R4 erratum, which moves JWS artifacts, governance included, to the identity's WBA key directory in 3.3. The SDK vendored the three governance vectors at e24eeb09 and recorded them as non-applicable. Remove governance/ from test/fixtures/wba-profile/, and record the exclusion in PINNED.json in place of the non_applicable list. The vendored README.md stays byte-identical to the pinned sha. The guard test derives the vendored directories from the tree, so a governance/ directory that returns fails it. The SDK's governance code is unchanged. * refactor(identity): enforce the EdDSA-only revocation rule through jose A revocation list is signed by an Ed25519 key in the origin's directory, so its protected header must say alg EdDSA. OriginRevocationResolver checked header.alg by hand before verifying. Remove that check: jose's compactVerify refuses any other alg through algorithms: ['EdDSA'], and importJWK imports the directory key as EdDSA only. The test forges lists signed with the Ed25519 key under headers that claim PS512 and ES256. Neither verifies, and the origin's status is unknown, so spend fails closed. The EdDSA control list verifies. jose also refuses an Ed25519 key under PS512 or ES256 by its type, so the test passes without the algorithms option too. * test(identity): pin member-shape checks under every signature label Cloudflare's http-message-sig parses Signature-Input and Signature strictly before it selects a label: a member of the wrong shape under any label is MalformedField, even when the caller names the web-bot-auth label. The SDK answers the same request with 400. Pin that behavior next to R20. A well-formed member with another tag is not read and the request verifies. A Signature member that is a token or an inner list, or a Signature-Input member that is not an inner list, under another label is a 400. The web-bot-auth member's own shape is checked too. * fix(identity): refuse a Signature-Agent that is not an exact https origin receivedAgentOrigin compared the member value with its canonical origin, but canonicalAgentOrigin accepts http as well as https, so an http:// Signature-Agent passed the check. The request was refused only because the directory fetch for that origin then failed, after the verifier had tried to reach it. WBA section 5.2.1 says that the member's scheme MUST be https. Require the value to start with https:// before the exact-string comparison. Any value that is not exactly the canonical https origin string, compared as received, is a 403 agent_origin before any directory fetch: http, a path including a trailing /, a query, a fragment, userinfo, an uppercase host, or the default port :443. The test asserts the reason and that nothing was fetched, and keeps rule 4: a member keyed differently from the signature's label is a 403 (R19). * fix(identity): accept the Signature-Agent type parameter as a Token WBA draft -00 section 5.2.1 defines the Signature-Agent type parameter as a Token Item, so the draft's own example is ;type=jwks_uri, and a directory member is ;type=directory or carries no type. The verifier compared the parameter with the string "directory", so it refused the Token form (403 agent_type) and accepted only ;type="directory". Read the parameter's value as a string, as Cloudflare's parseSignatureAgentHeader does: ;type=directory and ;type="directory" are both accepted, and any other type (jwks_uri, cimd) is still ignored, which leaves no member to resolve (403). * test(identity): re-vendor the wba-profile vectors from #7894 at 49b3a315 Re-vendor static/compliance/source/test-vectors/wba-profile from adcontextprotocol/adcp#7894 at 49b3a3157e55a7ec37816908ec28a2e25057fd89, byte for byte. The head has no governance/ directory, so PINNED.json drops its excluded entry and vendors every file under the path. The directory gains scenarios.json, which the interop harness (adcontextprotocol/adcp#8298) grades through test/wba-interop/adapter.cjs. The positive and negative vectors grade as before: every request and directory vector gives its expected outcome. Update the pinned sha in the guard test, the migration doc's pin table, and the two source headers. * ci: pin the Web Bot Auth interop harness to adcontextprotocol/adcp#8298 Set ADCP_REF to a7708e41fbcf0da84273a988c519b25a14b41dbc, the head of adcontextprotocol/adcp#8298. That commit adds tests/wba-interop/ on top of the #7894 profile, and its wba-profile vectors and scenarios.json match the vendored copy at 49b3a315; only the README differs. * ci: audit the wba-interop job as a library artifact consumer test/ci-artifact-reuse.test.js lists every job that downloads the library-build artifact and checks that each one verifies the archive before using it. The wba-interop job downloads the artifact, but the list did not name it, so the test failed in the generated-checks and unit-tests-fast jobs, and the unit-tests and test aggregators failed with them. Add wba-interop to the list. The job already meets every rule the test checks: it needs only library-build, has no if condition, does not rebuild, and runs the shared download and verify steps. * test(identity): re-vendor the wba-profile vectors from #7894 at 2546cf5f adcontextprotocol/adcp#7894 moved from 49b3a315 to 2546cf5f449d6f30f2f4ff5fb27433ddf3986167. The new commit states that a verifier accepts the Signature-Agent type parameter as a Token or as a String, and adds two scenarios to scenarios.json: R18c (type=directory) and R18d (type="directory"). Both expect the request to verify. No other file under the vectors path changed. Re-vendor the path at that sha, byte for byte, and update the pinned sha in PINNED.json, the guard test, the migration doc's pin table, and the two source headers. adcontextprotocol/adcp#8298 was rebased onto the new #7894 head, which left a7708e41 off its branch, so a fetch by that sha can fail. Set ADCP_REF to 6bf069b61f8bb921983b6fbabd2cfce0962fefb8, the new head. Its wba-profile vectors and scenarios.json match the vendored copy; only the README differs. * docs(identity): name the public signing helpers in the changeset The changeset said the changes affect the experimental @adcp/sdk/identity-3.3 surface only. The removal of rsa-pss-sha512 from signing/crypto.ts also changes verifySignature and verifySignatureAsync, which @adcp/sdk/signing/server exports, so a caller of those helpers would not learn from the release notes that RSA-PSS no longer verifies. Name both helpers in the summary and in the Ed25519 entry, and give the reason: the AdCP RFC 9421 profile allows only ed25519 and ecdsa-p256-sha256 (security.mdx, the alg rows for request and webhook signing). Also say which directory used to be refused, in place of "such a directory". * docs(identity): state the Signature-Agent type rule in the migration guide The changeset describes the Token fix for the Signature-Agent type parameter, but the migration guide did not. Say that the verifier accepts type=directory as a Token or as a String, and that a member of any other type leaves no member to resolve (403). * fix(identity): refuse a key directory that publishes private key material verifyKeyDirectory skipped a key the profile cannot use before it checked the key for private members, so a directory that published a P-256 or RSA private key (with d) verified, and the leak went unreported. Before keys the profile cannot use were ignored, such a directory was refused. Check every key for d and _private members before the unusable-key skip, so published private material refuses the directory (directory_key) whatever the key type. A test serves a directory with an extra P-256 key that carries d, signed and unsigned, and one with an RSA key that carries d, and expects each to be refused, as an Ed25519 key with d already was. The changeset and the migration guide state the rule. * fix(identity): refuse a key directory that publishes any private JWK member The private-material check read only d and _private members, so a directory key that carried another private member (an RSA p, q, dp, dq, qi, or oth, or an oct k) verified, and an unusable key carrying one was ignored. Refuse a directory in which any key carries a member that RFC 7518 section 6 or RFC 8037 defines as private: d, p, q, dp, dq, qi, oth, or k. The check runs before keys the profile cannot use are skipped. The test serves each member on its own, besides Ed25519, P-256, and RSA keys that carry d, and expects 403 directory_key for every case. The changeset lists the members. * fix(identity): match private JWK member names case-insensitively The private-member check compared names exactly, so a directory key that published its private scalar as D (or an RSA P, or an oct K) passed it. The Go and Python SDKs and the profile refuse those names in any case. Lowercase each member name before comparing it with d, p, q, dp, dq, qi, oth, and k, and keep the _private prefix check. The test adds an Ed25519 signing key and an extra P-256 key that carry D, an RSA key that carries only P, and an oct key with K, and expects 403 directory_key for each. * test(identity): re-vendor the wba-profile vectors from #7894 at f311e1b5 adcontextprotocol/adcp#7894 moved from 2546cf5f to f311e1b567c55c1d0689b2b7fd9b4a35e9ba91fe. Under the vectors path only the README and scenarios.json changed. scenarios.json gains nine scenarios: R19b, R21b, D09 to D13, and D14 and D14b, which refuse a directory in which a key carries a private member, an extra P-256 key with d (D14) or the signing Ed25519 key with d (D14b). Re-vendor the path at that sha, byte for byte, and update the pinned sha in PINNED.json, the guard test, the migration doc's pin table, and the two source headers. Set ADCP_REF to ef966de19affc8b36a28f2fbc7c508050ce92d7b, the head of adcontextprotocol/adcp#8298, which carries the same scenarios.json; only its README differs. * fix(identity): refuse a non-https Web Bot Auth signing origin canonicalAgentOrigin lowercases an https origin and drops its default port, but passes http://localhost:3000 through unchanged. signWebBotAuth then sent Signature-Agent: sig1="http://localhost:3000", which the verifier answers with 403 agent_origin before any fetch, so an http setup failed on its first request instead of when it was wired up. WBA -00 section 5.2.1 requires https, and #7894 says a signer sends the canonical origin. signWebBotAuth, createSignedSignatureDirectory and createWebBotAuthFetch pass the canonical origin through receivedAgentOrigin, the verifier's own rule, and throw a TypeError when it refuses it. createWebBotAuthFetch checks the origin when it is created. There is no http opt-in. The changeset and the migration guide say so. * test(identity): let the interop adapter crash on errors that are not verification refusals The adapter wrote { ok: false } for any exception, with status 0 when the error had none. A TypeError from the SDK, an unknown operation or a malformed operation was then reported as a refusal, and the harness could grade an SDK bug as the expected 403. The harness protocol says an adapter writes a refusal only for the implementation's own verification refusals, and any other error crashes it. The adapter now writes a refusal only for a WebBotAuthError, with its status and reason. Anything else, a WebBotAuthUnavailableError included, propagates: the adapter prints it to standard error, writes nothing to standard output, and exits 1. The adapter test checks a 403 refusal and three crashes: an unknown operation, a signer that refuses an http origin, and a verify_request with no request. The harness at ef966de1 still passes 63 of 63, and at ac2b3ffa 64 of 64. * docs(identity): say that verifySignature no longer verifies rsa-pss-sha512 verifySignature and verifySignatureAsync are exported from @adcp/sdk/signing/server, which is not an experimental entry point, and they no longer verify rsa-pss-sha512. The changeset said so, and the migration guide did not. The guide now states the change, that both helpers return false for that algorithm, and what a caller that relied on it does instead. * ci: run the Web Bot Auth interop job on Node 24 tests/wba-interop/package.json in the harness declares engines node >=24 <25, and the wba-interop job ran on Node 20. It passed there, but the SDK was graded on a Node version the harness does not declare. The job now sets up Node 24.x, as the changesets lane does. * docs(identity): say which directory still gets directory_unsupported_key The changeset said that a directory listing a P-256 key used to be refused with directory_unsupported_key, which reads as if the reason were gone. verifyKeyDirectory still reports it for an Ed25519 entry with no x, because jwkThumbprint refuses that entry. The changeset now says so. * test(identity): pin the Web Bot Auth harness and vectors to the final #8298 and #7894 heads adcontextprotocol/adcp#7894 moved from f311e1b5 to e59294701d733b0ea2a004a2f0c091c8eccdcaae. Under the vectors path only scenarios.json changed: it gains D14c, an extra P-256 key that carries its private scalar as an upper-case D. Re-vendor the path at that sha, byte for byte, and update the pinned sha in PINNED.json, the guard test, the migration doc's pin table, and the two source headers. Set ADCP_REF to 306cdfa6e565725e1a122838eafbcc980707306b, the head of adcontextprotocol/adcp#8298, which grades an adapter crash as a failure. Its vectors match the vendored copy except for the README. The harness at that commit passes 64 of 64 against this branch, with no adapter crashes. * chore(registry): sync registry types with the live registry OpenAPI The registry's agent_url documentation changed upstream (adcontextprotocol/adcp#8316), so the generated-files check failed on any branch. This regenerates the two files with npm run generate-registry-types -- --sync. No hand edits. --------- Co-authored-by: Brian O'Kelley <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Problem
Two rules that are each correct left a hole between them.
https://a.example/mcpandhttps://a.example/mcp/are one agent (Registry agent_url canonical key diverges from AdCP URL canonicalization #7830).non-root trailing slash significant (fix(validator): match adagents agent URLs with spec canonicalization #7829, fix(registry): match agent_url spec-exactly on the directory inverse-lookup #8314).
server/public/agents.htmlaskedGET /v1/agents/${agent.url}/publisherswith the listed — folded — URL. For an agent whose publishers declared it as
/mcp/, that asks about a spelling no publisher ever wrote, so the pagerendered "No indexed publisher authorizations are available for this agent
yet" for an agent that is in fact authorized. This is the gap flagged in
#8314.
The same defect hit the listing's own property enrichment:
getPropertiesForAgentandgetPublisherDomainsForAgentare spec-exactreads too, so the same agent also showed no properties and no publisher
domains.
Fix
Server:
declared_urls[]on the agents listingGET /api/registry/agentsnow returns, per agent:Composed from: the listed URL, the owner's registered spelling
(
AgentConfig.declared_url, already stored by #8249, now surfaced onFederatedAgent), and every rawagent_urlthe directory has indexed underthat identity. The last comes from a new
FederatedIndexDatabase.bulkDeclaredAgentUrls— one indexed query overv_effective_agent_authorizationsfor the whole page, wildcard sentinelexcluded. If it throws, the listing logs and falls back to the identity URL,
i.e. exactly today's behavior; it never fails the page.
The legacy
agent_publisher_authorizationsarm is deliberately notconsulted: it is raw-matched (#3177) with no canonical column, so its rows
can only be found by the exact spelling the caller already has.
Page: ask per spelling, merge
The directory call moves out of the renderer into
fetchPublisherRecords,which asks once per declared spelling and merges by
publisher_domain:authorizedbeatsrevoked— if any spelling the publisher declared isstill authorized, the agent is authorized there;
404for one spelling is an empty page, not an error — with severalspellings that is the normal answer for all but one;
empty publisher set;
declared_urls(older cached response) it asks once withagent.url— identical to the old behavior.Listing property enrichment
getPropertiesForAgent/getPublisherDomainsForAgentnow run per declaredspelling and merge (properties deduped by
property_id, domains by value).Single-spelling agents — nearly all of them — make exactly the same two
calls as before.
/publishersitself is unchanged and stays spec-exact.Tests
server/tests/integration/registry-agents-declared-urls.test.ts(6cases, new) — a member registers the slashed spelling, a publisher's
adagents.json declares the same, and one property hangs off it:
declared_urlsreports both spellings, listed URL first, deduped;/publisherswhile the slashed one returns thepublisher — the end-to-end reason the list is needed;
declared_urlsis[PUB].4 of the 6 fail with the server change reverted.
server/tests/unit/public-agent-registry-ui.test.ts— four new casesdriving the extracted
fetchPublisherRecordsagainst a mockedfetch:queries every declared spelling, merges preferring
authorizedoverrevokedand propagating truncation, falls back to the listed URL alone,and surfaces a directory error instead of reporting an empty set. The two
existing assertions that pinned the old single-call fetch string were
updated.
Adjacent suites re-run green:
registry-reader-baseline-public-endpoints,agent-visibility-e2e,registry-directory-spec-exact,registry-directory-publishers-spec-exact,registry-identity-route-keying,registry-api-agent-publishers.Docs / spec surface
static/openapi/registry.yamlregenerated —declared_urlsdocumented onFederatedAgentWithDetails, including why a consumer needs it.docs/aao/directory-api.mdx— a short pointer under the 2026-10-18behavior note telling clients that hold only an identity URL where to get
the spellings and to merge per spelling.
No changeset:
scripts/check-changeset-protocol-scope.cjsexcludesstatic/openapi/registry.yamlanddocs/aao/from the protocol surface.Refs #7830, #7829.
🤖 Generated with Claude Code
Open workspace in Conductor