Skip to content

spec: brand_url on get_adcp_capabilities for keys-from-agent-URL discovery - #3690

Merged
bokelley merged 15 commits into
mainfrom
bokelley/capabilities-jwks-check
May 2, 2026
Merged

bokelley merged 15 commits into
mainfrom
bokelley/capabilities-jwks-check

Conversation

@bokelley

@bokelley bokelley commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary (final)

Adds identity.brand_json_url to get_adcp_capabilities — capabilities-level pointer to the operator's brand.json 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 → 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_versions includes 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

Surface Change
Schema (get-adcp-capabilities-response.json) New identity.brand_json_url field. Constraints expressed via new x-adcp-validation extension keyword. identity.additionalProperties: true so future fields don't break older validators.
Security profile (security.mdx) New §"Discovering an agent's signing keys via brand_json_url" — 8-step verifier algorithm (eTLD+1 origin binding via pinned PSL, byte-equal agents[] match, mandatory key_origins consistency check with sell-side webhook publisher-pin carve-out, no-redirect on brand.json fetch, named timeouts/body caps, strict-parse JSON). 9 new request_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-go with per-language signatures and CLIs. Forward-compat callout for 3.0 adopters.
Schema extensions doc (docs/reference/schema-extensions.mdx, new) Canonical reference for AdCP x- prefixed annotations (x-status, x-adcp-validation). Wired into Mintlify sidebar.
Spec doc (specs/capabilities-brand-url.md) Design archive with all reviewer rounds, multi-tenant operator handling, naming-convention discussion, SDK + CLI signatures (TS / Python / Go), rejected hosted-AAO-resolver alternative.
Changeset adcontextprotocol: minor — generates the 3.x release-notes entry with the schema description, security additions, and the 3.0 forward-compat note.
Brand.json wiring (server/src/http.ts) AdCP-domain /.well-known/brand.json now lists the training agent in agents[] so the chain has a real terminus.
E2E script (scripts/e2e-resolve-training-agent.ts) Runs the full 8-step chain in --inproc mode (Express + jose Ed25519 fixture) or against a live http:// endpoint. Output mirrors the CLI sketch in security.mdx §Quickstart.
SDK port issues Filed adcp-client#1268, adcp-client-python#344, adcp-go#109.
Follow-up issue adcontextprotocol/adcp#3827 — Migrate prose required-when rules to x-adcp-validation across all schemas.

What's deferred (with reason)

  • Training agent doesn't emit identity.brand_json_url yet. The storyboard runner uses @adcp/sdk's pinned ADCP_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 + --inproc e2e prove the chain works end-to-end.
  • Hosted AAO resolver. Earlier rounds explored a /api/registry/agents/resolve endpoint. 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 in specs/capabilities-brand-url.md.

Reviewer rounds

5 rounds of expert review (ad-tech protocol, security, DX, docs) addressed inline:

  • R1: Initial draft. Found H1 (shared-tenancy spoofing — fixed via eTLD+1), H2 (key_origins optional — made mandatory), M1 (SSRF), M2 (stale-while-revalidate on JWKS — dropped), M3 (JOSE silently inducting AAO — dropped hosted resolver), M4 (TLS trust).
  • R2: After spec rewrite. key_ops MUST-NOT was wrong (security.mdx:780 mandates the four-tuple); required-when on supported was wrong cut (should be supported_for/required_for); sell-side webhook carve-out missing in step 7; loose SHOULDs tightened to MUSTs; .well-known/adcp-jwks.json shortcut dropped (re-introduced M3); SSRF list expanded with PSL pinning, IPv6 ULA, cloud-metadata IPs.
  • R3: Hosted AAO resolver dropped; reframed as @adcp/client SDK + CLI; trace[]/freshness moved to SDK return value.
  • R4: Field moved into identity block, renamed brand_url → brand_json_url (disambiguates from sponsored_intelligence.brand_url per "brand_url iff brand-being-advertised" rule); constraints lifted into x-adcp-validation; schema-extensions doc; quickstart added; SDK references; Go signatures.
  • R5: Quickstart pseudocode security fixes (IDN normalization, named timeouts/caps on all fetches, strict-parse JSON, helper library pointers); CLI parity (Python adcp resolve via console_scripts); error-table retry timing + value examples; required_when shape flattened to { any_of: [...] }; schema_required_when regex; 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_url today 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:schemas
  • npm run test:schemas (7 passed)
  • npm run test:json-schema (255 passed)
  • npm run test:composed (32 passed)
  • npm run test:schema-links
  • Server typecheck
  • Training-agent unit suite (357 passed)
  • Training-agent integration (21 passed)
  • E2E --inproc resolves training agent end-to-end with valid trace + JWKS verification
  • CodeQL passes
  • Code-quality bot comments addressed
  • Storyboards green (in progress — pending CI re-run after 89c38e74c deferred the training-agent emit)

🤖 Generated with Claude Code

…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]>
Comment thread specs/capabilities-brand-url.md Resolved
bokelley and others added 2 commits April 30, 2026 21:28
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]>
@bokelley

bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Round 2: spec rewrite + AAO resolver build

Pushed two follow-ups to this PR:

Spec — round 2 fixes addressing fresh expert reviews

Material changes (full list in the spec's "Reviewer feedback addressed → Round 2" section):

  • Reverted key_ops MUST-NOT — 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).
  • Sell-side webhook carve-out in step 7 — consistency check skips purposes whose JWKS came from a publisher adagents.json signing_keys pin (publisher's intentional override may legitimately differ from operator's key_origins).
  • Tightened loose SHOULDs to MUSTs — production verifiers MUST use native resolution; verifiers MUST honor upstream Cache-Control.
  • Dropped /.well-known/adcp-jwks.json — re-introduced M3-prime self-attestation without saving fetches on the trust-required path.
  • Expanded SSRF checklist — pinned PSL snapshot, IPv6 ULA fc00::/7, IPv4-mapped ::ffff:0:0/96, AWS/GCP/Azure/Alibaba metadata IPs, bracketed-IPv6 zone-ID handling, DNS-rebinding ordering, agent_url 2 KB cap, per-caller < per-host rate cap invariant.
  • New error code request_signature_key_origin_missing — AAO resolver MUST itself enforce required-when (storyboard alone leaves mode:"aao" callers without H2 protection until 4.0).
  • Added trace[] + freshness to /resolve response — full audit trail of every upstream fetch (URL, status, etag, last_modified, cache_control, fetched_at, age_seconds, bytes, ok). One-glance freshness: "fresh" | "stale" | "unknown" aggregate. JWKS endpoint surfaces X-AAO-Trace-URL header (preserves RFC 7517 purity in the body).

AAO resolver — full implementation + tests

Built the hosted resolver end-to-end so an agent URL like https://buyer.example resolves instantly, with the full path visible:

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):

  • server/src/registry/agent-resolver/{index,capabilities-fetcher,brand-json-fetcher,jwks-fetcher,consistency,breadcrumb,cache,safe-fetch-strict,errors,algorithms}.ts
  • server/tests/unit/agent-resolver-{consistency,cache,safe-fetch-strict}.test.ts
  • server/tests/integration/agent-resolver.test.ts

Files modified: server/src/routes/registry-api.ts (two route handlers + OpenAPI registerPath), static/openapi/registry.yaml.

Test results: 63/63 passing.

  • 29 consistency cases (every storyboard variant from spec §"Compliance impact")
  • 10 cache + rate-limiter cases
  • 13 SSRF-strict fetch cases (body cap, redirect cap, timeout, IPv6 ULA, metadata IPs)
  • 11 integration cases via supertest with real Ed25519 keypair generated by jose — including a JOSE round-trip verifying a token signed with the fixture key, end-to-end through the JWKS endpoint

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: bd89c62ff4 (round 2), fac8c7f695 (use:sig fix), 2ac19876a0 (initial spec).

bokelley and others added 2 commits April 30, 2026 22:30
…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]>
@bokelley

bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Round 3: dropped hosted AAO resolver, reframed as @adcp/client SDK + CLI

CodeQL flagged the hosted resolver's fetch path, and stepping back — a centralized fetcher of caller-supplied URLs is the wrong shape for the registry regardless of suppression. SSRF amplification on AAO infrastructure, centralized cache as a single poisoning point, "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.

What's in the spec now

The instant-answer UX still works — just locally:

$ npx @adcp/client resolve https://buyer.example.com/mcp

agent_url      https://buyer.example.com/mcp
brand_url      https://example.com/.well-known/brand.json   ✓ etld1_match
agent_entry    type=buying  id=buyer_main
jwks_uri       https://keys.example.com/.well-known/jwks.json
jwks           1 key  buyer-signing-2026-04 (Ed25519, sig, request-signing)
consistency    key_origin_match=true  issues=[]
freshness      fresh

trace
  capabilities  MCP_CALL  200  age=0    fetched=2026-04-30T12:00:00Z  bytes=4821
  brand_json    GET       200  age=12   fetched=2026-04-30T11:59:48Z  bytes=1903   etag="b9f0"
  jwks          GET       200  age=287  fetched=2026-04-30T11:55:13Z  bytes=612    cache-control="max-age=300"

Same one-glance audit. No third party in the chain. Cache is per-process.

The SDK is the only resolution path. There is no mode="aao". Production verifiers import { createAgentJwksSet } from "@adcp/client", hand it to jwtVerify, done.

What was removed

  • server/src/registry/agent-resolver/ — 10 modules
  • server/tests/{unit,integration}/agent-resolver*.test.ts — 4 test files (29 + 10 + 13 + 11 cases)
  • Two route handlers (/api/registry/agents/resolve, /api/registry/agents/jwks) in server/src/routes/registry-api.ts
  • Both registerPath blocks
  • Agent Resolution entries + tag in static/openapi/registry.yaml
  • .changeset/aao-agent-resolver-impl.md

What stays

  • The spec at specs/capabilities-brand-url.md — now ~365 lines. Verifier algorithm, eTLD+1 origin binding, mandatory identity.key_origins consistency, multi-tenant operator handling, error-code table, compliance storyboards — all unchanged. The §"Hosted resolver" section was replaced with §"Client SDK + CLI" describing the SDK API, CLI, and resolution result shape.
  • The CodeQL suppression on safeFetch — documents the existing axios.get callers' established pattern and stays correct independent of the resolver routes.
  • The pure-function logic (consistency, breadcrumb, cache, algorithms, SSRF-strict wrapper) was the right design — that work moves to the adcp-client repo as a follow-up PR.

Tradeoff

We lose the three-line createRemoteJWKSet(aaoUrl) integration for callers who didn't want to import an AdCP SDK. The native form requires importing @adcp/client (a real dependency) instead of pointing at a URL. That's the right tradeoff — verifying AdCP signatures means understanding AdCP-specific things (adcp_use, the tag parameter, four-tuple JWK shape). A JOSE-only shortcut was always misleading; making the SDK the explicit entry point is more honest.

Server unit suite: 2930/2930 passing. Typecheck clean. Commit bf43c25919.

bokelley and others added 2 commits May 1, 2026 06:20
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]>
BaiyuScope3
BaiyuScope3 previously approved these changes May 1, 2026
…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]>
@bokelley

bokelley commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Round 4: spec → actual protocol work

Pushed real schema + docs changes in commit `4a7aa5df5`. PR is no longer spec-only — it ships a wire-format change.

Schema change

static/schemas/source/protocol/get-adcp-capabilities-response.json — adds top-level `brand_url`:

  • HTTPS URI pointing at the operator's brand.json (typically `https://{operator-domain}/.well-known/brand.json`).
  • 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 visuals).

Security docs

docs/building/implementation/security.mdx — new §"Discovering an agent's signing keys via brand_url":

  • 8-step verifier algorithm covering eTLD+1 origin binding, `authorized_operators[]` opt-in for SaaS-platform-as-operator, byte-equal `agents[].url` match, mandatory `identity.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`.
  • Existing JWKS-discovery prose now points at the new section.
  • Trust-root distinction documented: brand.json operator-attested, adagents.json publisher-attested, agent never self-attests.

Changeset

Bumped from empty (no-op spec note) to `adcontextprotocol: minor` — strictly additive schema change.

Backwards compatibility

Verifiers 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

  • `npm run build:schemas`: clean
  • `npm run test:schemas`: 7 passed
  • `npm run test:json-schema`: 255 passed
  • `npm run test:composed`: 32 passed
  • `npm run test:schema-links`: clean
  • `npm run typecheck` (via pre-commit hook): clean

The full design — reviewer history, multi-tenant operator handling, @adcp/client SDK + CLI integration, and the rejected hosted-AAO-resolver alternative — stays in specs/capabilities-brand-url.md for follow-up SDK / storyboard / 4.0 enforcement work.

bokelley and others added 2 commits May 2, 2026 10:33
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]>
@bokelley

bokelley commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Round 4: structural improvements + SDK port issues filed

Pushed in commit `83e267094`. Three structural changes plus the schema-extensions doc, quickstart, SDK references, and Go signatures.

1. Field placement: top-level → identity.brand_json_url

`brand_url` was at the top level of `get_adcp_capabilities`; it now lives inside the existing `identity` block, 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. Naming: `brand_url` → `brand_json_url`

Per the user's rule: `brand_url` should mean "the brand being advertised" context (which is what `sponsored_intelligence.brand_url` is). The capabilities trust-root pointer is something different — it's the operator's master record (which can be a single brand, a house, an agency, or a pure operator record). `brand_json_url` names the file artifact, not the role. Defuses the name-collision footgun that previously needed a MUST rule to disambiguate.

3. Structured constraints: `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. 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.

New `docs/reference/schema-extensions.mdx` is the canonical reference for AdCP `x-` prefixed schema annotations — documents both the existing `x-status` and the new `x-adcp-validation` conventions. Wired into docs.json sidebar.

Quickstart + SDK references

  • New §"Quickstart: implement a `brand_json_url`-based verifier" in security.mdx mirrors the existing §"Quickstart: opt into request signing" — 8 numbered steps + 30-line TypeScript pseudocode.
  • New §"Reference implementations" names `@adcp/client` (TS), `adcp` (Python), `adcp-go` (Go) with their `resolveAgent` / `getAgentJwks` / `verify_request_signature` signatures and per-SDK CLI commands. Output format identical across SDKs so shell pipelines are portable.
  • Spec doc updated with Go signatures (`resolver.ResolveAgent`, `verify.RequestSignature`, options shape).

SDK port issues filed

Each issue links to this PR, the security.mdx section, the design doc, and the relevant SDK signatures.

Validation

`build:schemas`, `test:schemas` (7), `test:json-schema` (255), `test:composed` (32), typecheck — all clean.