Repository navigation
spec: brand_url on get_adcp_capabilities for keys-from-agent-URL discovery - #3690
Conversation
…overy Proposes a top-level brand_url field on get_adcp_capabilities so verifiers can bootstrap from an agent URL to the operator's brand.json (and from there to signing keys) without out-of-band knowledge of the operator domain. Keeps brand.json operator-attested as the trust root — no jwks_uri added to capabilities. Verifier algorithm pins agent URL eTLD+1 to brand_url eTLD+1 (with authorized_operators[] opt-in for SaaS-platform operators), enforces mandatory identity.key_origins consistency for every declared signing purpose, and joins the existing request_signature_* error-code family. Includes a self-hostable AAO reference resolver (/api/registry/agents/resolve, /api/registry/agents/jwks) framed as a convenience layer not a trust anchor — separate hostname for the JWKS endpoint, no stale-while-revalidate on JWKS, native resolution shown first in caller integration, SDKs default to mode="native". Spec only — no protocol changes ship in this PR. Reviewed by ad-tech protocol, security, ad-tech product, and DX experts; their material feedback is itemized in the spec's "Reviewer feedback addressed" section. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Addresses @BaiyuScope3 review on PR #3690 — JWK examples were missing the RFC 7517 `use` field. Added `use: "sig"` to both example JWKs in the resolver responses and made it normative: every signing JWK MUST declare `use: "sig"` for JOSE-library pre-filtering, with the AdCP-specific purpose granularity riding on `adcp_use`. Verifiers MUST enforce both. Also clarified that `key_ops` MUST NOT be used together with `use` per RFC 7517 §4.3 — AdCP standardizes on `use` for cross-library compat. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Spec changes (round 2): - Reverted "MUST NOT use key_ops with use" (security.mdx:780 requires the AdCP four-tuple: use:"sig", key_ops:["verify"], adcp_use, distinct kid). JWK examples now match the canonical shape from security.mdx:840. - Tightened required-when on identity.key_origins to supported_for[]/ required_for[] non-empty (a no-op declaration with empty arrays shouldn't drag in key_origins). - Step 7 consistency check now skips purposes whose JWKS source was a publisher adagents.json signing_keys pin — the pin is an intentional override and may legitimately point at a different host. - Tightened loose SHOULDs to MUSTs (production verifiers MUST use native resolution; verifiers MUST honor upstream Cache-Control). - Dropped /.well-known/adcp-jwks.json shortcut (re-introduced M3-prime self-attestation without saving fetches on the trust-required path). - Expanded SSRF list: pinned PSL snapshot, IPv6 ULA, IPv4-mapped IPv6, AWS/GCP/Azure metadata IPs, bracketed-IPv6 zone-ID handling, DNS-rebinding ordering, agent_url 2KB cap, per-caller < per-host rate. - AAO resolver MUST itself enforce required-when (storyboard alone is insufficient because mode:"aao" callers would lose H2 protection). - Added trace[] array + freshness aggregate to /resolve response. - Added new error code request_signature_key_origin_missing. AAO resolver implementation: - server/src/registry/agent-resolver/ with 10 modules: orchestrator, capabilities-fetcher (via SingleAgentClient.getAdcpCapabilities), brand-json-fetcher, jwks-fetcher (byte-for-byte Cache-Control propagation, no SWR), consistency (eTLD+1 binding, key_origins check, agent-not-in-brand-json), breadcrumb builder, TTL cache + per-host token-bucket rate limiter, SSRF-strict fetch wrapper around safeFetch, typed error class, algorithms allowlist. - Routes /api/registry/agents/resolve and /api/registry/agents/jwks wired in server/src/routes/registry-api.ts with OpenAPI registerPath declarations + static/openapi/registry.yaml entries. - JWKS endpoint preserves RFC 7517 purity in the body; trace surfaced via X-AAO-Trace-URL header pointing at the resolve endpoint. - 63 tests passing: 29 consistency + 10 cache + 13 safe-fetch-strict + 11 integration (in-process express + jose-generated Ed25519 keypair, JOSE round-trip verifying a token signed with the fixture key). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Round 2: spec rewrite + AAO resolver buildPushed two follow-ups to this PR: Spec — round 2 fixes addressing fresh expert reviewsMaterial changes (full list in the spec's "Reviewer feedback addressed → Round 2" section):
AAO resolver — full implementation + testsBuilt the hosted resolver end-to-end so an agent URL like curl "https://agenticadvertising.org/api/registry/agents/resolve?agent_url=https://buyer.example.com/mcp" \
| jq '{freshness, trace: [.trace[] | {step, status, age: .age_seconds, fetched_at, ok}]}'Output: {
"freshness": "fresh",
"trace": [
{ "step": "capabilities", "status": 200, "age": 0, "fetched_at": "2026-04-30T12:00:00Z", "ok": true },
{ "step": "brand_json", "status": 200, "age": 12, "fetched_at": "2026-04-30T11:59:48Z", "ok": true },
{ "step": "jwks", "status": 200, "age": 287, "fetched_at": "2026-04-30T11:55:13Z", "ok": true }
]
}Files added (10 resolver modules + 4 test files):
Files modified: Test results: 63/63 passing.
Round-2 reviewers: ad-tech-protocol, security, javascript-protocol, DX. Their material feedback is itemized in the spec's "Reviewer feedback addressed → Round 2" section. Spec doc + implementation + tests all in this PR. Commits: |
…afeFetch CodeQL traces user-provided URLs (e.g., the resolver's agent_url query param) through to the fetch() calls inside safeFetch and flags them as SSRF, but safeFetch is the function that validates URLs and pins SSRF-safe dispatch. validateFetchUrl rejects private IPs pre-flight, buildSsrfSafeDispatcher's lookup callback rejects them at TCP connect time, redirects re-run validation per hop. Same suppression pattern as the existing axios.get callers in adagents-manager.ts and brand-manager.ts. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Round-3 pivot driven by CodeQL flagging the hosted resolver's fetch path
and a fundamental reconsideration: a centralized fetcher of
caller-supplied URLs is the wrong shape for the registry. SSRF
amplification on AAO infrastructure, centralized cache as a single
poisoning point, and "convenience layer that's not a trust anchor"
still drags AAO into JOSE-naive verifiers' trust chains in practice.
Per-process SDK resolution is what the spec already required for
production verifiers; this round commits to it as the only path.
Spec changes:
- Replaced §"Hosted resolver (AAO Registry API)" with §"Client SDK + CLI"
describing resolveAgent / getAgentJwks / createAgentJwksSet in
@adcp/client (TS) and adcp (Python), plus npx @adcp/client resolve
<url> CLI for instant-answer UX.
- Scrubbed AAO-specific surface (aao_signed, X-AAO-* headers,
cache_until, source: live|cached envelope, separate-hostname
requirement, mode="aao" SDK option). Trace[]/freshness now ride on
the SDK return value.
- SSRF list reframed for SDK posture: kept IP blocks (cloud-metadata
IPs still matter for SDK callers running in cloud workloads),
dropped per-caller-IP rate limit, reframed per-host rate as
politeness-not-amplification.
- Documented in-browser playground as the right shape for
"I have an agent URL, show me its keys" without server-side fetch.
Added open question on operator CORS for brand.json/JWKS.
- Rollout: dropped PR 4 (hosted resolver). Implementation lands in
PR 3 (@adcp/client + Python SDK + CLI). Optional follow-up PR for
the browser playground.
Implementation removed:
- server/src/registry/agent-resolver/ (10 modules)
- server/tests/{unit,integration}/agent-resolver*.test.ts (4 files)
- Two route handlers in server/src/routes/registry-api.ts
- registerPath blocks for both endpoints
- Agent Resolution entries in static/openapi/registry.yaml + the tag
- .changeset/aao-agent-resolver-impl.md
The pure-function modules (consistency, breadcrumb, cache, algorithms,
SSRF-strict fetch wrapper) are the right starting point for the
@adcp/client port; that work happens in a follow-up PR on the
adcp-client repo.
CodeQL suppression on safeFetch kept — documents the existing axios.get
callers' established pattern and stays correct independent of the
resolver routes.
Server unit suite: 2930/2930 passing. Typecheck clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Round 3: dropped hosted AAO resolver, reframed as
|
The // lgtm[js/request-forgery] suppressions don't actually suppress in GitHub's CodeQL (LGTM was retired); they only shifted the bytes on the flagged lines, which made the PR's CodeQL check re-detect known alert #1316 (already open on main) as "new in this PR". Reverting makes url-security.ts match main byte-for-byte. The pre-existing SSRF false-positive remains tracked as alert #1316 on main and should be dismissed in the security UI as a false positive (validateFetchUrl + SSRF-safe dispatcher with private-IP rejection at connect time). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…URL discovery Adds the top-level `brand_url` field on `get_adcp_capabilities` so verifiers can bootstrap from an agent URL to that agent's signing keys without out-of-band knowledge of the operator domain. Closes the discovery gap in the request-signing chain — capabilities → brand_url → brand.json → agents[] → jwks_uri → JWKS. Schema (static/schemas/source/protocol/get-adcp-capabilities-response.json): - New top-level `brand_url` (HTTPS URI). - Schema-optional in 3.x; storyboard-enforced when the agent declares any signing posture (`request_signing.supported_for`/`required_for` non-empty, `webhook_signing.supported === true`, or any field under `identity.key_origins`). Becomes schema-required in 4.0. - Distinct from existing `sponsored_intelligence.brand_url`, which remains a rendering pointer for SI agent visuals. Security (docs/building/implementation/security.mdx): - New §"Discovering an agent's signing keys via brand_url" with the 8-step verifier algorithm: eTLD+1 origin binding (closes shared- tenancy spoofing), `authorized_operators[]` opt-in for SaaS-platform- as-operator, byte-equal agents[].url match, mandatory key_origins consistency check (purpose-generic, with sell-side webhook carve-out for adagents.json signing_keys pin), default jwks_uri at agent origin. - Eight new request_signature_* rejection codes with detail fields: brand_url_missing, capabilities_unreachable, brand_json_unreachable, brand_origin_mismatch, agent_not_in_brand_json, brand_json_ambiguous, key_origin_mismatch, key_origin_missing. - Trust-root distinction documented: brand.json operator-attested, adagents.json publisher-attested, agent never self-attests. - Existing JWKS-discovery prose now points at the new section. Backwards compatibility: strictly additive. Verifiers that ignore brand_url continue to work. The full design (with reviewer history, multi-tenant operator handling, SDK + CLI integration, and rejected alternatives) is in specs/capabilities-brand-url.md. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Round 4: spec → actual protocol workPushed real schema + docs changes in commit `4a7aa5df5`. PR is no longer spec-only — it ships a wire-format change. Schema change
Security docs
ChangesetBumped from empty (no-op spec note) to `adcontextprotocol: minor` — strictly additive schema change. Backwards compatibilityVerifiers that ignore `brand_url` continue to work. Sellers gain an enforceable on-wire trust-root pointer; buyers gain a way to bootstrap signature verification from an agent URL without out-of-band onboarding. Validation
The full design — reviewer history, multi-tenant operator handling, @adcp/client SDK + CLI integration, and the rejected hosted-AAO-resolver alternative — stays in |
Round-2 expert review on the actual schema diff (commit 4a7aa5d) flagged several correctness/security/clarity items in security.mdx and the schema description. This commit addresses Tier 1 (correctness + security) and Tier 2 (clarity) items inline: Correctness / security: - Heading depth: §"Discovering an agent's signing keys" promoted from ##### to #### so it's a sibling of §Agent key publication / §Agent identity / §Verifier checklist (not orphaned under Agent key publication). - Step 1: capabilities fetch MUST go through SSRF validation and HTTPS enforcement at the verifier level (not just schema-level). - Step 2: 3.x→4.0 transition qualified by `supported_versions` containing any 4.x release — a 4.0 verifier talking to a 3.x-only agent MUST continue to accept absent brand_url. - Step 3: explicit pinned PSL snapshot requirement with publicsuffix.org pointer; ICANN+PRIVATE sections both in scope so platforms like vercel.app are treated as suffixes. Two verifiers on different snapshots are non-conformant. - Step 4: brand.json fetch MUST NOT follow redirects (the single-redirect carve-out for authoritative_location is scoped to that field and MUST NOT be inherited). Connect/total/body-cap budgets stated. Cache TTL MUST be bounded above by JWKS revocation polling. Negative-cache MUST NOT exceed 60s. - Step 6/7: publisher-pin carve-out is per-(agent, purpose, role) tuple, not per-purpose globally. Operator-side use of the same purpose still enforced. Closes the operator-side substitution vector. - SI dual brand_url: explicit MUST rule — verifiers MUST use top-level brand_url for key discovery, MUST NOT use sponsored_intelligence. brand_url as a trust-root pointer. - Verifier checklist step 7: explicit cross-reference to the discovery preamble as a precondition for keyid resolution. Implementers reading the checklist alone won't miss the discovery chain. Clarity: - Schema description: trimmed; constraints moved to security.mdx with an explicit anchor URL (not a bare § reference). Includes the 4.x required-when qualifier and the SI MUST rule. - Step 5: trailing-slash / scheme-mismatch / IDN-punycode common-cause hint on agent_not_in_brand_json (the most common integrator failure). - Detail field HTML-escape note for counterparty-sourced strings (brand_url, matched_entries[]). - Error-code table: added Remediation column. Ops can act on each code without reading prose. Validation: build:schemas, test:schemas (7), test:json-schema (255), test:composed (32) all pass. Reviewed by ad-tech-protocol, security, docs, and dx experts on commit 4a7aa5d. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…idation Round-3 expert review settled on three structural improvements: 1. **Move into `identity` block.** brand_url was at the top level of get_adcp_capabilities; it's now `identity.brand_json_url`, co-located with `key_origins`, `per_principal_key_isolation`, and `compromise_notification` — the trust-posture fields it's load-bearing for. The required-when contract reads naturally now: "if any other identity field is set, brand_json_url MUST be set." 2. **Rename `brand_url` → `brand_json_url`.** The naming distinguishes from `sponsored_intelligence.brand_url` semantically: `brand_url` is reserved for "the brand being advertised" contexts (which SI's field is); `brand_json_url` names the file artifact (the operator's brand.json), independent of whether the operator is a single brand, a house, an agency, or a pure operator record. Defuses the name-collision footgun that needed a MUST rule before. 3. **Lift constraints into x-adcp-validation extension.** Required-when rules, verifier constraints, and distinct-from relationships now live in a structured `x-adcp-validation` keyword on the field. The storyboard runner and SDK validators consume the rules programmatically; codegen consumers get a tight 2-sentence JSDoc instead of a 350-word wall of text. JSON Schema validators ignore unknown `x-` keys per draft-07. Schema: - `identity.brand_json_url` added inside the existing `identity` block with the `x-adcp-validation` extension carrying the structured required-when rules and verifier constraints. - Top-level `brand_url` removed. Security.mdx: - §"Discovering an agent's signing keys via brand_json_url" — heading and prose updated for the new field name and path. - New §"Quickstart: implement a brand_json_url-based verifier" mirroring §"Quickstart: opt into request signing" — 8 numbered steps + 30-line TypeScript pseudocode block. Validates against compliance fixture brand.json + JWKS. - New §"Reference implementations" naming @adcp/client (TS), adcp (Python), adcp-go (Go) with their resolveAgent/getAgentJwks/ verify_request_signature signatures and per-SDK CLI commands. - Error-code names updated: request_signature_brand_json_url_missing (was brand_url_missing); detail field brand_url_etld1 → brand_json_url_etld1. New docs/reference/schema-extensions.mdx: - Canonical reference for AdCP's x-prefixed schema annotations. - Documents the existing x-status convention plus the new x-adcp-validation keyword (sub-keys, conformance rules, current usage). - Wired into docs.json sidebar in two places. Spec doc: - Go SDK signatures added to §SDK API (resolver.ResolveAgent, verify.RequestSignature, options shape). - CLI section names all three SDK CLIs (npx @adcp/client / python -m adcp / adcp-go) with identical output format. Validation: build:schemas, test:schemas (7), test:json-schema (255), test:composed (32) all pass. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Round 4: structural improvements + SDK port issues filedPushed in commit `83e267094`. Three structural changes plus the schema-extensions doc, quickstart, SDK references, and Go signatures. 1. Field placement: top-level →
|
Summary (final)
Adds
identity.brand_json_urltoget_adcp_capabilities— capabilities-level pointer to the operator'sbrand.jsonso verifiers can bootstrap from an agent URL to that agent's signing keys without out-of-band knowledge of the operator domain. Closes the discovery gap in the request-signing chain: capabilities →identity.brand_json_url→brand.json→agents[]→jwks_uri→ JWKS.Strictly additive. Verifiers that ignore the field continue to work. Schema-required in 4.0 only when
supported_versionsincludes a 4.x release. 3.0-pinned implementers can adopt the field today without bumping (forward-compat note in security.mdx + changeset).What's in this PR
get-adcp-capabilities-response.json)identity.brand_json_urlfield. Constraints expressed via newx-adcp-validationextension keyword.identity.additionalProperties: trueso future fields don't break older validators.security.mdx)brand_json_url" — 8-step verifier algorithm (eTLD+1 origin binding via pinned PSL, byte-equalagents[]match, mandatorykey_originsconsistency check with sell-side webhook publisher-pin carve-out, no-redirect on brand.json fetch, named timeouts/body caps, strict-parse JSON). 9 newrequest_signature_*rejection codes with detail fields and remediation. Quickstart subsection mirroring §796 with 30-line TS pseudocode. Reference-implementation paragraph naming@adcp/client/adcp/adcp-gowith per-language signatures and CLIs. Forward-compat callout for 3.0 adopters.docs/reference/schema-extensions.mdx, new)x-prefixed annotations (x-status,x-adcp-validation). Wired into Mintlify sidebar.specs/capabilities-brand-url.md)adcontextprotocol: minor— generates the 3.x release-notes entry with the schema description, security additions, and the 3.0 forward-compat note.server/src/http.ts)/.well-known/brand.jsonnow lists the training agent inagents[]so the chain has a real terminus.scripts/e2e-resolve-training-agent.ts)--inprocmode (Express + jose Ed25519 fixture) or against a livehttp://endpoint. Output mirrors the CLI sketch in security.mdx §Quickstart.x-adcp-validationacross all schemas.What's deferred (with reason)
identity.brand_json_urlyet. The storyboard runner uses@adcp/sdk's pinnedADCP_VERSION='3.0.1'and validates capabilities responses against the published 3.0.1 schema (which doesn't have the field). Re-add the emit after 3.1 publishes and the SDK bumps. The brand.json wiring +--inproce2e prove the chain works end-to-end./api/registry/agents/resolveendpoint. Dropped in round 3 — centralized fetch of caller-supplied URLs is the wrong shape (SSRF amplification, centralized cache as poisoning point, AAO de facto in trust chain). Per-process SDK resolution is what the spec requires for production verifiers anyway. Full design history inspecs/capabilities-brand-url.md.Reviewer rounds
5 rounds of expert review (ad-tech protocol, security, DX, docs) addressed inline:
key_opsMUST-NOT was wrong (security.mdx:780 mandates the four-tuple); required-when onsupportedwas wrong cut (should besupported_for/required_for); sell-side webhook carve-out missing in step 7; loose SHOULDs tightened to MUSTs;.well-known/adcp-jwks.jsonshortcut dropped (re-introduced M3); SSRF list expanded with PSL pinning, IPv6 ULA, cloud-metadata IPs.@adcp/clientSDK + CLI; trace[]/freshness moved to SDK return value.identityblock, renamedbrand_url→brand_json_url(disambiguates fromsponsored_intelligence.brand_urlper "brand_url iff brand-being-advertised" rule); constraints lifted intox-adcp-validation; schema-extensions doc; quickstart added; SDK references; Go signatures.adcp resolvevia console_scripts); error-table retry timing + value examples;required_whenshape flattened to{ any_of: [...] };schema_required_whenregex; identity description rewritten to call out load-bearing nature.Adoption guidance for 3.0 implementers
The wire shape is forward-compatible. A 3.0 seller MAY populate
identity.brand_json_urltoday and a 3.x verifier picks it up automatically; a 3.0 verifier MAY read the field opportunistically and run the 8-step chain when present. No version bump required for either side. AdCP doesn't backport new schema fields to patch releases (3.0.x), but Scope3 and others building signature verification today can ship the field now and let the 3.x rollout happen passively. See security.mdx §Discovering an agent's signing keys.Test plan
npm run build:schemasnpm run test:schemas(7 passed)npm run test:json-schema(255 passed)npm run test:composed(32 passed)npm run test:schema-links--inprocresolves training agent end-to-end with valid trace + JWKS verification89c38e74cdeferred the training-agent emit)🤖 Generated with Claude Code