diff --git a/.changeset/wba-request-signing-profile.md b/.changeset/wba-request-signing-profile.md
new file mode 100644
index 00000000000..a8cc172f1eb
--- /dev/null
+++ b/.changeset/wba-request-signing-profile.md
@@ -0,0 +1,13 @@
+---
+"adcontextprotocol": minor
+---
+
+Add the Web Bot Auth request-signing profile, experimental in 3.3 and adopted by DR-0023, published alongside the AdCP RFC 9421 profile, which stays as written. The page `docs/building/by-layer/L1/wba-profile.mdx` defines the profile: a signer names its origin in a covered `Signature-Agent` header, and the verifier resolves the signer's keys in one step from that origin's `/.well-known/http-message-signatures-directory`. An identity is an origin with one key directory, every signing key is an Ed25519 key, `keyid` is the JWK thumbprint, and every signed request carries an RFC 9421 `nonce` of 64 bytes, as unpadded base64url or canonical padded base64, that the seller's verifier MUST check. Signature failures are reported with `400`, `403`, and `429`. A request carries exactly one `web-bot-auth` signature and one `Signature-Agent` member, and a verifier does not read signatures with other tags; a party that signs a request is its signer, and whether it may act for another party is answered by that party's `brand.json` or `trust.json`. A directory response is served with the `application/http-message-signatures-directory+json` media type and signed by each Ed25519 key it holds; a verifier uses each Ed25519 key with a valid signature, ignores every other key, and refuses a directory in which any key carries a private member. Webhooks under the profile are ordinary signed requests from the seller's identity. A governance agent is an identity like any other, on its own origin; JWS artifacts, such as governance tokens, are outside this profile. The profile selects options Web Bot Auth and RFC 9421 already define and adds nothing to the wire.
+
+Two checks have no Web Bot Auth library behind them, so they live in the AdCP layer, in the `security.mdx` section "AdCP checks after Web Bot Auth verification": the identity's revocation list, signed by a key in the identity's directory with JWS `alg` `EdDSA`, and the `Accept-Signature` hint on a `403` or `429`, which is a SHOULD.
+
+A verified identity the seller has not approved gets no account access, reads included. After approval, the identity maps to a principal and the principal to its accounts, so onboarding becomes approving a verified identity instead of issuing a credential.
+
+Additive schema changes: `request_signing.profiles` and `webhook_signing.profiles` on `get_adcp_capabilities` let a seller say which signing profiles it accepts and emits, and an optional, experimental `signing_profile` on every webhook registration (`push-notification-config`, `notification-config`, `agent-notification-config`, `reporting-webhook`, and `artifact_webhook` on `create_media_buy`) lets a webhook subscriber select the profile it verifies; a registration that carries both `signing_profile` and `authentication` fails schema validation. `reporting_webhook` and `artifact_webhook` still require `authentication`, so `signing_profile` is usable there once adcontextprotocol/adcp#8177 makes `authentication` optional. Omitting every new field keeps the 3.0 to 3.2 behavior.
+
+Adds the `wba-profile` conformance vectors: two positive vectors (single signer, signed directory response) and six negative vectors (missing nonce, replayed nonce, uncovered `Signature-Agent`, key absent from the named directory, unparseable header, two signatures on one request), each stating its expected status code. Adds `scenarios.json`, 49 failure scenarios as data that a harness signs at run time, each with its expected outcome and a tier that says whether a Web Bot Auth library alone gives that outcome or only the profile's rules do.
diff --git a/docs/building/by-layer/L1/index.mdx b/docs/building/by-layer/L1/index.mdx
index c5f661a767a..66307e44329 100644
--- a/docs/building/by-layer/L1/index.mdx
+++ b/docs/building/by-layer/L1/index.mdx
@@ -23,3 +23,4 @@ For the cumulative cross-layer story (what L0+L1 buys you), see the [SDK stack r
- **[Security implementation profile](/docs/building/by-layer/L1/security)** — RFC 9421 wire details, KMS integration, replay-window tuning.
- **[Portable attestations](/docs/building/by-layer/L1/security#portable-attestations)** — reference-first claim credentials, evaluator allowlists, safe resolution, verification outcomes, and action binding.
- **[Webhook verifier tuning](/docs/building/by-layer/L1/webhook-verifier-tuning)** — clock-skew handling, key-rotation transitions, signature failure diagnostics.
+- **[Web Bot Auth request-signing profile](/docs/building/by-layer/L1/wba-profile)** — experimental in 3.3, adopted by DR-0023: one key-resolution rule from the covered `Signature-Agent` header, identity as an origin, mandatory nonce checks, one signature per request, and status-code error responses.
diff --git a/docs/building/by-layer/L1/security.mdx b/docs/building/by-layer/L1/security.mdx
index eda07ebdbdc..76aea559779 100644
--- a/docs/building/by-layer/L1/security.mdx
+++ b/docs/building/by-layer/L1/security.mdx
@@ -1606,6 +1606,37 @@ Operators SHOULD serve a single combined revocation list at the brand.json origi
Verifiers accepting request-signed mutations MUST poll the revocation list on the cadence declared in `next_update` (floor 1 min, ceiling 30 min). The fetch-failure safe-default applies with grace = 4× the previous polling interval: verifiers that have not refreshed within `next_update + grace` MUST reject new request-signed mutations with `request_signature_revocation_stale` until the list is refreshed.
+#### AdCP checks after Web Bot Auth verification
+
+
+These checks belong to the [Web Bot Auth request-signing profile](/docs/building/by-layer/L1/wba-profile), which is experimental in AdCP 3.3, adopted by [DR-0023](https://github.com/adcontextprotocol/adcp/blob/main/governance/decisions/DR-0023-agent-identity-is-an-origin.md).
+
+
+A Web Bot Auth (WBA) verifier configured with the profile's rules decides whether a request is validly signed and which origin signed it. AdCP adds two checks that run after that verifier returns, each on a different outcome. The revocation-list check runs only after verification succeeds. The `Accept-Signature` field goes only on the verifier's `403` or `429` refusal. A standard WBA library does not perform them, so an implementation runs them in its AdCP layer. The WBA profile's conformance vectors do not grade them.
+
+**Revocation list.** After WBA verification succeeds, the verifier checks the signing identity's revocation list, the list that [Transport revocation](#transport-revocation) defines. The following rules apply under the profile:
+
+- The identity's origin serves the list, with the path and media type that Transport revocation uses. The verifier accepts the list only from that origin.
+- A key in the identity's key directory signs the list, with the JWS `alg` `EdDSA`.
+- Entries in `revoked_kids` are JWK thumbprints. The verifier matches them against the signature's `keyid`.
+
+[Transport revocation](#transport-revocation) states the polling cadence and what a request gets when its key is revoked or the list is missing or stale.
+
+The list lives on the same origin as the key directory. An outage that keeps a stale directory in use also leaves the list unrefreshed, so the safe default bounds how long a removed key commits spend during a discovery failure.
+
+**`Accept-Signature` on a refusal.** When WBA verification refuses a request with `403` or `429`, the verifier SHOULD add an `Accept-Signature` field (RFC 9421 section 5.1). WBA section 5.3 lets an origin request a signature this way. The field names the label, the covered components, and the parameters the profile requires:
+
+```http
+NOTE: '\' line wrapping per RFC 8792
+
+HTTP/1.1 403 Forbidden
+Accept-Signature: sig1=("@method" "@target-uri" "@authority" "content-type" \
+ "content-digest" "signature-agent";key="sig1");created;expires;nonce;ke\
+ yid;alg;tag="web-bot-auth"
+```
+
+On a `429`, the field SHOULD also carry a fresh `nonce` for the signer's next attempt. The verifier SHOULD add the same field to its answer to an unsigned request for an operation in `required_for`. A `400`, a revoked key, and an AdCP authorization error carry no `Accept-Signature`.
+
#### Transport capability advertisement
Verifiers advertise signing support and per-call requirements via the `request_signing` block on `get_adcp_capabilities`:
diff --git a/docs/building/by-layer/L1/wba-profile.mdx b/docs/building/by-layer/L1/wba-profile.mdx
new file mode 100644
index 00000000000..a9d602ce953
--- /dev/null
+++ b/docs/building/by-layer/L1/wba-profile.mdx
@@ -0,0 +1,287 @@
+---
+title: Web Bot Auth request-signing profile
+sidebarTitle: Web Bot Auth profile
+description: "Experimental AdCP 3.3 Web Bot Auth profile for request and webhook signing: keys from Signature-Agent, an origin as the identity, and one web-bot-auth signature."
+"og:title": "AdCP — Web Bot Auth request-signing profile"
+---
+
+This page defines an AdCP profile of Web Bot Auth (WBA), the IETF protocol for identifying automated HTTP clients. Under the profile, a seller identifies a signing agent from the request itself. The signer names its origin in a covered `Signature-Agent` header, and the seller fetches the signer's keys from that origin's key directory. The seller then decides, under AdCP's own rules, what the identified agent may do.
+
+
+**Status: experimental in AdCP 3.3**, adopted by [DR-0023](https://github.com/adcontextprotocol/adcp/blob/main/governance/decisions/DR-0023-agent-identity-is-an-origin.md). The profile is published alongside the AdCP RFC 9421 profile in [Signed Requests (Transport Layer)](/docs/building/by-layer/L1/security#signed-requests-transport-layer), which stays as written. Document signing and transparency logs are separate decisions and are not part of this page.
+
+
+The profile selects options that WBA and RFC 9421 already define. It adds no headers, tags, key fields, or error codes to the wire. Any implementation of [draft-ietf-webbotauth-httpsig-protocol-00](https://datatracker.ietf.org/doc/draft-ietf-webbotauth-httpsig-protocol/00/) can therefore sign and verify AdCP requests once it is configured with the rules on this page. Section numbers in this page refer to that draft unless they name RFC 9421.
+
+## What the profile changes for a seller
+
+Under the AdCP RFC 9421 profile, a seller verifies a signature only from an agent it has onboarded. The agent's key location comes from onboarding or from a registry the seller trusts. Under this profile, the seller learns the signer's identity from the first signed request. Onboarding becomes approving a verified identity instead of issuing a credential. The seller approves an identity from a domain allowlist, from a commercial agreement, or with one click in its admin interface. After that, every signed request from the identity is authenticated without a bearer token. Until the seller approves the identity, the identity gets no account access, reads included. See [Onboarding](#onboarding).
+
+## One resolution rule
+
+A verifier resolves a signer's keys in one step:
+
+```text
+Signature-Agent member -> origin -> https:///.well-known/http-message-signatures-directory
+```
+
+The verifier reads the `Signature-Agent` member keyed to the signature label and takes the origin it names. The member value is exactly the ASCII serialization of an `https` origin (RFC 6454 section 6.2), such as `https://buyer-7k3q.com`: a lowercase host, no default port, no trailing `/`, and no path, query, fragment, or userinfo (sections 5.2.1 and 5.5). A signer sends that canonical origin. A verifier compares the value with it as a string, without normalizing, and refuses any other value, including an `http` origin, with `403`. It fetches the HTTP Message Signatures Directory at that origin's well-known path (section 5.5). One fetch returns one file, and the verifier reads no other document to find keys. The directory is the only key location the profile recognizes. The verifier ignores a `Signature-Agent` member with a `type` parameter other than `directory`, as section 5.2.1 permits for a type the verifier does not support. Section 5.2.1 defines `type` as a Token, and a verifier accepts `type=directory` as a Token or as a String, as the reference library does.
+
+Section 5.5 explains why the well-known path matters: "TLS authenticates the host but not the path", and "The well-known URI is reserved, so directory additionally names a domain".
+
+## Identity
+
+Under the profile, an identity is an origin, for example `https://buyer-7k3q.com`. The identity has one key directory, and every key it signs with is published there. The verifier attributes a verified request to that origin and to nothing else.
+
+Two agents cannot share an origin. An operator that runs several agents gives each its own origin, for example one subdomain per agent. Section 6.5 recommends this for agents that need to be told apart: "these should use distinct signing keys and signing key directories". The same rule covers purposes: a governance agent is an agent like any other, on its own origin (see [One agent per purpose](#one-agent-per-purpose)).
+
+`brand.json`, `adagents.json`, and a seller's onboarding records refer to an identity by its origin. So does [`trust.json`](/docs/reference/trust-json): it lists agent origins with their roles and carries no keys. A multi-tenant vendor gives each tenant its own subdomain, for example `https://7f3a9c.sentinel-governance.example`, which serves that tenant's key directory.
+
+An agent that shares a host with other agents under the AdCP RFC 9421 profile keeps using that profile until it moves to its own origin. When it moves, the seller maps the agent's principal to that origin explicitly. Key discovery therefore never changes who the seller considers the caller to be.
+
+Key lookup is keyed on the pair of origin and key, never on the key alone (section 5.4). A verifier that indexes keys by thumbprint alone attributes a request to whatever origin the signer claims. Negative vector `004-key-not-in-named-directory` grades this rule.
+
+## One agent per purpose
+
+Purpose belongs to the agent, not to the key. A governance agent is an identity like any other, on its own origin, with its own key directory, so no key and no directory states a purpose. JWS artifacts, such as governance tokens, are outside this profile.
+
+## Profile rules
+
+RFC 9421 section 3.2.1 lets an application impose requirements beyond the base specification. Its examples include "Requiring a specific set of header fields to be signed", "Enforcing a maximum signature age", and "Enforcing uniqueness of the nonce parameter". The profile consists of the following rules. Each rule is a requirement of that kind or a choice among options WBA defines.
+
+| Rule | Profile choice | Basis |
+|---|---|---|
+| Signature | RFC 9421 with `tag="web-bot-auth"`, `keyid` set to the key's JWK thumbprint, and a covered `Signature-Agent` member whose value is the ASCII serialization of an `https` origin (RFC 6454 section 6.2), with no path, query, fragment, or userinfo | Sections 5.2, 5.2.1, 5.5 |
+| `Signature-Agent` value | Exactly the ASCII serialization of an `https` origin: a lowercase host, no default port, no trailing `/`, and no path, query, fragment, or userinfo. A verifier compares the string without normalizing and refuses any other value with `403` | Sections 5.2.1 and 5.5; RFC 6454 section 6.2 |
+| Components, every request | `@method`, `@target-uri`, `@authority`, `"signature-agent";key=` | Section 5.2 |
+| Components, requests with a body | Also `content-type` and `content-digest` | Section 5.2: an agent that needs body integrity "MUST send and cover Content-Digest" |
+| Parameters | `created`, `expires`, `keyid`, `alg`, and a `nonce` on every signed request. The nonce is 64 random bytes, encoded as unpadded base64url or as canonical padded base64 | RFC 9421 sections 2.3, 3.2.1, 7.2.2; sections 5.2 and 5.2.3; Appendix C.6; WBA architecture draft section 4.2.2 and Appendix A |
+| Algorithm | `ed25519`, named in `alg`, which must match the key | RFC 9421 sections 2.3, 3.2.1, 7.3.6 |
+| Lifetime and clock skew | `expires` at most 300 seconds after `created`. The verifier allows 60 seconds of clock skew | RFC 9421 section 3.2.1 |
+| Key publication | Each identity publishes its keys only in its key directory. Each signing key is an Ed25519 key (`kty` `OKP`, `crv` `Ed25519`). `kid` is the thumbprint, so a verifier selects a key by matching `keyid` against `kid` | Sections 5.5, 5.5.1, 6.5; RFC 8037 |
+| Directory responses | Served with the media type `application/http-message-signatures-directory+json`. Signed, one signature per Ed25519 key, covering `"@authority";req` and `content-digest`, with `created`, `expires`, the key's thumbprint as `keyid`, and `tag="http-message-signatures-directory"`. A verifier uses each Ed25519 key that has a valid signature on the response, ignores every other key and its signatures, and refuses a directory in which any key carries a private member | Section 5.5.1; Appendix B.1; directory draft section 5; RFC 7517 section 5 |
+| Fetches | Directory and revocation-list fetches follow AdCP's fetch rules: HTTPS only, resolved-address checks, no redirects, and size and time limits | Sections 5.5 and 6.7; [Webhook URL validation (SSRF)](/docs/building/by-layer/L1/security#webhook-url-validation-ssrf) |
+| One signature | A request carries exactly one `web-bot-auth` signature and exactly one `Signature-Agent` member, keyed to that signature's label. A verifier does not read `Signature-Input` members with other tags. An intermediary that signs a request is its signer; whether it may act for another party is an authorization question answered by that party's `brand.json` or `trust.json`, not by a second signature | RFC 9421 section 3.2.1 lets an application add a requirement of this kind. Section 5.2.2 permits more than one signature ("A request MAY contain more than one Web Bot Auth signature") and does not require a verifier to accept one |
+| Failure responses | `400` when a signature header does not parse, `403` when verification or a profile rule fails, and `429` for a reused signature or nonce | Sections 5.3 and 5.4 |
+
+A request that follows the profile is a valid WBA request. A WBA verifier configured with these rules accepts it and rejects a request that falls short. Because the rules are fixed in the profile, a signer knows them before its first request.
+
+AdCP adds two checks that run outside the WBA verifier, after it returns: the revocation-list check on a verified request, and the contents of `Accept-Signature` on a refusal. [AdCP checks after Web Bot Auth verification](/docs/building/by-layer/L1/security#adcp-checks-after-web-bot-auth-verification) defines both. A standard WBA library does not perform them, and the WBA conformance vectors do not grade them.
+
+The profile uses one algorithm. Every WBA library signs and verifies Ed25519, and several WBA tools support no other algorithm.
+
+The two nonce encodings are the two the WBA drafts use. The architecture draft's text names base64url, and the examples in both drafts use padded standard base64. Cloudflare's `web-bot-auth` library accepts exactly these two forms in `validateNonce`, and its `generateNonce` produces padded standard base64. A verifier accepts either encoding, so the profile states no preference for signers.
+
+The 300-second ceiling on `expires` is provisional. WBA section 5.2 recommends no more than 24 hours for general automated traffic, and the RFC asks the working group to confirm the shorter value for spend-committing traffic.
+
+### A signed request
+
+A buyer agent at `buyer-7k3q.com` sends `create_media_buy` to a seller over MCP. The domains are placeholders that resolve to nothing, and long lines are wrapped per RFC 8792.
+
+```http
+NOTE: '\' line wrapping per RFC 8792
+
+POST /mcp/ HTTP/1.1
+Host: seller-7k3q.com
+Content-Type: application/json
+Content-Digest: sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:
+Signature-Agent: sig1="https://buyer-7k3q.com"
+Signature-Input: sig1=("@method" "@target-uri" "@authority" "content-type" \
+ "content-digest" "signature-agent";key="sig1");created=1790841600;expir\
+ es=1790841900;nonce="Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pc\
+ rt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA";keyid="6WsKMCObba49V3uN0vIENnk1BK\
+ Ak7c9zjBJcWKyQ9_I";alg="ed25519";tag="web-bot-auth"
+Signature: sig1=:ihPGBC7XQPM6WkIYhYQvFHgwTpbssvuQzkb0FfwkuebREyF32sXhiRxXbX\
+ WRZMp0O//C4I2g1a2Kui56ffEfBQ==:
+
+{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"create_medi\
+ a_buy","arguments":{"idempotency_key":"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b\
+ 0a96","account":{"account_id":"acc_42"},"proposal_id":"prop_7","total_b\
+ udget":{"amount":25000,"currency":"USD"}}}}
+```
+
+The signature base the buyer signed is the one in `positive/001-single-signer-request.json` under [Conformance vectors](#conformance-vectors). The `Signature-Agent` value is an origin, so the verifier fetches `https://buyer-7k3q.com/.well-known/http-message-signatures-directory`.
+
+## Key directories
+
+A key directory is a JWK Set served at `/.well-known/http-message-signatures-directory` with the media type `application/http-message-signatures-directory+json` (sections 5.5.1 and 8.2). Each key's `kid` is its JWK thumbprint, computed per RFC 7638 and, for Ed25519 keys, RFC 8037 Appendix A.3. Publishers omit `alg` on Ed25519 keys. A publisher adds a key to the directory before signing with it, as section 5.5.2 describes, so that verifiers can resolve it on first use.
+
+The directory server signs its response once per Ed25519 key (Appendix B.1). Each signature covers `"@authority";req` and `content-digest`, carries `created` and `expires`, uses the key's thumbprint as `keyid`, and uses `tag="http-message-signatures-directory"`. Covering the request authority stops the key set from being served again from another domain. A verifier validates each signature with the key the directory itself provides and validates `Content-Digest` against the body; it rejects a response signature whose `created` is in the future. The verifier stores the signed response as its record of the fetch.
+
+A verifier uses each Ed25519 key that has a valid signature on the directory response, and ignores every other key and its signatures. Appendix B.1 lets a verifier use a key without a valid proof, and says the proof "matters for a domain-bound identifier". An AdCP identity is an origin, so the profile uses only proven keys. The directory draft says the same in section 5: "Clients SHOULD ignore keys from a directory response that do not have a corresponding valid signature". The keys a verifier ignores include keys the profile does not use, such as a P-256 key for another WBA use (section 5.5.1 permits any registered algorithm), and keys it cannot import, including a malformed Ed25519 key, as RFC 7517 section 5 advises. A directory with no validly signed Ed25519 key yields no usable key, so a request signed with one of its keys fails as an unknown key.
+
+A verifier refuses a directory in which any key carries a private member (`d`, `p`, `q`, `dp`, `dq`, `qi`, `oth`, or `k`), whatever the key's type. It compares member names without regard to case, so `D` is refused as well: some JSON decoders match member names case-insensitively and would read `D` as the private scalar. It checks every key for these members before it skips the keys the profile does not use, so a P-256 key with a `d` member is refused, not ignored. Section 5.5.1 says that "A verifier SHOULD validate the directory format and reject malformed entries", and a directory that publishes private key material is malformed.
+
+```http
+NOTE: '\' line wrapping per RFC 8792
+
+HTTP/1.1 200 OK
+Content-Type: application/http-message-signatures-directory+json
+Cache-Control: max-age=300
+Content-Digest: sha-256=:RQDAkRyNAdoJ2+MThuVDCXhj13Or2jS6ewwSRuyaXQg=:
+Signature-Input: key1=("@authority";req "content-digest");created=179084100\
+ 0;expires=1790927400;keyid="6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\
+ ";alg="ed25519";tag="http-message-signatures-directory"
+Signature: key1=:QJeeYQ9E5OXMbEy89f1YjQNCB5NjRxN+ck/V+4sRoVNtF5S/446uVIECNC\
+ eANo6YH/DhOBG/jMzNZLDqQrmkBg==:
+
+{
+ "keys": [
+ {
+ "kty": "OKP",
+ "crv": "Ed25519",
+ "kid": "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I",
+ "x": "yIxM3SIY89_Yhr6EA9hik-AJjWSDPraK5chDqQ3Xlf0",
+ "use": "sig"
+ }
+ ]
+}
+```
+
+**Fetch rules.** The verifier fetches a directory over HTTPS only, checks the resolved address before connecting, and follows no redirects (section 5.5). It applies the size, key-count, and time limits of section 6.7 and AdCP's fetch budgets: a 256 KiB body cap and 5 s connect and 10 s total deadlines. The verifier treats any status other than `200` as a discovery failure. It rejects a directory response whose media type is not `application/http-message-signatures-directory+json`, which section 5.5.1 requires of a directory served at the well-known path.
+
+**Caching.** A directory that resolves and does not contain the key is evidence that the key was removed, and it replaces the cached entry. A directory that fails to resolve is not evidence and does not evict a cached entry (section 6.10). Negative cache entries expire after at most 60 s, within the five-minute bound of Appendix C.5. A cached directory verifies until the earliest `expires` among its signatures. During a discovery failure, the fail-closed rule of the revocation list bounds spend-committing requests (see [AdCP checks after Web Bot Auth verification](/docs/building/by-layer/L1/security#adcp-checks-after-web-bot-auth-verification)). A compromised key is revoked, not removed.
+
+## Verification
+
+A verifier applies the following procedure to a request that carries `Signature-Input`.
+
+1. Parse `Signature`, `Signature-Input`, and `Signature-Agent` as Structured Fields. Every `Signature` member value is a Byte Sequence and every `Signature-Input` member value is an Inner List (RFC 9421 sections 4.1 and 4.2), whatever the member's tag. If any header fails to parse, answer `400` (section 5.4).
+2. Read the one `Signature-Input` member whose `tag` is `web-bot-auth` and the `Signature-Agent` member with the same label. The verifier does not read members with other tags. A request that carries more than one `web-bot-auth` member or more than one `Signature-Agent` member is rejected with `403`. If the `Signature-Agent` member is absent, or the signature does not cover `"signature-agent";key=`, reject the signature. An uncovered member is a claim the verifier must not attach policy to (section 4.1).
+3. Resolve the origin the member names to its key directory, from cache or by fetching it, and select the key whose `kid` equals `keyid`. If the directory holds no such key, answer `403`.
+4. Verify the signature with the selected key, and check its covered components, parameters, and window against the rules in [Profile rules](#profile-rules). If the signature fails verification or the profile rules, answer `403`, as described in [Error responses](#error-responses).
+5. Check the `nonce` against the identity's replay state (see [Replay protection](#replay-protection)). If the identity used it within the signature's lifetime, answer `429`.
+6. Record the `nonce` in the identity's replay state. The verifier records a nonce only after steps 1 to 5 pass, so a request that fails verification can't use up a nonce that its legitimate signer hasn't sent yet.
+7. Run the AdCP checks in [AdCP checks after Web Bot Auth verification](/docs/building/by-layer/L1/security#adcp-checks-after-web-bot-auth-verification), starting with the identity's revocation list.
+8. Pass the verified identity to the AdCP layer, which applies [Onboarding](#onboarding) and the account authorization rules that apply to every request, signed or not.
+
+Steps 1 to 6 are WBA verification with the profile's rules, and a WBA library configured with those rules performs them. Steps 7 and 8 belong to the AdCP layer.
+
+When a deployment verifies at the edge, Appendix C.10 applies: the edge "can instead verify at the proxy and pass the result to the origin through a deployment-local trusted channel". The edge removes any copy of that result a client sends, and the origin accepts the result only over its authenticated channel to its own edge. The edge forwards the signature fields unchanged, because the seller's own verifier enforces nonce uniqueness whatever the edge does.
+
+## Onboarding
+
+A verified identity gets account access only after the seller binds it to a principal, under rule R5 of [Agent identity and buyer self-onboarding](https://github.com/adcontextprotocol/adcp/blob/main/specs/agent-identity-3-3.md). Until then it gets what an anonymous caller gets, reads included. After binding, the principal resolves to its accounts, and every later signed request from the identity is authenticated without a bearer token.
+
+A seller approves an identity from a domain allowlist, from a commercial agreement, or with one click in its admin interface. For one-click approval, the seller records the identity for review and rejects the request with an AdCP authorization error. It never runs a queued request later, because the request's signature expires within minutes; after approval, the buyer sends the request again. A seller limits how many identities one origin or one network address can submit for review.
+
+The account's operator comes from the request's `account.operator`, not from the authenticated identity. Whether the identity may act for the brand named in the request is the authorization check that [Agent identity](/docs/building/by-layer/L1/security#agent-identity) separates from authentication. This profile changes how the seller learns who is calling, not what the seller lets the caller do.
+
+## Replay protection
+
+The seller's verifier MUST reject a `nonce` it has already seen for the same identity within the signature's lifetime, whether or not an edge verifier ran first.
+
+The profile requires the nonce on every signed request, reads included. A replayed read returns the response to whoever sent the replay, and proxies and log pipelines see request headers. RFC 9421 section 7.2.2 describes the nonce as "a per-message unique value to allow the verifier to detect replay of the signature itself". WBA leaves nonce enforcement to deployment policy (Appendix C.6); the profile makes that choice once, so each seller does not have to.
+
+`idempotency_key` keeps its role. A repeated committed mutation returns the stored response without re-running side effects, under [Idempotency](/docs/building/by-layer/L1/security#idempotency). The signature covers `content-digest`, so it binds the key too.
+
+Replay-cache sizing is implementation guidance. The entry lifetime for a nonce is the remaining signature validity plus the 60-second skew allowance. The recommendations in [Transport replay dedup](/docs/building/by-layer/L1/security#transport-replay-dedup) carry over with the identity in place of `keyid`.
+
+## Error responses
+
+The profile reports signature failures with HTTP status codes, as WBA does (sections 5.3 and 5.4):
+
+| Status | Meaning for the caller | Basis |
+|---|---|---|
+| `400` | The signature headers cannot be parsed. Fix the signer. | Section 5.4 |
+| `403` | The signature failed verification or a profile rule. Sign again under the profile rules. | Section 5.3 |
+| `429` | The signature or its nonce was used before. Sign again with a fresh `nonce`. | Section 5.3; RFC 9421 section 7.2.2 |
+
+On a `403` or `429`, the AdCP layer SHOULD add an `Accept-Signature` field that names the components and parameters the profile requires. [AdCP checks after Web Bot Auth verification](/docs/building/by-layer/L1/security#adcp-checks-after-web-bot-auth-verification) states its contents. The conformance vectors grade the status, not that field.
+
+A request signed with a revoked key gets the error that [Transport revocation](/docs/building/by-layer/L1/security#transport-revocation) states. An identity without the needed onboarding entry gets an AdCP authorization error, without `Accept-Signature`. Those errors use the AdCP error envelope and codes, not the transport status codes in the table.
+
+An unsigned request to an operation in `required_for`, from a caller with no other credential the verifier accepts, gets an answer that depends on what the verifier advertises. A verifier that advertises only `web-bot-auth` answers `403`. A verifier that also advertises the AdCP RFC 9421 profile answers as that profile does: `401` with `request_signature_required`. In both cases the AdCP layer SHOULD add `Accept-Signature` for this profile.
+
+## Webhooks
+
+A webhook signed under this profile is an ordinary signed request from the seller's identity. The seller signs the delivery with the rules in [Profile rules](#profile-rules). Its `Signature-Agent` member names the seller's origin, and the signature covers `content-type` and `content-digest`. The receiver resolves the seller's keys from the seller's key directory with the same one resolution rule, and applies [Verification](#verification) and [Replay protection](#replay-protection) as a seller does.
+
+A subscriber states which profile it verifies in the optional `signing_profile` field of every webhook registration: `push_notification_config`, `reporting_webhook`, `artifact_webhook`, `accounts[].notification_configs[]`, and the agent-level notification configuration. `web-bot-auth` selects this profile, and `adcp/webhook-signing/v1` selects the AdCP webhook profile. A registration that omits the field is signed as before: with the AdCP webhook profile, or with the legacy scheme when `authentication` is present. A registration carries `signing_profile` or `authentication`, never both, and the schemas refuse one that carries both. The field has no schema `default`, so a validator or a generated SDK that fills in defaults never adds it next to `authentication`. The seller signs every delivery to that registration with the one selected profile and never signs a delivery both ways. This keeps the mode-selection rule of [Webhook callbacks](/docs/building/by-layer/L1/security#webhook-callbacks). The two profiles encode binary header values differently: the AdCP webhook profile uses unpadded Base64URL, and this profile uses RFC 8941 Base64. A receiver therefore selects one parser from the registration and never tries both.
+
+A seller advertises the profiles it can sign webhooks with in `webhook_signing.profiles`. A seller that does not list the profile a subscriber selects rejects the configuration as a validation failure.
+
+## Capability
+
+A seller advertises which request-signing profiles it accepts in `request_signing.profiles`, named by the `tag` value each profile puts in `Signature-Input`. Omitting the field means the AdCP RFC 9421 profile only, so every 3.0 to 3.2 capability document stays valid.
+
+```json
+{
+ "request_signing": {
+ "supported": true,
+ "covers_content_digest": "required",
+ "profiles": ["adcp/request-signing/v1", "web-bot-auth"],
+ "required_for": ["create_media_buy", "update_media_buy"],
+ "supported_for": ["sync_creatives", "create_media_buy", "update_media_buy"]
+ },
+ "webhook_signing": {
+ "supported": true,
+ "profile": "adcp/webhook-signing/v1",
+ "profiles": ["adcp/webhook-signing/v1", "web-bot-auth"],
+ "algorithms": ["ed25519"],
+ "legacy_hmac_fallback": false,
+ "delivery_retry_horizon_seconds": 86400
+ }
+}
+```
+
+A buyer reads `profiles` and signs with a profile the seller lists. The operation lists (`required_for`, `warn_for`, `supported_for`, and the `protocol_methods_*` lists) keep their meaning for both profiles.
+
+The profile is [experimental](/docs/reference/experimental-status): a seller that lists `web-bot-auth` in either list also lists `signing.web_bot_auth` in `experimental_features`.
+
+## Relationship to the AdCP RFC 9421 profile
+
+The two profiles share the signature base, the covered request components, the parameter semantics, the fetch rules, and the signed revocation list. They differ in how a verifier finds the signer's keys and how it reports a failure. The following table lists the mechanisms of the AdCP RFC 9421 profile and the rule that takes their place under this profile.
+
+| AdCP RFC 9421 profile | This profile |
+|---|---|
+| Tags `adcp/request-signing/v1` and `adcp/webhook-signing/v1` | `tag="web-bot-auth"` |
+| Operator-chosen `kid` | JWK thumbprint |
+| Keys at `brand.json` `agents[].jwks_uri`, found through [Agent resolution](/docs/building/by-layer/L1/security#agent-resolution) | Key directory at the identity's origin, found from `Signature-Agent` |
+| eTLD+1 binding and the `identity.key_origins` consistency check | Not needed: the identity is the origin, and the directory path is reserved |
+| `adcp_use` key purposes | One agent per purpose, each on its own origin |
+| "Exactly one `Signature-Input` label" | One `web-bot-auth` signature and one `Signature-Agent` member. `Signature-Input` members with other tags are not read |
+| AdCP nonce rules and replay codes | RFC 9421 `nonce` on every signed request, enforced by the seller's verifier |
+| `request_signature_*` and `webhook_signature_*` codes in `WWW-Authenticate` | `400`, `403`, or `429`, with `Accept-Signature` added by the AdCP layer; `AUTH_INVALID` for a revoked key; and AdCP authorization errors |
+| Separate webhook profile and encoding | Webhooks are ordinary signed requests |
+
+Account authorization, the signed revocation list, and principal boundaries do not change. [AdCP checks after Web Bot Auth verification](/docs/building/by-layer/L1/security#adcp-checks-after-web-bot-auth-verification) states how the revocation list applies under this profile.
+
+## Differences from the reference library
+
+The conformance tooling judges implementations with Cloudflare's `web-bot-auth` 0.2.0, which implements -00. The profile differs from that library in one way, and AdCP accepts the difference:
+
+- **Member keyed to the label.** The library accepts a signature that covers any one `Signature-Agent` member, whatever its key. The profile requires the member keyed to the signature's label, as section 5.2.1 states: "Its member keyed to the signature label MUST be signed as a component." A verifier built on the library adds this rule through the library's `validate` hook. Scenario `R19` in `scenarios.json` grades it, with tier `adcp`.
+
+The library also does not enforce one WBA MUST yet: section 5.2.1 requires an `https` origin, and the library accepts `http` ([cloudflare/web-bot-auth#162](https://github.com/cloudflare/web-bot-auth/issues/162)). This is a gap in the library, not a difference in the profile. Scenario `R16` grades the rule, with tier `adcp` until the library enforces it. The library does not check the rest of the origin rule either: scenarios `R17` (a path), `R17c` (a trailing `/`), `R17d` (an uppercase host), and `R17e` (an explicit `:443`) grade it, each with tier `adcp`.
+
+## Conformance vectors
+
+The vectors live at `static/compliance/source/test-vectors/wba-profile/` and are served at `/compliance/latest/test-vectors/wba-profile/`. They grade the rules on this page, and each states its expected outcome in the status-code vocabulary of [Error responses](#error-responses).
+
+- `positive/001-single-signer-request`: the request on this page, signed by `https://buyer-7k3q.com`.
+- `positive/002-signed-directory-response`: the directory response on this page, signed per Appendix B.1.
+- `negative/001-missing-nonce`: `403`.
+- `negative/002-replayed-nonce`: `429`; needs preloaded replay state.
+- `negative/003-signature-agent-not-covered`: `403`; the header is present but not a covered component.
+- `negative/004-key-not-in-named-directory`: `403`; the signing key is published by a different origin than the one `Signature-Agent` names.
+- `negative/005-malformed-signature-agent`: `400`; the header does not parse.
+- `negative/006-two-signatures`: `403`; the request carries two `web-bot-auth` signatures, each valid on its own.
+
+`scenarios.json` holds failure scenarios as data: a base request, the covered components, parameter overrides, a change after signing, and the expected status. A harness signs each scenario at run time, so no committed signature expires. Each scenario names a tier: `wba` when a WBA library with no AdCP rules already gives the expected outcome, and `adcp` when only the profile's rules do.
+
+The keys in `keys.json` are public test keys with published private seeds. Section 6.8 says test keys "MUST NOT be used in production", and verifiers SHOULD reject them when detected. The README in the vector directory describes the file format and the harness state each vector needs.
+
+## References
+
+- [HTTP Message Signatures for automated traffic, draft-ietf-webbotauth-httpsig-protocol-00](https://datatracker.ietf.org/doc/draft-ietf-webbotauth-httpsig-protocol/00/)
+- [HTTP Message Signatures Directory, draft-meunier-http-message-signatures-directory-05](https://datatracker.ietf.org/doc/draft-meunier-http-message-signatures-directory/05/), the "directory draft"
+- [Web Bot Auth architecture, draft-meunier-web-bot-auth-architecture](https://datatracker.ietf.org/doc/draft-meunier-web-bot-auth-architecture/)
+- [RFC 9421: HTTP Message Signatures](https://www.rfc-editor.org/rfc/rfc9421)
+- [RFC 9530: Digest Fields](https://www.rfc-editor.org/rfc/rfc9530)
+- [RFC 6454: The Web Origin Concept](https://www.rfc-editor.org/rfc/rfc6454)
+- [RFC 7638: JSON Web Key Thumbprint](https://www.rfc-editor.org/rfc/rfc7638) and [RFC 8037](https://www.rfc-editor.org/rfc/rfc8037) Appendix A.3
+- [RFC 8941: Structured Field Values for HTTP](https://www.rfc-editor.org/rfc/rfc8941)
+- [RFC #7878: An AdCP profile of Web Bot Auth for request signing](https://github.com/adcontextprotocol/adcp/issues/7878)
+- [Signed Requests (Transport Layer)](/docs/building/by-layer/L1/security#signed-requests-transport-layer), the AdCP RFC 9421 profile
+- [Request Signing Guide](/docs/building/by-layer/L1/request-signing)
diff --git a/docs/reference/experimental-status.mdx b/docs/reference/experimental-status.mdx
index eff6b11e38f..e490753577f 100644
--- a/docs/reference/experimental-status.mdx
+++ b/docs/reference/experimental-status.mdx
@@ -134,6 +134,7 @@ Schemas marked with `x-status: experimental` are the authoritative source. The c
| `identity.trust_json` | The `trust/v1/trust.json` and `trust/v1/trust-acknowledgements.json` schemas, described in [trust.json (experimental)](/docs/reference/trust-json) ([RFC #7809](https://github.com/adcontextprotocol/adcp/issues/7809), [#7819](https://github.com/adcontextprotocol/adcp/pull/7819)). **Schemas only: nothing consumes this in 3.3.** No task, capability field, resolver, or storyboard reads it, there is no `identity.trust_url` capability field, `brand.json` behavior is unchanged, and no one is required to publish `/.well-known/trust.json`. Because no seller implements anything from this surface, there is nothing to declare in `experimental_features`: publishing a `trust.json` is not implementing this surface, and declaring `identity.trust_json` has no defined meaning until a consumer lands. | The document shape for agents, grants, and acknowledgements is published ahead of the behavior that would use it, so implementers can review it. Agents are identified by origin, one per origin, and the record carries no keys ([`specs/agent-identity-3-3.md`](https://github.com/adcontextprotocol/adcp/blob/main/specs/agent-identity-3-3.md)). The document name and its `/.well-known` path may change before graduation: the JournalList `trust.txt` naming outreach is still open. The record's location is derived from the agent's origin, so no capability pointer is planned. Resolver and no-downgrade rules land with the first consumer and may reshape the fields. |
| `media_buy.collection_cards` | The `images`, `sample_content` and `url` fields on `core/collection.json`, the `brand_ref` field on `core/talent.json`, the `sample_content` role on `core/product-card-reference-asset.json` (#8092), and the `followers` field on `core/collection-distribution.json` entries, a `core/audience-size.json` count (#8098); the top-level `collections` array (`core/response-collection.json`) on the `get_products`, `list_products`, `request_proposals` and `refine_proposals` responses, and the `include_collections` request flag that opts into it (#8137). See [collection cards](/docs/media-buy/product-discovery/collections-and-installments#collection-cards-experimental). | Display and identity slice of the creator-card RFC, with a single adopter so far (Availnet, a creator marketplace) and no field-testing across parties yet. The array bounds, the use of `published-post` references for samples, the `brand_ref`-over-`brand_url` precedence, the opt-in flag, and the closed list of fields (`images`, `sample_content`, `url`, `description`, `season`, `cadence`, `distribution[].followers`) on which a response copy wins over `adagents.json` may change. `adagents.json` publishers cannot declare `experimental_features`, so consumers treat the collection fields as experimental wherever they appear. Sellers that emit the `sample_content` role or response `collections`, or accept `include_collections`, declare the id. Whether a follower count belongs on the distribution entry, and how sellers report platform-rounded counts, may change. Audience composition (`audience_evidence`) and average views (forecast `views`) reuse existing surfaces and are not part of this surface. |
| `brand.collection_links` | The `collections` field on the [`get_brand_identity`](/docs/brand-protocol/tasks/get_brand_identity) response and its `collections` value in the request `fields` and response `available_fields` lists, plus `publisher_domain` on `brand.json` brand-level collection links (#8137) | Brand-side half of the creator-card work: lets a buyer go from a talent's `brand_ref` to the person's channels and confirm the link from both sides. One adopter so far (Availnet, a creator marketplace). The link shape, the public visibility level, and whether `seller_agent_url` stays on the link may change. `brand.json` publishers cannot declare `experimental_features`, so consumers treat `publisher_domain` there as experimental. Brand agents that return `collections` declare the id. |
+| `signing.web_bot_auth` | The [Web Bot Auth request-signing profile](/docs/building/by-layer/L1/wba-profile): the `web-bot-auth` value in `request_signing.profiles` and `webhook_signing.profiles` on [`get_adcp_capabilities`](/docs/protocol/get_adcp_capabilities), and `signing_profile` on every webhook registration, adopted by DR-0023 | The profile follows an IETF draft that is still changing. The draft revision it pins and the `Signature-Agent` form may change before graduation. |
Graduation progress and notice of upcoming breaking changes will be called out in the [release notes](/docs/reference/release-notes) for each 3.x release starting with 3.0 GA.
diff --git a/docs/reference/release-notes.mdx b/docs/reference/release-notes.mdx
index eb3cdd408d8..073589f230f 100644
--- a/docs/reference/release-notes.mdx
+++ b/docs/reference/release-notes.mdx
@@ -91,6 +91,7 @@ Per the [experimental status contract](/docs/reference/experimental-status#gradu
| `media_buy.collection_cards` | Collection `images`, `sample_content`, `url`; talent `brand_ref`; `distribution[].followers`; response `collections` with `include_collections` (#8094, #8098, #8141) | New in 3.3; experimental | Array bounds, the copy-wins field list, and follower-count placement may change. |
| `media_buy.collection_catalog` | `list_collections`, `collections_version` tokens, and collection card webhook events (#8279) | New in 3.3; experimental, no emitting agent yet | Requires `media_buy.collection_cards`; webhook shape may change. |
| `brand.collection_links` | `collections` on `get_brand_identity` and `publisher_domain` on brand.json collection links (#8141) | New in 3.3; experimental | Link shape, visibility, and `seller_agent_url` may change. |
+| `signing.web_bot_auth` | The Web Bot Auth profile: `web-bot-auth` in `request_signing.profiles` and `webhook_signing.profiles`, and `signing_profile` on webhook registrations (#7894) | New in 3.3; experimental | The pinned draft revision and the `Signature-Agent` form may change. |
| `media_buy.reporting_delivery` | Reliable Reporting 1.0; `REVISION_UNREADABLE` shipped in 3.2.4 (#8099) | Still experimental; two active breaking-change notices | The [consumer-status requirement](/docs/reference/migration/reliable-reporting-status-loop) has not merged; it may land no earlier than the first minor after October 24, 2026. [Superseded snapshot compaction](/docs/reference/migration/3-2-to-3-3#superseded-reporting-snapshots-may-be-compacted) (#8100) takes effect no earlier than the first minor after November 20, 2026, so not in 3.3 if 3.3 ships before then. |
| `protocol.principal`, `account.change_feed`, `brand.rights_lifecycle`, `measurement.core`, `measurement.gateway`, `trusted_match.core`, `trusted_match.verified_identity`, `sponsored_intelligence.core`, `creative.evaluator`, `creative.signal_fanout`, `media_buy.audience_activation`, `media_buy.execution_requirements`, `media_buy.product_identity` | Unchanged in 3.3 | Still experimental | None merged. Open proposals that touch them are in the [3.3 beta program](/docs/reference/3-3-beta#in-review-for-3-3). |
diff --git a/docs/reference/test-vectors/index.mdx b/docs/reference/test-vectors/index.mdx
index a8437e5cfeb..60e6892028c 100644
--- a/docs/reference/test-vectors/index.mdx
+++ b/docs/reference/test-vectors/index.mdx
@@ -31,6 +31,7 @@ SDKs SHOULD fetch versioned paths where available and record the version under t
| [`supply-path`](https://github.com/adcontextprotocol/adcp/tree/main/static/compliance/source/test-vectors/supply-path) | Fail-closed owner-sold supply-path states, leg diagnostics, collection/property scope, revocations and applicable IAB evidence | `static/compliance/source/test-vectors/supply-path/` | `/compliance/latest/test-vectors/supply-path/` |
| [`reporting-summary`](https://github.com/adcontextprotocol/adcp/tree/main/static/compliance/source/test-vectors/reporting-summary) | Future expectations in complete reporting summaries, scope guards, timestamp formats, and unchanged view and health constraints (next 3.2 RC) | `static/compliance/source/test-vectors/reporting-summary/` | `/compliance/latest/test-vectors/reporting-summary/` |
| [`request-signing`](https://github.com/adcontextprotocol/adcp/tree/main/static/compliance/source/test-vectors/request-signing) | RFC 9421 request-signing profile: canonical signature base, covered components, signature params, tag namespace, alg allowlist, `adcp_use` discriminator, replay dedup, revocation, content-digest semantics, and URL canonicalization | `static/compliance/source/test-vectors/request-signing/` | `/compliance/latest/test-vectors/request-signing/` |
+| [`wba-profile`](https://github.com/adcontextprotocol/adcp/tree/main/static/compliance/source/test-vectors/wba-profile) | Web Bot Auth request-signing profile, experimental in 3.3 (DR-0023): covered `Signature-Agent` member, key selection by JWK thumbprint from the directory at the named origin, required `nonce` and replay rejection, one signature per request, signed directory responses (WBA Appendix B.1), `400`/`403`/`429` status-code outcomes, and failure scenarios as data | `static/compliance/source/test-vectors/wba-profile/` | `/compliance/latest/test-vectors/wba-profile/` |
| [`webhook-signing`](https://github.com/adcontextprotocol/adcp/tree/main/static/compliance/source/test-vectors/webhook-signing) | RFC 9421 webhook-signing profile: required covered components (content-digest mandatory — no `forbidden` opt-out), `adcp/webhook-signing/v1` tag, webhook-valid `adcp_use` set (`request-signing` plus deprecated `webhook-signing`), `webhook_signature_*` error taxonomy; shares `@target-uri` canonicalization with `request-signing` | `static/compliance/source/test-vectors/webhook-signing/` | `/compliance/latest/test-vectors/webhook-signing/` |
| [`plan-hash`](https://github.com/adcontextprotocol/adcp/tree/main/static/compliance/source/test-vectors/plan-hash) | JCS canonicalization of the `plan_hash` preimage: required-only baseline, full-optional, bookkeeping-stripped, omitted-vs-explicit-null, array-order sensitivity, `ext.trace_id` distinctness, Unicode non-normalization (RFC 8785 §3.2.5) | `static/compliance/source/test-vectors/plan-hash/` | `/compliance/latest/test-vectors/plan-hash/` |
| [`definition-pins`](https://github.com/adcontextprotocol/adcp/tree/main/static/compliance/source/test-vectors/definition-pins) | Definition pin preimage per `ref_kind`: verbatim published entry minus the exclusion list, named set arrays de-duplicated and sorted by UTF-8 JCS bytes, rename-is-not-drift versus `content_rating`-is-drift, unnamed-member and `__proto__` inclusion, non-I-JSON rejection, pin ordering, and a collection mutation that leaves `terms_digest` valid while the pin fails | `static/compliance/source/test-vectors/definition-pins/` | `/compliance/latest/test-vectors/definition-pins/` |
diff --git a/package.json b/package.json
index 150fa903ef5..9cb27f6f3b9 100644
--- a/package.json
+++ b/package.json
@@ -69,6 +69,7 @@
"test:oauth-setup-vectors": "node --test --test-force-exit --test-timeout=30000 tests/oauth-setup-vectors.test.cjs",
"test:a2a-profile-extension": "node --test --test-force-exit --test-timeout=30000 tests/a2a-profile-extension-v3.test.cjs",
"test:transport-errors": "node scripts/generate-request-signing-profile-3.2-vectors.mjs --check && node scripts/generate-request-signing-a2a-vectors.mjs --check && node --test --test-force-exit --test-timeout=30000 tests/transport-error-mapping.test.cjs tests/request-signing-body-integrity.test.cjs tests/request-signing-profile-3.2-vectors.test.cjs tests/request-signing-a2a-vectors.test.cjs",
+ "test:wba-profile-vectors": "node scripts/generate-wba-profile-vectors.mjs --check && node --test --test-force-exit --test-timeout=30000 tests/wba-profile-vectors.test.cjs",
"test:targeting-overlay-vectors": "node --test --test-force-exit --test-timeout=30000 tests/media-buy-targeting-overlay-vectors.test.cjs",
"test:targeting-null-clear": "node --test --test-force-exit --test-timeout=30000 tests/targeting-null-clear.test.cjs",
"test:targeting-aware-discovery": "node --test --test-force-exit --test-timeout=30000 tests/targeting-aware-discovery.test.cjs tests/product-coverage-filters.test.cjs",
@@ -168,7 +169,7 @@
"audit:verification-profile-shadow": "tsx server/src/scripts/audit-verification-profile-shadow.ts",
"test:schema-utf8": "node scripts/normalize-schema-utf8.mjs --check",
"fix:schema-utf8": "node scripts/normalize-schema-utf8.mjs",
- "test": "npm run test:sdk-response-conformance && npm run test:docs-nav && npm run test:owned-links && npm run test:release-docs-nav && npm run test:rewrite-dist-redirect-links && npm run test:rewrite-dist-links-idempotency && npm run test:docs-error-handling-copy && npm run test:schemas && npm run test:performance-feedback && npm run test:mcp-schema-projection && npm run test:dist-schema-version-ids && npm run test:examples && npm run test:extensions && npm run test:extension-schemas && npm run test:error-handling && npm run test:json-schema && npm run test:audio-radio && npm run test:adagents-catalog-only && npm run test:fast-channel-collections && npm run test:collection-selection-echo && npm run test:canonical-reference-resolver && npm run test:composed && npm run test:rejection-arm-mutex && npm run test:migrations && npm run test:hmac-vectors && npm run test:hmac-signer-conformance && npm run test:webhook-signing-vectors && npm run test:functional-request-signing-contract && npm run test:webhook-receiver-envelope && npm run test:webhook-emission-storyboard && npm run test:oauth-setup-vectors && npm run test:a2a-profile-extension && npm run test:transport-errors && npm run test:targeting-overlay-vectors && npm run test:targeting-null-clear && npm run test:targeting-aware-discovery && npm run test:demographic-targeting && npm run test:audience-activation-methods && npm run test:principal && npm run test:audience-external-sources && npm run test:language-targeting && npm run test:availability-horizon && npm run test:attestation-vectors && npm run test:rights-attestations && npm run test:governance-runtime-attestations && npm run test:governance-conditions-storyboard && npm run test:signal-governance-storyboard && npm run test:governance-task-slices && npm run test:audience-evidence && npm run test:status-as-of-vectors && npm run test:storyboard-scoping && npm run test:storyboard-branch-sets && npm run test:storyboard-provides-state-for && npm run test:storyboard-fixture-resolution && npm run test:storyboard-contradictions && npm run test:storyboard-context-entity && npm run test:storyboard-auth-shape && npm run test:storyboard-test-kits && npm run test:storyboard-buyer-fixture-lifecycle-tools && npm run test:storyboard-buyer-fixture-products && npm run test:compliance-packaged-refs && npm run test:compliance-source-authority && npm run test:storyboard-sample-request-schema && npm run test:storyboard-response-schema && npm run test:storyboard-context-output-paths && npm run test:storyboard-context-resolution && npm run test:storyboard-validations-paths && npm run test:storyboard-check-enum && npm run test:update-media-buy-affected-packages && npm run test:storyboard-advisory-expiry && npm run test:storyboard-controller-requires && npm run test:storyboard-raw-mode-required && npm run test:storyboard-upstream-traffic-paths && npm run test:storyboard-generate-phase-scope && npm run test:refine-finalize-validation-ids && npm run test:run-storyboards-schema-root && npm run test:storyboard-doc-parity && npm run test:v4-compatibility-registry && npm run test:pagination-invariant && npm run test:version-envelope && npm run test:test-dynamic-imports && npm run test:sdk-shims && npm run test:format-identity-boundaries && npm run test:sdk-runner-capability-gates && npm run test:callapi-state-change && npm run test:sign-protocol-tarball && npm run test:chat-streaming-code-fences && npm run test:certification-demo-formatting && npm run test:build-schemas-hoist-enums && npm run test:build-schemas-hoist-marked && npm run test:build-schemas-hoist-by-identity && npm run test:build-schemas-async-response-refs && npm run test:build-schemas-vendor-metric-uniqueness && npm run test:release-workflow && npm run test:immutable-release-artifacts && npm run test:patch-3-0-compat-bundle && npm run test:error-codes && npm run test:compliance-snippets && npm run test:doc-compliance-drift && npm run test:substitution-vector-names && npm run test:platform-agnostic && npm run test:oneof-discriminators && npm run test:schema-utf8 && npm run test:unit && npm run test:server-unit && npm run test:openapi && npm run typecheck && npm run test:contracts && npm run test:example-validation && npm run test:test-coverage",
+ "test": "npm run test:sdk-response-conformance && npm run test:docs-nav && npm run test:owned-links && npm run test:release-docs-nav && npm run test:rewrite-dist-redirect-links && npm run test:rewrite-dist-links-idempotency && npm run test:docs-error-handling-copy && npm run test:schemas && npm run test:performance-feedback && npm run test:mcp-schema-projection && npm run test:dist-schema-version-ids && npm run test:examples && npm run test:extensions && npm run test:extension-schemas && npm run test:error-handling && npm run test:json-schema && npm run test:audio-radio && npm run test:adagents-catalog-only && npm run test:fast-channel-collections && npm run test:collection-selection-echo && npm run test:canonical-reference-resolver && npm run test:composed && npm run test:rejection-arm-mutex && npm run test:migrations && npm run test:hmac-vectors && npm run test:hmac-signer-conformance && npm run test:webhook-signing-vectors && npm run test:functional-request-signing-contract && npm run test:webhook-receiver-envelope && npm run test:webhook-emission-storyboard && npm run test:oauth-setup-vectors && npm run test:a2a-profile-extension && npm run test:transport-errors && npm run test:wba-profile-vectors && npm run test:targeting-overlay-vectors && npm run test:targeting-null-clear && npm run test:targeting-aware-discovery && npm run test:demographic-targeting && npm run test:audience-activation-methods && npm run test:principal && npm run test:audience-external-sources && npm run test:language-targeting && npm run test:availability-horizon && npm run test:attestation-vectors && npm run test:rights-attestations && npm run test:governance-runtime-attestations && npm run test:governance-conditions-storyboard && npm run test:signal-governance-storyboard && npm run test:governance-task-slices && npm run test:audience-evidence && npm run test:status-as-of-vectors && npm run test:storyboard-scoping && npm run test:storyboard-branch-sets && npm run test:storyboard-provides-state-for && npm run test:storyboard-fixture-resolution && npm run test:storyboard-contradictions && npm run test:storyboard-context-entity && npm run test:storyboard-auth-shape && npm run test:storyboard-test-kits && npm run test:storyboard-buyer-fixture-lifecycle-tools && npm run test:storyboard-buyer-fixture-products && npm run test:compliance-packaged-refs && npm run test:compliance-source-authority && npm run test:storyboard-sample-request-schema && npm run test:storyboard-response-schema && npm run test:storyboard-context-output-paths && npm run test:storyboard-context-resolution && npm run test:storyboard-validations-paths && npm run test:storyboard-check-enum && npm run test:update-media-buy-affected-packages && npm run test:storyboard-advisory-expiry && npm run test:storyboard-controller-requires && npm run test:storyboard-raw-mode-required && npm run test:storyboard-upstream-traffic-paths && npm run test:storyboard-generate-phase-scope && npm run test:refine-finalize-validation-ids && npm run test:run-storyboards-schema-root && npm run test:storyboard-doc-parity && npm run test:v4-compatibility-registry && npm run test:pagination-invariant && npm run test:version-envelope && npm run test:test-dynamic-imports && npm run test:sdk-shims && npm run test:format-identity-boundaries && npm run test:sdk-runner-capability-gates && npm run test:callapi-state-change && npm run test:sign-protocol-tarball && npm run test:chat-streaming-code-fences && npm run test:certification-demo-formatting && npm run test:build-schemas-hoist-enums && npm run test:build-schemas-hoist-marked && npm run test:build-schemas-hoist-by-identity && npm run test:build-schemas-async-response-refs && npm run test:build-schemas-vendor-metric-uniqueness && npm run test:release-workflow && npm run test:immutable-release-artifacts && npm run test:patch-3-0-compat-bundle && npm run test:error-codes && npm run test:compliance-snippets && npm run test:doc-compliance-drift && npm run test:substitution-vector-names && npm run test:platform-agnostic && npm run test:oneof-discriminators && npm run test:schema-utf8 && npm run test:unit && npm run test:server-unit && npm run test:openapi && npm run typecheck && npm run test:contracts && npm run test:example-validation && npm run test:test-coverage",
"test:all": "npm run test:schemas && npm run test:examples && npm run test:extensions && npm run test:error-handling && npm run test:snippets && npm run typecheck",
"precommit:server-unit": "node scripts/precommit-server-unit.cjs",
"precommit": "bash scripts/with-timeout.sh 300 npm run test:unit && npm run test:test-dynamic-imports && npm run test:format-identity-boundaries && npm run test:callapi-state-change && bash scripts/with-timeout.sh 1500 npm run precommit:server-unit && npm run typecheck",
diff --git a/scripts/generate-wba-profile-vectors.mjs b/scripts/generate-wba-profile-vectors.mjs
new file mode 100644
index 00000000000..ff158b78695
--- /dev/null
+++ b/scripts/generate-wba-profile-vectors.mjs
@@ -0,0 +1,456 @@
+#!/usr/bin/env node
+/**
+ * Generates the Web Bot Auth profile conformance vectors under
+ * static/compliance/source/test-vectors/wba-profile/.
+ *
+ * Keys: every private key is an Ed25519 seed derived as
+ * SHA-256("rfc004-test/"), so anyone can reproduce every signature.
+ * Each kid is the RFC 7638 JWK thumbprint (RFC 8037 Appendix A.3 for Ed25519).
+ * Nonces are base64url(SHA-512("rfc004-test/nonce/")), 64 bytes.
+ *
+ * Signatures: each RFC 9421 signature base is written out component by
+ * component, followed by the "@signature-params" line, and signed with
+ * Ed25519. Ed25519 is deterministic, so the output is byte-stable and
+ * `--check` can compare it with the committed files.
+ *
+ * Negative vectors each break exactly one profile rule. Those that carry a
+ * valid signature verify once the targeted check is skipped; the test suite
+ * (tests/wba-profile-vectors.test.cjs) proves that for each of them.
+ *
+ * Usage:
+ * node scripts/generate-wba-profile-vectors.mjs # write
+ * node scripts/generate-wba-profile-vectors.mjs --check # verify committed files are current
+ *
+ * The keys are public test keys (Web Bot Auth section 6.8). Never use them in production.
+ */
+
+import { createECDH, createHash, createPrivateKey, createPublicKey, sign } from 'node:crypto';
+import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
+import { dirname, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
+const VECTOR_DIR = join(ROOT, 'static/compliance/source/test-vectors/wba-profile');
+const SCRIPT = 'scripts/generate-wba-profile-vectors.mjs';
+const SPEC = 'docs/building/by-layer/L1/wba-profile.mdx';
+
+const b64 = buf => Buffer.from(buf).toString('base64');
+const b64u = buf => Buffer.from(buf).toString('base64url');
+const sha = (alg, data) => createHash(alg).update(data).digest();
+
+// PKCS#8 DER prefix for a raw 32-byte Ed25519 seed (RFC 8410).
+const ED25519_PKCS8_PREFIX = Buffer.from('302e020100300506032b657004220420', 'hex');
+
+function key(seedName) {
+ const seed = sha('sha256', `rfc004-test/${seedName}`);
+ const privateKey = createPrivateKey({ key: Buffer.concat([ED25519_PKCS8_PREFIX, seed]), format: 'der', type: 'pkcs8' });
+ const { x } = createPublicKey(privateKey).export({ format: 'jwk' });
+ const kid = b64u(sha('sha256', JSON.stringify({ crv: 'Ed25519', kty: 'OKP', x })));
+ return { privateKey, jwk: { kty: 'OKP', crv: 'Ed25519', kid, x, use: 'sig' }, d: b64u(seed) };
+}
+
+const nonce = name => b64u(sha('sha512', `rfc004-test/nonce/${name}`));
+const digest = body => `sha-256=:${b64(sha('sha256', body))}:`;
+
+function signBase(privateKey, lines, params) {
+ const base = [...lines, `"@signature-params": ${params}`].join('\n');
+ return [base, b64(sign(null, Buffer.from(base), privateKey))];
+}
+
+// ── Identities and keys ───────────────────────────────────────────────────
+const BUYER = 'https://buyer-7k3q.com';
+const BRAND = 'https://agent.brand-7k3q.com';
+const buyer = key('buyer-request');
+const brand = key('brand-request');
+
+const files = {};
+const write = (rel, doc) => {
+ files[rel] = doc;
+};
+
+write('keys.json', {
+ $comment:
+ "Public test keys for the Web Bot Auth profile conformance vectors. The private seeds are published so that implementations can reproduce every signature. Each seed is SHA-256 of the ASCII string 'rfc004-test/'. Web Bot Auth section 6.8: test keys MUST NOT be used in production, and verifiers SHOULD reject them when detected. Each kid is the RFC 7638 JWK thumbprint (RFC 8037 Appendix A.3 for Ed25519). Each entry's identity is the origin whose key directory publishes the key.",
+ keys: [
+ { identity: BUYER, seed_name: 'buyer-request', ...buyer.jwk, _private_d_for_test_only: buyer.d },
+ { identity: BRAND, seed_name: 'brand-request', ...brand.jwk, _private_d_for_test_only: brand.d },
+ ],
+});
+
+// ── Shared request ────────────────────────────────────────────────────────
+const SELLER = 'seller-7k3q.com';
+const TARGET = `https://${SELLER}/mcp/`;
+const CREATED = 1790841600;
+const EXPIRES = 1790841900;
+const NOW = CREATED + 10;
+const ZERO_SIG = b64(Buffer.alloc(64));
+
+const body = JSON.stringify({
+ jsonrpc: '2.0',
+ id: 7,
+ method: 'tools/call',
+ params: {
+ name: 'create_media_buy',
+ arguments: {
+ idempotency_key: '4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96',
+ account: { account_id: 'acc_42' },
+ proposal_id: 'prop_7',
+ total_budget: { amount: 25000, currency: 'USD' },
+ },
+ },
+});
+const bodyDigest = digest(body);
+
+const REQUEST_COMPONENTS = ['@method', '@target-uri', '@authority', 'content-type', 'content-digest'];
+
+function compList(label, extra = [], includeAgent = true) {
+ const comps = REQUEST_COMPONENTS.map(c => `"${c}"`);
+ if (includeAgent) comps.push(`"signature-agent";key="${label}"`);
+ return `(${[...comps, ...extra].join(' ')})`;
+}
+
+function requestLines(label, agentUrl, includeAgent = true) {
+ const lines = [
+ '"@method": POST',
+ `"@target-uri": ${TARGET}`,
+ `"@authority": ${SELLER}`,
+ '"content-type": application/json',
+ `"content-digest": ${bodyDigest}`,
+ ];
+ if (includeAgent) lines.push(`"signature-agent";key="${label}": "${agentUrl}"`);
+ return lines;
+}
+
+function params(comps, kid, n, created = CREATED, expires = EXPIRES) {
+ let p = `${comps};created=${created};expires=${expires}`;
+ if (n !== null) p += `;nonce="${n}"`;
+ return `${p};keyid="${kid}";alg="ed25519";tag="web-bot-auth"`;
+}
+
+const headers = (agent, sigInput, sig) => ({
+ 'Content-Type': 'application/json',
+ 'Content-Digest': bodyDigest,
+ 'Signature-Agent': agent,
+ 'Signature-Input': sigInput,
+ Signature: sig,
+});
+
+const request = h => ({ method: 'POST', url: TARGET, headers: h, body });
+
+/** The Accept-Signature member the verifier sends with a 403 or a 429 (RFC 9421 section 5.1). */
+function acceptSignature(label, components, freshNonce = false) {
+ const doc = { label, components, parameters: ['created', 'expires', 'nonce', 'keyid', 'alg', 'tag'], tag: 'web-bot-auth' };
+ if (freshNonce) doc.nonce = 'verifier-chosen';
+ return doc;
+}
+
+const REFUSAL_NOTE =
+ 'The profile reports signature failures with HTTP status codes (Web Bot Auth sections 5.3 and 5.4). Conformance grades the status code. On a 403 or 429, the AdCP layer SHOULD add Accept-Signature naming the components and parameters the profile requires, so the signer can sign again (security.mdx, AdCP checks after Web Bot Auth verification); the accept_signature object describes that header, and the exact serialization is RFC 9421 section 5.1.';
+
+// ── Positive 001: single signer ───────────────────────────────────────────
+const c1 = compList('sig1');
+const p1 = params(c1, buyer.jwk.kid, nonce('buyer'));
+const [base1, sig1] = signBase(buyer.privateKey, requestLines('sig1', BUYER), p1);
+const h1 = headers(`sig1="${BUYER}"`, `sig1=${p1}`, `sig1=:${sig1}:`);
+write('positive/001-single-signer-request.json', {
+ name: 'Single signer: buyer agent at https://buyer-7k3q.com sends create_media_buy over MCP',
+ spec_reference: `${SPEC}#profile-rules`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW,
+ request: request(h1),
+ directories: { [BUYER]: { keys_ref: [buyer.jwk.kid] } },
+ expected_signature_base: { sig1: base1 },
+ expected_outcome: { success: true, identities: { sig1: BUYER } },
+ $comment:
+ 'The Signature-Agent member sig1 names an origin, so the verifier fetches https://buyer-7k3q.com/.well-known/http-message-signatures-directory, selects the key whose kid equals keyid, and attributes the request to that origin. Ed25519 is deterministic, so an implementation signing with the published seed reproduces the Signature value byte for byte.',
+});
+
+// ── Positive 002: signed key directory response ───────────────────────────
+const dirBody = JSON.stringify({ keys: [buyer.jwk] }, null, 2);
+const dirDigest = digest(dirBody);
+const dirParams = `("@authority";req "content-digest");created=1790841000;expires=1790927400;keyid="${buyer.jwk.kid}";alg="ed25519";tag="http-message-signatures-directory"`;
+const [dirBase, dirSig] = signBase(buyer.privateKey, ['"@authority";req: buyer-7k3q.com', `"content-digest": ${dirDigest}`], dirParams);
+write('positive/002-signed-directory-response.json', {
+ name: 'Signed key directory response for https://buyer-7k3q.com, one signature per key',
+ spec_reference: `${SPEC}#key-directories`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW,
+ request: {
+ method: 'GET',
+ url: `${BUYER}/.well-known/http-message-signatures-directory`,
+ headers: { Host: 'buyer-7k3q.com', Accept: 'application/http-message-signatures-directory+json' },
+ body: '',
+ },
+ response: {
+ status: 200,
+ headers: {
+ 'Content-Type': 'application/http-message-signatures-directory+json',
+ 'Cache-Control': 'max-age=300',
+ 'Content-Digest': dirDigest,
+ 'Signature-Input': `key1=${dirParams}`,
+ Signature: `key1=:${dirSig}:`,
+ },
+ body: dirBody,
+ },
+ expected_signature_base: { key1: dirBase },
+ expected_outcome: { success: true, identities: { key1: BUYER } },
+ $comment:
+ 'Web Bot Auth Appendix B.1: the directory server signs the response once per key, covering "@authority";req and content-digest, with created, expires, the key\'s thumbprint as keyid, and tag http-message-signatures-directory. The verifier validates the signature with the key the directory itself provides and validates Content-Digest against the body. Covering the request authority stops the key set from being served again from another domain. The verifier stores the signed response as its audit record of the fetch.',
+});
+
+// ── Negative 001: missing nonce ───────────────────────────────────────────
+const pNn = params(c1, buyer.jwk.kid, null);
+const [baseNn, sigNn] = signBase(buyer.privateKey, requestLines('sig1', BUYER), pNn);
+write('negative/001-missing-nonce.json', {
+ name: 'Signature-Input omits the nonce parameter',
+ spec_reference: `${SPEC}#replay-protection`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW,
+ request: request(headers(`sig1="${BUYER}"`, `sig1=${pNn}`, `sig1=:${sigNn}:`)),
+ directories: { [BUYER]: { keys_ref: [buyer.jwk.kid] } },
+ expected_signature_base: { sig1: baseNn },
+ expected_outcome: {
+ success: false,
+ status: 403,
+ accept_signature: acceptSignature('sig1', c1),
+ reason: 'The profile requires an RFC 9421 nonce on every signed request. Without one the verifier cannot detect replay.',
+ },
+ $comment: `The signature is cryptographically valid over its covered components, so a verifier that does not enforce the nonce requirement accepts it. The verifier answers 403, and the Accept-Signature hint lists nonce among the required parameters. ${REFUSAL_NOTE}`,
+});
+
+// ── Negative 002: replayed nonce ──────────────────────────────────────────
+write('negative/002-replayed-nonce.json', {
+ name: 'Second submission of a request whose (identity, nonce) pair the verifier has already accepted',
+ spec_reference: `${SPEC}#replay-protection`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW + 5,
+ request: request(h1),
+ directories: { [BUYER]: { keys_ref: [buyer.jwk.kid] } },
+ test_harness_state: {
+ $comment:
+ 'Preload the replay cache as if positive/001 was just verified. White-box harnesses inject the entry; black-box runners send positive/001 twice and grade the second response.',
+ replay_cache_entries: [{ identity: BUYER, nonce: nonce('buyer'), ttl_seconds: 360 }],
+ },
+ expected_signature_base: { sig1: base1 },
+ expected_outcome: {
+ success: false,
+ status: 429,
+ accept_signature: acceptSignature('sig1', c1, true),
+ reason: "The verifier MUST reject a nonce it has already seen for the same identity within the signature's lifetime.",
+ },
+ $comment: `The request is byte-identical to positive/001-single-signer-request.json. The verifier checks the nonce per signature and per identity, whether or not an edge verifier ran first. The Accept-Signature hint on the 429 carries a verifier-chosen nonce value (Web Bot Auth section 5.3; RFC 9421 sections 5.1 and 7.2.2), which the signer uses on its next attempt; the value is not pinned by this vector. ${REFUSAL_NOTE}`,
+});
+
+// ── Negative 003: Signature-Agent present but not covered ─────────────────
+const cUnc = compList('sig1', [], false);
+const pUnc = params(cUnc, buyer.jwk.kid, nonce('buyer-uncovered'));
+const [baseUnc, sigUnc] = signBase(buyer.privateKey, requestLines('sig1', BUYER, false), pUnc);
+write('negative/003-signature-agent-not-covered.json', {
+ name: 'Signature-Agent header present, but the sig1 member is not a covered component',
+ spec_reference: `${SPEC}#profile-rules`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW,
+ request: request(headers(`sig1="${BUYER}"`, `sig1=${pUnc}`, `sig1=:${sigUnc}:`)),
+ directories: { [BUYER]: { keys_ref: [buyer.jwk.kid] } },
+ expected_signature_base: { sig1: baseUnc },
+ expected_outcome: {
+ success: false,
+ status: 403,
+ accept_signature: acceptSignature('sig1', c1),
+ reason:
+ 'Web Bot Auth section 5.2.1: the Signature-Agent member keyed to the signature label MUST be signed as a component. An uncovered member is an unverified claim and MUST NOT be attributed (section 4.1).',
+ },
+ $comment: `The signature verifies over the components it does cover, so a verifier that reads the identity from the uncovered header and skips the coverage check accepts it and attributes the request to an origin nobody signed for. ${REFUSAL_NOTE}`,
+});
+
+// ── Negative 004: key not in the directory the header names ───────────────
+const pWrong = params(c1, buyer.jwk.kid, nonce('buyer-claims-brand'));
+const [baseWrong, sigWrong] = signBase(buyer.privateKey, requestLines('sig1', BRAND), pWrong);
+write('negative/004-key-not-in-named-directory.json', {
+ name: 'Signature-Agent names https://agent.brand-7k3q.com, but the signing key is published only by https://buyer-7k3q.com',
+ spec_reference: `${SPEC}#identity`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW,
+ request: request(headers(`sig1="${BRAND}"`, `sig1=${pWrong}`, `sig1=:${sigWrong}:`)),
+ directories: { [BRAND]: { keys_ref: [brand.jwk.kid] }, [BUYER]: { keys_ref: [buyer.jwk.kid] } },
+ expected_signature_base: { sig1: baseWrong },
+ expected_outcome: {
+ success: false,
+ status: 403,
+ accept_signature: acceptSignature('sig1', c1),
+ reason:
+ 'Key lookup is keyed on the (origin, keyid) pair, never on keyid alone (Web Bot Auth section 5.4). The directory at the named origin holds no key with this thumbprint, so the request is unverified and MUST NOT be attributed to that origin (section 6.10).',
+ },
+ $comment: `The signature is valid under the buyer agent's key, and the directories object lists that key under its own origin so the harness can show the trap: a verifier that indexes keys by thumbprint alone finds the key, verifies, and attributes the request to the brand agent, an origin that never published the key. A conformant verifier resolves only https://agent.brand-7k3q.com/.well-known/http-message-signatures-directory and rejects. ${REFUSAL_NOTE}`,
+});
+
+// ── Negative 005: unparseable Signature-Agent ─────────────────────────────
+write('negative/005-malformed-signature-agent.json', {
+ name: 'Signature-Agent is not a parseable Structured Field Dictionary (unterminated string)',
+ spec_reference: `${SPEC}#error-responses`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW,
+ request: request(headers(`sig1="${BUYER}`, `sig1=${p1}`, `sig1=:${ZERO_SIG}:`)),
+ directories: { [BUYER]: { keys_ref: [buyer.jwk.kid] } },
+ expected_outcome: {
+ success: false,
+ status: 400,
+ reason: 'Web Bot Auth section 5.4: a verifier that fails to parse Signature, Signature-Input, or Signature-Agent answers 400 Bad Request.',
+ },
+ $comment:
+ "Signature is a 64-zero-byte placeholder: parsing fails before any key is resolved or any signature is checked, so a verifier that reaches cryptographic verification has skipped the parse step. No Accept-Signature is sent, because the signer's headers, not its signature, need fixing.",
+});
+
+// ── Negative 006: two web-bot-auth signatures on one request ──────────────
+const c2 = compList('sig2');
+const p2 = params(c2, brand.jwk.kid, nonce('brand'));
+const [base2, sig2] = signBase(brand.privateKey, requestLines('sig2', BRAND), p2);
+write('negative/006-two-signatures.json', {
+ name: 'Two web-bot-auth signatures on one request: positive/001 plus a second valid signature from https://agent.brand-7k3q.com',
+ spec_reference: `${SPEC}#verification`,
+ signing_profile: 'web-bot-auth',
+ reference_now: NOW,
+ request: request(headers(`sig1="${BUYER}", sig2="${BRAND}"`, `sig1=${p1}, sig2=${p2}`, `sig1=:${sig1}:, sig2=:${sig2}:`)),
+ directories: { [BUYER]: { keys_ref: [buyer.jwk.kid] }, [BRAND]: { keys_ref: [brand.jwk.kid] } },
+ expected_signature_base: { sig1: base1, sig2: base2 },
+ expected_outcome: {
+ success: false,
+ status: 403,
+ accept_signature: acceptSignature('sig1', c1),
+ reason:
+ 'The profile takes exactly one web-bot-auth signature and one Signature-Agent member per request (RFC 9421 section 3.2.1). Web Bot Auth section 5.2.2 permits more than one signature; the profile does not accept one.',
+ },
+ $comment: `The sig1 label is byte-identical to positive/001-single-signer-request.json, and the sig2 label is a second valid signature over the same request from another identity. Each verifies on its own against its own directory, so a verifier that loops over every label and accepts when each verifies has skipped the count check. ${REFUSAL_NOTE}`,
+});
+
+// ── Failure scenarios ─────────────────────────────────────────────────────
+// Scenarios are data, not signatures: a harness signs each one at run time
+// with the reference library, so nothing committed here expires. Times are
+// offsets in seconds from the harness's clock.
+//
+// tier "wba": the reference library with no AdCP policy already gives the
+// expected outcome. tier "adcp": it gives the opposite outcome, and only the
+// profile's rules give the expected one. A WBA MUST that the library does not
+// enforce is tier "adcp" until it does; the harness reports the change.
+const P256_SEED = sha('sha256', 'rfc004-test/p256-unused');
+const p256 = (() => {
+ const ecdh = createECDH('prime256v1');
+ ecdh.setPrivateKey(P256_SEED);
+ const point = ecdh.getPublicKey();
+ const jwk = { kty: 'EC', crv: 'P-256', x: b64u(point.subarray(1, 33)), y: b64u(point.subarray(33)) };
+ return { ...jwk, kid: b64u(sha('sha256', JSON.stringify({ crv: jwk.crv, kty: jwk.kty, x: jwk.x, y: jwk.y }))), use: 'sig' };
+})();
+
+// A fixed RSA-PSS public key, which the library imports and the profile does
+// not use. It never signs, so its private half was discarded.
+const rsaPss = (() => {
+ const jwk = { kty: 'RSA', e: 'AQAB', n: 'v-QEO4laYaq_rKgLuz0I8hRW_Ig58qmjv_L9cIX_2dCz6pkvMg953c3P3yNtvjl0eLiZNk1tbaWjfdwiMczGUYqhcFutwjbJpny5rMlSOuTkgJEidDpVpsSfa9OwmkRLgn_hjrAkQzKYljsqSN_U9deB6a_NwWiM03MRFLVtcCHJQMEVNCXGvqRIF0MKRVdb3287cgEQ2lvb0g1a84CYzQtbRdWcHnSjhOwF3Y2IH2A2VvQzeCSWWFy2LUr2H09Ce2pvAc-DJX6BdUF5MijFV9SRt4jbPWG28kcrLUEt1GMDynfvMT419dx03kfaZnHkh4I3xXKhcFAIMK4D1WH9bQ' };
+ return { ...jwk, alg: 'PS512', kid: b64u(sha('sha256', JSON.stringify({ e: jwk.e, kty: jwk.kty, n: jwk.n }))), use: 'sig' };
+})();
+
+const FULL = ['@method', '@target-uri', '@authority', 'content-type', 'content-digest', 'signature-agent;key={label}'];
+const ok = { success: true, identity: BUYER };
+const status = s => ({ success: false, status: s });
+// A directory refusal has no status of its own: the request that needed the key gets 403.
+const refused = { success: false };
+const req = (id, name, tier, expected, basis, fields = {}) => ({ id, name, base: 'post', ...fields, expected, tier, basis });
+const dirScenario = (id, name, tier, expected, basis, fields = {}) => ({ id, name, ...fields, expected, tier, basis });
+
+write('scenarios.json', {
+ $comment:
+ 'Failure scenarios for the Web Bot Auth profile, as data. A harness signs each request and directory scenario at run time with the reference library (http-message-sig signs any component and parameter set), applies after_signing, and grades the verifier on expected. created and expires are offsets in seconds from the harness clock; a null parameter is omitted; a nonce object asks for that many random bytes in that encoding. tier "wba": the reference library with no AdCP policy already gives the expected outcome. tier "adcp": the bare library gives the opposite outcome and only the profile rules give the expected one; a WBA MUST the library does not enforce stays "adcp" until it does. See README.md.',
+ spec_reference: `${SPEC}#profile-rules`,
+ signing_profile: 'web-bot-auth',
+ signer: { identity: BUYER, kid: buyer.jwk.kid },
+ requests: {
+ post: { method: 'POST', url: TARGET, headers: { 'content-type': 'application/json' }, body },
+ get: { method: 'GET', url: `${TARGET}tasks?id=a%7Eb&x=1`, headers: {}, body: '' },
+ },
+ components: { post: FULL, get: ['@method', '@target-uri', '@authority', 'signature-agent;key={label}'] },
+ parameters: { created: -5, expires: 295, nonce: { bytes: 64, encoding: 'base64url' }, tag: 'web-bot-auth' },
+ request_scenarios: [
+ req('R00', 'Baseline', 'wba', ok, 'Profile rules'),
+ req('R01', 'Body changed after signing', 'adcp', status(403), 'Content-Digest matches the body: RFC 9530; WBA section 5.2', { after_signing: { append_to_body: '\n' } }),
+ req('R02', 'Covered header changed after signing', 'wba', status(403), 'RFC 9421 section 3.2', { after_signing: { headers: { 'content-type': 'text/plain' } } }),
+ req('R03', 'Expired', 'wba', status(403), 'RFC 9421 section 3.2.1', { parameters: { created: -400, expires: -100 } }),
+ req('R04', 'created 120 seconds in the future', 'wba', status(403), 'Profile: 60 seconds of clock skew', { parameters: { created: 120, expires: 400 } }),
+ req('R05', 'created 30 seconds in the future', 'adcp', ok, 'Profile: 60 seconds of clock skew; the library allows none by default', { parameters: { created: 30, expires: 300 } }),
+ req('R06', 'Lifetime of 3600 seconds', 'adcp', status(403), 'Profile: expires at most 300 seconds after created', { parameters: { created: -5, expires: 3595 } }),
+ req('R07', 'Nonce of 32 bytes', 'wba', status(403), 'Profile: 64-byte nonce; validateNonce', { parameters: { nonce: { bytes: 32, encoding: 'base64url' } } }),
+ req('R08', 'Nonce in canonical padded base64', 'wba', ok, 'Profile: unpadded base64url or canonical padded base64', { parameters: { nonce: { bytes: 64, encoding: 'base64' } } }),
+ req('R09', 'Nonce in padded base64url', 'wba', status(403), 'Profile: unpadded base64url or canonical padded base64', { parameters: { nonce: { bytes: 64, encoding: 'base64url-padded' } } }),
+ req('R10', 'No alg parameter', 'wba', status(403), 'Profile: alg required', { parameters: { alg: null } }),
+ req('R11', 'alg other than ed25519', 'wba', status(403), 'Profile: alg is ed25519 and matches the key; RFC 9421 section 3.2', { parameters: { alg: 'ecdsa-p256-sha256' } }),
+ req('R12', 'GET covering only @authority and the Signature-Agent member', 'adcp', status(403), 'Profile: cover @method, @target-uri, and @authority; WBA section 5.2 needs one of @authority or @target-uri', { base: 'get', components: ['@authority', 'signature-agent;key=sig1'] }),
+ req('R13', 'Body without content-digest covered', 'adcp', status(403), 'Profile: a request with a body covers content-type and content-digest; WBA section 5.2', { components: ['@method', '@target-uri', '@authority', 'content-type', 'signature-agent;key=sig1'] }),
+ req('R14', 'tag other than web-bot-auth', 'wba', status(403), 'WBA section 5.2: tag MUST be web-bot-auth', { parameters: { tag: 'adcp/request-signing/v1' } }),
+ req('R15', 'Bare-string Signature-Agent', 'adcp', status(400), 'Profile: dictionary form only, so the field does not parse; WBA section 5.2.1 lets a verifier accept the bare string', { signature_agent: `"${BUYER}"`, components: [...FULL.slice(0, 5), 'signature-agent'] }),
+ req('R16', 'http:// Signature-Agent', 'adcp', status(403), 'WBA section 5.2.1: the origin MUST be https; the library accepts http (cloudflare/web-bot-auth#162)', { signature_agent: 'sig1="http://buyer-7k3q.com"', directories: { 'http://buyer-7k3q.com': [buyer.jwk.kid] } }),
+ req('R17', 'Signature-Agent with a path', 'adcp', status(403), 'WBA section 5.5: a directory member MUST be an origin; the library does not check it', { signature_agent: `sig1="${BUYER}/agents/a"` }),
+ req('R17c', 'Signature-Agent origin with a trailing /', 'adcp', status(403), 'Profile: the value is exactly the serialized origin (RFC 6454 section 6.2), compared without normalizing', { signature_agent: `sig1="${BUYER}/"` }),
+ req('R17d', 'Signature-Agent origin with an uppercase host', 'adcp', status(403), 'Profile: the value is exactly the serialized origin, with a lowercase host, compared without normalizing', { signature_agent: 'sig1="https://BUYER-7k3q.com"' }),
+ req('R17e', 'Signature-Agent origin with an explicit :443', 'adcp', status(403), 'Profile: the value is exactly the serialized origin, with no default port, compared without normalizing', { signature_agent: 'sig1="https://buyer-7k3q.com:443"' }),
+ req('R18', 'Signature-Agent member with type=jwks_uri', 'adcp', status(403), 'Profile: only type=directory; WBA section 5.2.1 lets a verifier ignore other types', { signature_agent: `sig1="${BUYER}";type=jwks_uri` }),
+ req('R18c', 'Signature-Agent member with type=directory as a Token', 'wba', ok, 'WBA section 5.2.1: type is a Token, and directory is the default', { signature_agent: `sig1="${BUYER}";type=directory` }),
+ req('R18d', 'Signature-Agent member with type="directory" as a String', 'wba', ok, 'Profile: a verifier accepts type=directory as a Token or a String, as the reference library does; WBA section 5.2.1 defines a Token', { signature_agent: `sig1="${BUYER}";type="directory"` }),
+ req('R19', 'Signature-Agent member keyed differently from the label', 'adcp', status(403), 'WBA section 5.2.1: the member keyed to the label; the library does not check it', { signature_agent: `agent1="${BUYER}"`, components: [...FULL.slice(0, 5), 'signature-agent;key=agent1'] }),
+ req('R19b', 'Whole Signature-Agent field covered before the member', 'wba', ok, 'RFC 9421 section 2.1: the field and its member are separate components; WBA section 5.2.1 requires only the member keyed to the label', { components: [...FULL.slice(0, 5), 'signature-agent', 'signature-agent;key=sig1'] }),
+ req('R20', 'Second signature with tag cdn-edge', 'adcp', ok, 'Profile: Signature-Input members with other tags are not read; the library requires a label when a request carries two signatures', {
+ extra_signature: { label: 'cdn', kid: brand.jwk.kid, components: ['@method', '@authority'], parameters: { created: -5, expires: 295, nonce: null, tag: 'cdn-edge' } },
+ }),
+ req('R20b', 'Second member with tag cdn-edge whose Signature value is a token', 'wba', status(400), 'RFC 9421 section 4.2: every Signature member value is a Byte Sequence, so the field is malformed whatever the member\'s tag; members with other tags are not read, but the field is still parsed', {
+ after_signing: { append_members: { 'signature-input': 'cdn=("@method" "@authority");tag="cdn-edge"', signature: 'cdn=edge-token' } },
+ }),
+ req('R21', 'Two Signature-Agent members, one signature', 'adcp', status(403), 'Profile: exactly one Signature-Agent member', { signature_agent: `sig1="${BUYER}", sig2="${BRAND}"` }),
+ req('R21b', 'Two web-bot-auth signatures that cover one Signature-Agent member', 'wba', status(403), 'Profile: exactly one web-bot-auth signature; WBA section 5.2.2 lets a request carry more', { extra_signature: { label: 'sig2', kid: buyer.jwk.kid, components: FULL.map(c => c.replace('{label}', 'sig1')), parameters: { created: -5, expires: 295, nonce: { bytes: 64, encoding: 'base64url' }, tag: 'web-bot-auth' } } }),
+ req('R22', 'Label other than sig1', 'wba', ok, 'RFC 9421: the signer chooses the label', { label: 'wba' }),
+ req('R23', 'Components in another order', 'wba', ok, "RFC 9421: the order is the signer's", { components: ['signature-agent;key=sig1', '@authority', 'content-digest', '@target-uri', 'content-type', '@method'] }),
+ ],
+ directory_scenarios: [
+ dirScenario('D00', 'Baseline', 'wba', { success: true }, 'WBA Appendix B.1'),
+ dirScenario('D01', 'Signed for another authority', 'wba', refused, 'WBA Appendix B.1: covers "@authority";req', { authority: 'agent.brand-7k3q.com' }),
+ dirScenario('D02', 'Body changed after signing', 'adcp', refused, 'WBA Appendix B.1: the verifier MUST validate Content-Digest; the library does not compare it with the body', { after_signing: { append_to_body: '\n' } }),
+ dirScenario('D03', 'Unsigned', 'adcp', refused, 'Profile: use only keys with a valid signature, so the directory yields no usable key; WBA Appendix B.1 lets a verifier use an unproven key', { keys: [], unsigned_keys: [buyer.jwk] }),
+ dirScenario('D04', 'Signature created in the future', 'wba', refused, 'WBA Appendix B.1: reject a future created', { parameters: { created: 3600, expires: 90000 } }),
+ dirScenario('D05', 'Covers "@authority";req only', 'adcp', refused, 'WBA Appendix B.1: covers content-digest', { components: ['@authority;req'] }),
+ dirScenario('D06', 'Expired signature', 'wba', refused, 'RFC 9421 section 3.2.1', { parameters: { created: -7200, expires: -3600 } }),
+ dirScenario('D07', 'Extra P-256 key that does not sign', 'wba', { success: true }, 'Profile: ignore keys the profile does not use (RFC 7517 section 5)', { unsigned_keys: [p256] }),
+ dirScenario('D08', 'Media type application/json', 'adcp', refused, 'WBA section 5.5.1: the well-known directory MUST be served with application/http-message-signatures-directory+json', { content_type: 'application/json' }),
+ dirScenario('D09', 'Directory served with status 203', 'adcp', refused, 'WBA section 5.5: a status other than 200 is a discovery failure', { status: 203 }),
+ dirScenario('D10', 'Signed with tag web-bot-auth', 'adcp', refused, 'WBA Appendix B.1: tag="http-message-signatures-directory"', { parameters: { tag: 'web-bot-auth' } }),
+ dirScenario('D11', 'Second Ed25519 key that does not sign', 'wba', { success: true }, 'Profile: ignore a key without a valid signature; WBA Appendix B.1; directory draft section 5', { unsigned_keys: [brand.jwk] }),
+ dirScenario('D12', 'Only a P-256 key, unsigned', 'adcp', refused, 'Profile: the directory yields no Ed25519 key with a valid signature', { keys: [], unsigned_keys: [p256] }),
+ dirScenario('D13', 'Extra RSA-PSS key that does not sign', 'wba', { success: true }, 'Profile: ignore keys the profile does not use (RFC 7517 section 5), including a key the library imports', { unsigned_keys: [rsaPss] }),
+ dirScenario('D14', 'Extra P-256 key that carries its private d', 'adcp', refused, 'Profile: refuse a directory in which any key carries a private member, checked before unused keys are skipped; WBA section 5.5.1: a verifier SHOULD reject malformed entries', { unsigned_keys: [{ ...p256, d: b64u(P256_SEED) }] }),
+ dirScenario('D14b', 'Signing Ed25519 key published with its private d', 'adcp', refused, 'Profile: refuse a directory in which any key carries a private member; WBA section 5.5.1: a verifier SHOULD reject malformed entries', { publish_private_members: true }),
+ dirScenario('D14c', 'Extra P-256 key that carries its private scalar as an upper-case D', 'adcp', refused, 'Profile: private member names compare without regard to case; WBA section 5.5.1: a verifier SHOULD reject malformed entries', { unsigned_keys: [{ ...p256, D: b64u(P256_SEED) }] }),
+ ],
+});
+
+// ── Write or check ────────────────────────────────────────────────────────
+const check = process.argv.includes('--check');
+let stale = 0;
+for (const sub of ['positive', 'negative']) {
+ if (!existsSync(join(VECTOR_DIR, sub))) continue;
+ for (const file of readdirSync(join(VECTOR_DIR, sub)).filter(name => name.endsWith('.json'))) {
+ if (!(`${sub}/${file}` in files)) {
+ console.error(`${sub}/${file} is not produced by ${SCRIPT}; delete it or add it to the generator`);
+ stale++;
+ }
+ }
+}
+for (const [rel, doc] of Object.entries(files)) {
+ const rendered = `${JSON.stringify(doc, null, 2)}\n`;
+ const path = join(VECTOR_DIR, rel);
+ if (check) {
+ if ((existsSync(path) ? readFileSync(path, 'utf8') : '') !== rendered) {
+ console.error(`${rel} is stale; run node ${SCRIPT}`);
+ stale++;
+ }
+ } else {
+ mkdirSync(dirname(path), { recursive: true });
+ writeFileSync(path, rendered);
+ }
+}
+if (stale) process.exitCode = 1;
+else console.log(`${check ? 'verified' : 'wrote'} ${Object.keys(files).length} Web Bot Auth profile vector files`);
diff --git a/static/compliance/source/test-vectors/wba-profile/README.md b/static/compliance/source/test-vectors/wba-profile/README.md
new file mode 100644
index 00000000000..da13da58bba
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/README.md
@@ -0,0 +1,151 @@
+# Web Bot Auth profile conformance vectors
+
+Test vectors for the AdCP profile of Web Bot Auth (WBA) for request and webhook signing. The profile is experimental in AdCP 3.3, adopted by [DR-0023](https://github.com/adcontextprotocol/adcp/blob/main/governance/decisions/DR-0023-agent-identity-is-an-origin.md), and is published alongside the AdCP RFC 9421 request-signing profile. These fixtures let a signer written with one WBA or RFC 9421 library and a verifier written with another agree on the wire format and on what a verifier rejects.
+
+Specification: [Web Bot Auth request-signing profile](https://adcontextprotocol.org/docs/building/by-layer/L1/wba-profile) in `docs/building/by-layer/L1/wba-profile.mdx`. Section numbers in vector comments refer to [draft-ietf-webbotauth-httpsig-protocol-00](https://datatracker.ietf.org/doc/draft-ietf-webbotauth-httpsig-protocol/00/) unless they name RFC 9421.
+
+**Canonical URLs.** These vectors are served at `https://adcontextprotocol.org/compliance/{version}/test-vectors/wba-profile/`, with `{version}` either an immutable release or `latest`. Tree preserved: `keys.json`, `scenarios.json`, `positive/*.json`, and `negative/*.json` are all resolvable.
+
+## Test keys are public
+
+`keys.json` publishes the private seed of every test key in `_private_d_for_test_only`, so implementations can reproduce every signature. Each seed is SHA-256 of the ASCII string `rfc004-test/`, used as the Ed25519 private key. Each `kid` is the key's JWK thumbprint (RFC 7638; RFC 8037 Appendix A.3 for Ed25519), and each entry's `identity` is the origin whose key directory publishes the key.
+
+**These keys are valid only for grading against this suite.** WBA section 6.8: test keys "MUST NOT be used in production", and verifiers SHOULD reject them when detected. A production verifier that accepts a directory containing `6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I` or `hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI` is exploitable.
+
+The domains in the vectors (`buyer-7k3q.com`, `agent.brand-7k3q.com`, `seller-7k3q.com`) are placeholders that resolve to nothing. A harness serves each directory from the vector's `directories` object instead of fetching it.
+
+## Scope
+
+The vectors exercise the profile rules: the covered `Signature-Agent` member, key selection by thumbprint from the directory the member names, the required `nonce`, replay rejection, one signature per request, the signed directory response, and the `400`, `403`, and `429` responses. JWS artifacts, such as governance tokens, are outside the profile and have no vectors here. The vectors do not exercise live directory fetches, revocation-list polling, or onboarding state, which need live endpoints and belong in integration suites.
+
+## File layout
+
+```
+test-vectors/wba-profile/
+├── README.md this file
+├── keys.json two Ed25519 test keys, one per identity, with private seeds
+├── scenarios.json failure scenarios as data, signed by a harness at run time
+├── positive/ requests and responses that MUST verify
+│ ├── 001-single-signer-request.json buyer agent signs create_media_buy
+│ └── 002-signed-directory-response.json directory response signed per key (WBA Appendix B.1)
+└── negative/ requests a verifier MUST reject, with the expected status
+ ├── 001-missing-nonce.json → 403 (nonce required on every signed request)
+ ├── 002-replayed-nonce.json → 429 (needs test_harness_state)
+ ├── 003-signature-agent-not-covered.json → 403 (Signature-Agent present but not a covered component)
+ ├── 004-key-not-in-named-directory.json → 403 (key is published by an origin other than the one named)
+ ├── 005-malformed-signature-agent.json → 400 (Signature-Agent does not parse)
+ └── 006-two-signatures.json → 403 (two web-bot-auth signatures on one request, each valid on its own)
+```
+
+## Vector format
+
+Every request vector has this shape:
+
+```json
+{
+ "name": "human-readable description",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#anchor",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:...:",
+ "Signature-Agent": "sig1=\"https://buyer-7k3q.com\"",
+ "Signature-Input": "sig1=(...);created=...;expires=...;nonce=\"...\";keyid=\"...\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:...:"
+ },
+ "body": "{...}"
+ },
+ "directories": {
+ "https://buyer-7k3q.com": { "keys_ref": ["6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"] }
+ },
+ "test_harness_state": {
+ "replay_cache_entries": [{ "identity": "https://buyer-7k3q.com", "nonce": "...", "ttl_seconds": 360 }]
+ },
+ "expected_signature_base": { "sig1": "\"@method\": POST\n..." },
+ "expected_outcome": {
+ "success": false,
+ "status": 403,
+ "accept_signature": {
+ "label": "sig1",
+ "components": "(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\")",
+ "parameters": ["created", "expires", "nonce", "keyid", "alg", "tag"],
+ "tag": "web-bot-auth"
+ },
+ "reason": "..."
+ },
+ "$comment": "free-form notes"
+}
+```
+
+### Fields
+
+- **`name`**: one-line description.
+- **`spec_reference`**: the section of `wba-profile.mdx` the vector grades.
+- **`signing_profile`**: always `web-bot-auth`. A verifier selects these vectors by this value and never grades them as AdCP RFC 9421 profile cases.
+- **`reference_now`**: Unix seconds. Inject this as the verifier's wall clock instead of using the real time.
+- **`request`**: the raw HTTP request the verifier receives. Header names are case-insensitive; `body` is the exact byte string on the wire. Binary header values use RFC 8941 `sf-binary` (standard Base64 with padding).
+- **`response`**: present on the directory-response vector only. The response the directory server sends to `request`, with `status`, `headers`, and the exact `body`.
+- **`directories`**: the key directory each origin serves, as a list of `kid` values from `keys.json`. The harness answers a fetch of `/.well-known/http-message-signatures-directory` with a JWK Set holding exactly those keys. An origin absent from the object serves no directory. Several vectors list more than one origin so that a harness can show the trap the vector guards against (see `004-key-not-in-named-directory`).
+- **`test_harness_state`**: optional. Preloads verifier state before verification. `replay_cache_entries` lists `{ identity, nonce, ttl_seconds }` pairs the verifier has already accepted. Reset verifier state before every vector.
+- **`expected_signature_base`**: keyed by the signature's label, the signature base per RFC 9421 section 2.5. Lines are joined with a single `\n`, there is no trailing newline, and components appear in the order listed in `Signature-Input`, followed by `@signature-params`. The base is the one a verifier computes from the request as sent. `006-two-signatures` carries one base per label, so a harness can show that each signature verifies on its own. Diff your computed base against this field before looking at signatures.
+- **`expected_outcome.success`**: `true` for positive vectors, `false` for negative.
+- **`expected_outcome.identities`**: positive vectors only. Keyed by the signature's label, the origin the verifier attributes the signature to.
+- **`expected_outcome.status`**: negative vectors only. The HTTP status the verifier answers: `400` when the signature headers do not parse, `403` when a signature or the profile's checks fail, and `429` when the signature or its nonce was used before. Conformance requires this status.
+- **`expected_outcome.accept_signature`**: negative vectors with `403` or `429`. The `Accept-Signature` member that the AdCP layer SHOULD send ([AdCP checks after Web Bot Auth verification](https://adcontextprotocol.org/docs/building/by-layer/L1/security#adcp-checks-after-web-bot-auth-verification); RFC 9421 section 5.1): the label, the covered components, and the parameters the profile requires. `"nonce": "verifier-chosen"` marks the replay case, where the verifier supplies a fresh nonce value that this vector does not pin. The exact serialization is RFC 9421 section 5.1; conformance grades the status, and a harness MAY check that `Accept-Signature` names at least these components and parameters.
+- **`expected_outcome.reason`**: the profile rule the request breaks. Informational.
+- **`$comment`**: free-form notes, including which non-conformant verifier behavior the vector catches.
+
+### Failure scenarios
+
+`scenarios.json` holds failure scenarios as data instead of signed requests. A harness signs each scenario at run time with the reference library, so no committed signature expires, and grades the verifier on the scenario's expected outcome. The file has the following fields:
+
+- **`signer`**: the identity and `kid` from `keys.json` that sign every scenario.
+- **`requests`**, **`components`**, and **`parameters`**: the base requests (`post` and `get`), the components each one covers, and the default signature parameters. `{label}` in a component stands for the signature's label. `created` and `expires` are offsets in seconds from the harness's clock. A `nonce` object asks for that many random bytes in that encoding: `base64url` (unpadded), `base64` (canonical padded), or `base64url-padded`. A `base64url-padded` value contains at least one `-` or `_`; without one, it is also canonical padded base64, which the profile accepts.
+- **`request_scenarios`**: each entry names a `base` request and overrides any of `label`, `components`, `parameters` (a `null` value omits the parameter), and `signature_agent` (the header value). `extra_signature` adds a second signature with its own label, key, components, and parameters. `after_signing` changes `headers`, appends `append_to_body` to the body, or appends raw `append_members` to `Signature-Input` and `Signature` after signing. `directories` lists the `kid` values each origin serves; it defaults to the signer's own directory.
+- **`directory_scenarios`**: each entry overrides how the signer's directory response is signed: `keys` (the kids that sign), `unsigned_keys` (public keys in the body that do not sign), `authority`, `parameters` (including `tag`), `components`, `content_type`, `status` (the HTTP status the directory is served with, `200` by default), `publish_private_members` (`true` publishes each signing key with its private members), and `after_signing`.
+- **`expected`**: `success` and `identity` for a scenario that verifies, or `success: false` and the `status` for a request scenario that a verifier rejects. A directory scenario that a verifier rejects has no status of its own: the request that needed its key gets `403`.
+- **`tier`**: `wba` when the reference library alone, with no AdCP rules, gives the expected outcome; `adcp` when the bare library gives the opposite outcome and only the profile's rules give the expected one. A WBA MUST that the library does not enforce, such as an `https` origin (`R16`), is `adcp` until the library enforces it. A harness checks every tier against the bare library on every run.
+- **`basis`**: the rule the scenario grades. Informational.
+
+## Conformance expectations
+
+An implementation is conformant when, for every vector:
+
+1. **Positive request vectors** verify the `web-bot-auth` signature and attribute it to the origin in `expected_outcome.identities`.
+2. **The directory-response vector** verifies the response signature with the key the directory body provides and matches `Content-Digest` against the body.
+3. **Negative vectors** answer `expected_outcome.status`. `Accept-Signature` is an AdCP-layer SHOULD, and conformance does not grade it.
+4. **Failure scenarios** answer `expected` for every entry in `scenarios.json`.
+5. **Signature bytes on positive vectors** match the committed `Signature` values byte for byte when the implementation signs the committed `expected_signature_base` with the corresponding private seed. Ed25519 is deterministic.
+
+Several negative vectors carry cryptographically valid signatures on purpose. `001-missing-nonce`, `003-signature-agent-not-covered`, and `006-two-signatures` verify once the targeted check is removed, and `004-key-not-in-named-directory` verifies under a verifier that looks keys up by thumbprint alone. A verifier that accepts any of them has skipped a profile rule, not failed at cryptography.
+
+## Running vectors against an implementation
+
+1. Parse each vector.
+2. Build the verifier's directory store from `directories`, keyed by origin, selecting entries from `keys.json`.
+3. Preload `test_harness_state` into the verifier, then reset it before the next vector.
+4. Build the request from `request`, and invoke verification with `reference_now` as the wall clock.
+5. Assert on `expected_outcome`: identities for positive vectors, status for negative vectors.
+
+Run the positive vectors first. If `positive/001` fails, the signature base, key loading, or thumbprint computation is wrong; the `expected_signature_base` field isolates the first of those. Then run `005` (parse), `001`, `003`, and `006` (profile rules without state), `004` (key lookup), and `002` (replay state).
+
+## Generating the vectors
+
+`scripts/generate-wba-profile-vectors.mjs` writes every file in this directory except this README. It derives the keys from their seeds, builds each signature base component by component, and signs it with Ed25519. Run `node scripts/generate-wba-profile-vectors.mjs --check` to confirm the committed files match the generator. The positive values are the ones in RFC #7878's illustrations. Do not hand-edit the vector files; change the generator and run it again.
+
+`tests/wba-profile-vectors.test.cjs` verifies the vectors without sharing code with the generator. It parses the headers, rebuilds each signature base from the request, and checks signatures and digests with `node:crypto`. For each negative vector it asserts the expected status and the check that fails. For each negative vector with a valid signature, it asserts that the request verifies once that one check is skipped. `npm run test:wba-profile-vectors` runs both. The positive vectors were also verified with a generic RFC 9421 library ([`http-message-sig`](https://www.npmjs.com/package/http-message-sig)) and, for the single-signer request, with Cloudflare's [`web-bot-auth`](https://www.npmjs.com/package/web-bot-auth) library.
+
+## Adding vectors
+
+Every added vector MUST:
+
+1. Cite the section of `wba-profile.mdx` it grades in `spec_reference`.
+2. Use only keys from `keys.json`, and list every directory the verifier may consult in `directories`.
+3. State `expected_outcome.status` for a negative vector in the profile's status-code vocabulary, and `accept_signature` for a `403`.
+4. Include `expected_signature_base` for every label when the signature headers parse, computed from the request as sent.
+5. Include `test_harness_state` when the vector needs preloaded verifier state.
+6. Come from `scripts/generate-wba-profile-vectors.mjs`. A negative vector also needs an entry in `TARGETS` in `tests/wba-profile-vectors.test.cjs`, naming the check it targets.
diff --git a/static/compliance/source/test-vectors/wba-profile/keys.json b/static/compliance/source/test-vectors/wba-profile/keys.json
new file mode 100644
index 00000000000..2a6750ab3f3
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/keys.json
@@ -0,0 +1,25 @@
+{
+ "$comment": "Public test keys for the Web Bot Auth profile conformance vectors. The private seeds are published so that implementations can reproduce every signature. Each seed is SHA-256 of the ASCII string 'rfc004-test/'. Web Bot Auth section 6.8: test keys MUST NOT be used in production, and verifiers SHOULD reject them when detected. Each kid is the RFC 7638 JWK thumbprint (RFC 8037 Appendix A.3 for Ed25519). Each entry's identity is the origin whose key directory publishes the key.",
+ "keys": [
+ {
+ "identity": "https://buyer-7k3q.com",
+ "seed_name": "buyer-request",
+ "kty": "OKP",
+ "crv": "Ed25519",
+ "kid": "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I",
+ "x": "yIxM3SIY89_Yhr6EA9hik-AJjWSDPraK5chDqQ3Xlf0",
+ "use": "sig",
+ "_private_d_for_test_only": "qgZV0LEd-ZDGdPdhM182B1YmHy0OAsNAEZT-feYyfbU"
+ },
+ {
+ "identity": "https://agent.brand-7k3q.com",
+ "seed_name": "brand-request",
+ "kty": "OKP",
+ "crv": "Ed25519",
+ "kid": "hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI",
+ "x": "JB8XPw49dSvDh0kqkCxtoxiNb_RZFhxPdlc-1GedFSc",
+ "use": "sig",
+ "_private_d_for_test_only": "mu0nHxQDWktUz0o16gWmACuOZ86HpAwfmO4iP1qApp8"
+ }
+ ]
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/negative/001-missing-nonce.json b/static/compliance/source/test-vectors/wba-profile/negative/001-missing-nonce.json
new file mode 100644
index 00000000000..0196f05d2d8
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/negative/001-missing-nonce.json
@@ -0,0 +1,47 @@
+{
+ "name": "Signature-Input omits the nonce parameter",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#replay-protection",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:",
+ "Signature-Agent": "sig1=\"https://buyer-7k3q.com\"",
+ "Signature-Input": "sig1=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:UVUnZDwMf7zowtYHn4j4JKNdousAspU+lluY4Y8msRL1AB8QN+xrB+aJaOfFSxrVCnwWnMDNezEuyXiJvoU+AA==:"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "directories": {
+ "https://buyer-7k3q.com": {
+ "keys_ref": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ }
+ },
+ "expected_signature_base": {
+ "sig1": "\"@method\": POST\n\"@target-uri\": https://seller-7k3q.com/mcp/\n\"@authority\": seller-7k3q.com\n\"content-type\": application/json\n\"content-digest\": sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:\n\"signature-agent\";key=\"sig1\": \"https://buyer-7k3q.com\"\n\"@signature-params\": (\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\""
+ },
+ "expected_outcome": {
+ "success": false,
+ "status": 403,
+ "accept_signature": {
+ "label": "sig1",
+ "components": "(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\")",
+ "parameters": [
+ "created",
+ "expires",
+ "nonce",
+ "keyid",
+ "alg",
+ "tag"
+ ],
+ "tag": "web-bot-auth"
+ },
+ "reason": "The profile requires an RFC 9421 nonce on every signed request. Without one the verifier cannot detect replay."
+ },
+ "$comment": "The signature is cryptographically valid over its covered components, so a verifier that does not enforce the nonce requirement accepts it. The verifier answers 403, and the Accept-Signature hint lists nonce among the required parameters. The profile reports signature failures with HTTP status codes (Web Bot Auth sections 5.3 and 5.4). Conformance grades the status code. On a 403 or 429, the AdCP layer SHOULD add Accept-Signature naming the components and parameters the profile requires, so the signer can sign again (security.mdx, AdCP checks after Web Bot Auth verification); the accept_signature object describes that header, and the exact serialization is RFC 9421 section 5.1."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/negative/002-replayed-nonce.json b/static/compliance/source/test-vectors/wba-profile/negative/002-replayed-nonce.json
new file mode 100644
index 00000000000..6c8d4aba2db
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/negative/002-replayed-nonce.json
@@ -0,0 +1,58 @@
+{
+ "name": "Second submission of a request whose (identity, nonce) pair the verifier has already accepted",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#replay-protection",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841615,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:",
+ "Signature-Agent": "sig1=\"https://buyer-7k3q.com\"",
+ "Signature-Input": "sig1=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:ihPGBC7XQPM6WkIYhYQvFHgwTpbssvuQzkb0FfwkuebREyF32sXhiRxXbXWRZMp0O//C4I2g1a2Kui56ffEfBQ==:"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "directories": {
+ "https://buyer-7k3q.com": {
+ "keys_ref": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ }
+ },
+ "test_harness_state": {
+ "$comment": "Preload the replay cache as if positive/001 was just verified. White-box harnesses inject the entry; black-box runners send positive/001 twice and grade the second response.",
+ "replay_cache_entries": [
+ {
+ "identity": "https://buyer-7k3q.com",
+ "nonce": "Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA",
+ "ttl_seconds": 360
+ }
+ ]
+ },
+ "expected_signature_base": {
+ "sig1": "\"@method\": POST\n\"@target-uri\": https://seller-7k3q.com/mcp/\n\"@authority\": seller-7k3q.com\n\"content-type\": application/json\n\"content-digest\": sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:\n\"signature-agent\";key=\"sig1\": \"https://buyer-7k3q.com\"\n\"@signature-params\": (\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\""
+ },
+ "expected_outcome": {
+ "success": false,
+ "status": 429,
+ "accept_signature": {
+ "label": "sig1",
+ "components": "(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\")",
+ "parameters": [
+ "created",
+ "expires",
+ "nonce",
+ "keyid",
+ "alg",
+ "tag"
+ ],
+ "tag": "web-bot-auth",
+ "nonce": "verifier-chosen"
+ },
+ "reason": "The verifier MUST reject a nonce it has already seen for the same identity within the signature's lifetime."
+ },
+ "$comment": "The request is byte-identical to positive/001-single-signer-request.json. The verifier checks the nonce per signature and per identity, whether or not an edge verifier ran first. The Accept-Signature hint on the 429 carries a verifier-chosen nonce value (Web Bot Auth section 5.3; RFC 9421 sections 5.1 and 7.2.2), which the signer uses on its next attempt; the value is not pinned by this vector. The profile reports signature failures with HTTP status codes (Web Bot Auth sections 5.3 and 5.4). Conformance grades the status code. On a 403 or 429, the AdCP layer SHOULD add Accept-Signature naming the components and parameters the profile requires, so the signer can sign again (security.mdx, AdCP checks after Web Bot Auth verification); the accept_signature object describes that header, and the exact serialization is RFC 9421 section 5.1."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/negative/003-signature-agent-not-covered.json b/static/compliance/source/test-vectors/wba-profile/negative/003-signature-agent-not-covered.json
new file mode 100644
index 00000000000..0e2bf8d2cea
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/negative/003-signature-agent-not-covered.json
@@ -0,0 +1,47 @@
+{
+ "name": "Signature-Agent header present, but the sig1 member is not a covered component",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#profile-rules",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:",
+ "Signature-Agent": "sig1=\"https://buyer-7k3q.com\"",
+ "Signature-Input": "sig1=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\");created=1790841600;expires=1790841900;nonce=\"7zKVsUsDkwbtvncoToQq1fW7IyIQrbSC3ZY-tFE2mdNOSKRmoZ7NEqEuwZsFZKg61b7KK0nXkR7AlA6_WFZJ9A\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:e9r9FdXp1AxLJv4Lzg03+tRR1RXafvY7QjEd8DrkN29WHN5etGgyPI5ruhoYvuMqJbN1FAnmtkAfl/UG0BIpAw==:"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "directories": {
+ "https://buyer-7k3q.com": {
+ "keys_ref": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ }
+ },
+ "expected_signature_base": {
+ "sig1": "\"@method\": POST\n\"@target-uri\": https://seller-7k3q.com/mcp/\n\"@authority\": seller-7k3q.com\n\"content-type\": application/json\n\"content-digest\": sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:\n\"@signature-params\": (\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\");created=1790841600;expires=1790841900;nonce=\"7zKVsUsDkwbtvncoToQq1fW7IyIQrbSC3ZY-tFE2mdNOSKRmoZ7NEqEuwZsFZKg61b7KK0nXkR7AlA6_WFZJ9A\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\""
+ },
+ "expected_outcome": {
+ "success": false,
+ "status": 403,
+ "accept_signature": {
+ "label": "sig1",
+ "components": "(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\")",
+ "parameters": [
+ "created",
+ "expires",
+ "nonce",
+ "keyid",
+ "alg",
+ "tag"
+ ],
+ "tag": "web-bot-auth"
+ },
+ "reason": "Web Bot Auth section 5.2.1: the Signature-Agent member keyed to the signature label MUST be signed as a component. An uncovered member is an unverified claim and MUST NOT be attributed (section 4.1)."
+ },
+ "$comment": "The signature verifies over the components it does cover, so a verifier that reads the identity from the uncovered header and skips the coverage check accepts it and attributes the request to an origin nobody signed for. The profile reports signature failures with HTTP status codes (Web Bot Auth sections 5.3 and 5.4). Conformance grades the status code. On a 403 or 429, the AdCP layer SHOULD add Accept-Signature naming the components and parameters the profile requires, so the signer can sign again (security.mdx, AdCP checks after Web Bot Auth verification); the accept_signature object describes that header, and the exact serialization is RFC 9421 section 5.1."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/negative/004-key-not-in-named-directory.json b/static/compliance/source/test-vectors/wba-profile/negative/004-key-not-in-named-directory.json
new file mode 100644
index 00000000000..9682be0caae
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/negative/004-key-not-in-named-directory.json
@@ -0,0 +1,52 @@
+{
+ "name": "Signature-Agent names https://agent.brand-7k3q.com, but the signing key is published only by https://buyer-7k3q.com",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#identity",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:",
+ "Signature-Agent": "sig1=\"https://agent.brand-7k3q.com\"",
+ "Signature-Input": "sig1=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"15d5LKMrMWxIft5nP6rJsDWVqgTBbw9DzLKwwhuUxo1z3-g6-8bDFzVoRclAeUlMmVf26Fnu7wdcUTrNkgV3Ww\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:FjpxFqszIgxRRNWrZZ2l6ZIAvkagW7DZulhHwd40YoKdPch9oFl+6/Nm87uuDaDOKk2Ult8AUn3eQgLUxXQ1AA==:"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "directories": {
+ "https://agent.brand-7k3q.com": {
+ "keys_ref": [
+ "hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI"
+ ]
+ },
+ "https://buyer-7k3q.com": {
+ "keys_ref": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ }
+ },
+ "expected_signature_base": {
+ "sig1": "\"@method\": POST\n\"@target-uri\": https://seller-7k3q.com/mcp/\n\"@authority\": seller-7k3q.com\n\"content-type\": application/json\n\"content-digest\": sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:\n\"signature-agent\";key=\"sig1\": \"https://agent.brand-7k3q.com\"\n\"@signature-params\": (\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"15d5LKMrMWxIft5nP6rJsDWVqgTBbw9DzLKwwhuUxo1z3-g6-8bDFzVoRclAeUlMmVf26Fnu7wdcUTrNkgV3Ww\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\""
+ },
+ "expected_outcome": {
+ "success": false,
+ "status": 403,
+ "accept_signature": {
+ "label": "sig1",
+ "components": "(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\")",
+ "parameters": [
+ "created",
+ "expires",
+ "nonce",
+ "keyid",
+ "alg",
+ "tag"
+ ],
+ "tag": "web-bot-auth"
+ },
+ "reason": "Key lookup is keyed on the (origin, keyid) pair, never on keyid alone (Web Bot Auth section 5.4). The directory at the named origin holds no key with this thumbprint, so the request is unverified and MUST NOT be attributed to that origin (section 6.10)."
+ },
+ "$comment": "The signature is valid under the buyer agent's key, and the directories object lists that key under its own origin so the harness can show the trap: a verifier that indexes keys by thumbprint alone finds the key, verifies, and attributes the request to the brand agent, an origin that never published the key. A conformant verifier resolves only https://agent.brand-7k3q.com/.well-known/http-message-signatures-directory and rejects. The profile reports signature failures with HTTP status codes (Web Bot Auth sections 5.3 and 5.4). Conformance grades the status code. On a 403 or 429, the AdCP layer SHOULD add Accept-Signature naming the components and parameters the profile requires, so the signer can sign again (security.mdx, AdCP checks after Web Bot Auth verification); the accept_signature object describes that header, and the exact serialization is RFC 9421 section 5.1."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/negative/005-malformed-signature-agent.json b/static/compliance/source/test-vectors/wba-profile/negative/005-malformed-signature-agent.json
new file mode 100644
index 00000000000..bd29348b6f3
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/negative/005-malformed-signature-agent.json
@@ -0,0 +1,31 @@
+{
+ "name": "Signature-Agent is not a parseable Structured Field Dictionary (unterminated string)",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#error-responses",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:",
+ "Signature-Agent": "sig1=\"https://buyer-7k3q.com",
+ "Signature-Input": "sig1=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==:"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "directories": {
+ "https://buyer-7k3q.com": {
+ "keys_ref": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ }
+ },
+ "expected_outcome": {
+ "success": false,
+ "status": 400,
+ "reason": "Web Bot Auth section 5.4: a verifier that fails to parse Signature, Signature-Input, or Signature-Agent answers 400 Bad Request."
+ },
+ "$comment": "Signature is a 64-zero-byte placeholder: parsing fails before any key is resolved or any signature is checked, so a verifier that reaches cryptographic verification has skipped the parse step. No Accept-Signature is sent, because the signer's headers, not its signature, need fixing."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/negative/006-two-signatures.json b/static/compliance/source/test-vectors/wba-profile/negative/006-two-signatures.json
new file mode 100644
index 00000000000..7c694cd02a6
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/negative/006-two-signatures.json
@@ -0,0 +1,53 @@
+{
+ "name": "Two web-bot-auth signatures on one request: positive/001 plus a second valid signature from https://agent.brand-7k3q.com",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#verification",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:",
+ "Signature-Agent": "sig1=\"https://buyer-7k3q.com\", sig2=\"https://agent.brand-7k3q.com\"",
+ "Signature-Input": "sig1=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\", sig2=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig2\");created=1790841600;expires=1790841900;nonce=\"YwSl5nr5sFmghcAAPcAs5F3qh9fJLt9-2hWehzPpaxqlJzZpjJ4xxRKFpVPfuC8fM_Zb1VkZLSHH00cYWL7J-g\";keyid=\"hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:ihPGBC7XQPM6WkIYhYQvFHgwTpbssvuQzkb0FfwkuebREyF32sXhiRxXbXWRZMp0O//C4I2g1a2Kui56ffEfBQ==:, sig2=:UdBx3V5QrRm84M54KvhTG/DxP+i2cNRdPmKgbUVJRvy2omQm6buIJRnOB8Rray4p8mSEy/JuaopoFISc1a2SDQ==:"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "directories": {
+ "https://buyer-7k3q.com": {
+ "keys_ref": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ },
+ "https://agent.brand-7k3q.com": {
+ "keys_ref": [
+ "hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI"
+ ]
+ }
+ },
+ "expected_signature_base": {
+ "sig1": "\"@method\": POST\n\"@target-uri\": https://seller-7k3q.com/mcp/\n\"@authority\": seller-7k3q.com\n\"content-type\": application/json\n\"content-digest\": sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:\n\"signature-agent\";key=\"sig1\": \"https://buyer-7k3q.com\"\n\"@signature-params\": (\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "sig2": "\"@method\": POST\n\"@target-uri\": https://seller-7k3q.com/mcp/\n\"@authority\": seller-7k3q.com\n\"content-type\": application/json\n\"content-digest\": sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:\n\"signature-agent\";key=\"sig2\": \"https://agent.brand-7k3q.com\"\n\"@signature-params\": (\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig2\");created=1790841600;expires=1790841900;nonce=\"YwSl5nr5sFmghcAAPcAs5F3qh9fJLt9-2hWehzPpaxqlJzZpjJ4xxRKFpVPfuC8fM_Zb1VkZLSHH00cYWL7J-g\";keyid=\"hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI\";alg=\"ed25519\";tag=\"web-bot-auth\""
+ },
+ "expected_outcome": {
+ "success": false,
+ "status": 403,
+ "accept_signature": {
+ "label": "sig1",
+ "components": "(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\")",
+ "parameters": [
+ "created",
+ "expires",
+ "nonce",
+ "keyid",
+ "alg",
+ "tag"
+ ],
+ "tag": "web-bot-auth"
+ },
+ "reason": "The profile takes exactly one web-bot-auth signature and one Signature-Agent member per request (RFC 9421 section 3.2.1). Web Bot Auth section 5.2.2 permits more than one signature; the profile does not accept one."
+ },
+ "$comment": "The sig1 label is byte-identical to positive/001-single-signer-request.json, and the sig2 label is a second valid signature over the same request from another identity. Each verifies on its own against its own directory, so a verifier that loops over every label and accepts when each verifies has skipped the count check. The profile reports signature failures with HTTP status codes (Web Bot Auth sections 5.3 and 5.4). Conformance grades the status code. On a 403 or 429, the AdCP layer SHOULD add Accept-Signature naming the components and parameters the profile requires, so the signer can sign again (security.mdx, AdCP checks after Web Bot Auth verification); the accept_signature object describes that header, and the exact serialization is RFC 9421 section 5.1."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/positive/001-single-signer-request.json b/static/compliance/source/test-vectors/wba-profile/positive/001-single-signer-request.json
new file mode 100644
index 00000000000..8069b04e552
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/positive/001-single-signer-request.json
@@ -0,0 +1,35 @@
+{
+ "name": "Single signer: buyer agent at https://buyer-7k3q.com sends create_media_buy over MCP",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#profile-rules",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "Content-Type": "application/json",
+ "Content-Digest": "sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:",
+ "Signature-Agent": "sig1=\"https://buyer-7k3q.com\"",
+ "Signature-Input": "sig1=(\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\"",
+ "Signature": "sig1=:ihPGBC7XQPM6WkIYhYQvFHgwTpbssvuQzkb0FfwkuebREyF32sXhiRxXbXWRZMp0O//C4I2g1a2Kui56ffEfBQ==:"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "directories": {
+ "https://buyer-7k3q.com": {
+ "keys_ref": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ }
+ },
+ "expected_signature_base": {
+ "sig1": "\"@method\": POST\n\"@target-uri\": https://seller-7k3q.com/mcp/\n\"@authority\": seller-7k3q.com\n\"content-type\": application/json\n\"content-digest\": sha-256=:yeYok+hSZEsVifM6QdAl+jXRfSJ/75y4NS4MXUWaOdU=:\n\"signature-agent\";key=\"sig1\": \"https://buyer-7k3q.com\"\n\"@signature-params\": (\"@method\" \"@target-uri\" \"@authority\" \"content-type\" \"content-digest\" \"signature-agent\";key=\"sig1\");created=1790841600;expires=1790841900;nonce=\"Mn-ZM8SnGESx0-rmyYMuTkJFerfbwEii2C0qNkDP8ugpcuv0pcrt6Da2ifr-6MTmfVeZhnFymLeAofeXJbFaxA\";keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"web-bot-auth\""
+ },
+ "expected_outcome": {
+ "success": true,
+ "identities": {
+ "sig1": "https://buyer-7k3q.com"
+ }
+ },
+ "$comment": "The Signature-Agent member sig1 names an origin, so the verifier fetches https://buyer-7k3q.com/.well-known/http-message-signatures-directory, selects the key whose kid equals keyid, and attributes the request to that origin. Ed25519 is deterministic, so an implementation signing with the published seed reproduces the Signature value byte for byte."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/positive/002-signed-directory-response.json b/static/compliance/source/test-vectors/wba-profile/positive/002-signed-directory-response.json
new file mode 100644
index 00000000000..30298f092e4
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/positive/002-signed-directory-response.json
@@ -0,0 +1,36 @@
+{
+ "name": "Signed key directory response for https://buyer-7k3q.com, one signature per key",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#key-directories",
+ "signing_profile": "web-bot-auth",
+ "reference_now": 1790841610,
+ "request": {
+ "method": "GET",
+ "url": "https://buyer-7k3q.com/.well-known/http-message-signatures-directory",
+ "headers": {
+ "Host": "buyer-7k3q.com",
+ "Accept": "application/http-message-signatures-directory+json"
+ },
+ "body": ""
+ },
+ "response": {
+ "status": 200,
+ "headers": {
+ "Content-Type": "application/http-message-signatures-directory+json",
+ "Cache-Control": "max-age=300",
+ "Content-Digest": "sha-256=:RQDAkRyNAdoJ2+MThuVDCXhj13Or2jS6ewwSRuyaXQg=:",
+ "Signature-Input": "key1=(\"@authority\";req \"content-digest\");created=1790841000;expires=1790927400;keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"http-message-signatures-directory\"",
+ "Signature": "key1=:QJeeYQ9E5OXMbEy89f1YjQNCB5NjRxN+ck/V+4sRoVNtF5S/446uVIECNCeANo6YH/DhOBG/jMzNZLDqQrmkBg==:"
+ },
+ "body": "{\n \"keys\": [\n {\n \"kty\": \"OKP\",\n \"crv\": \"Ed25519\",\n \"kid\": \"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\",\n \"x\": \"yIxM3SIY89_Yhr6EA9hik-AJjWSDPraK5chDqQ3Xlf0\",\n \"use\": \"sig\"\n }\n ]\n}"
+ },
+ "expected_signature_base": {
+ "key1": "\"@authority\";req: buyer-7k3q.com\n\"content-digest\": sha-256=:RQDAkRyNAdoJ2+MThuVDCXhj13Or2jS6ewwSRuyaXQg=:\n\"@signature-params\": (\"@authority\";req \"content-digest\");created=1790841000;expires=1790927400;keyid=\"6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I\";alg=\"ed25519\";tag=\"http-message-signatures-directory\""
+ },
+ "expected_outcome": {
+ "success": true,
+ "identities": {
+ "key1": "https://buyer-7k3q.com"
+ }
+ },
+ "$comment": "Web Bot Auth Appendix B.1: the directory server signs the response once per key, covering \"@authority\";req and content-digest, with created, expires, the key's thumbprint as keyid, and tag http-message-signatures-directory. The verifier validates the signature with the key the directory itself provides and validates Content-Digest against the body. Covering the request authority stops the key set from being served again from another domain. The verifier stores the signed response as its audit record of the fetch."
+}
diff --git a/static/compliance/source/test-vectors/wba-profile/scenarios.json b/static/compliance/source/test-vectors/wba-profile/scenarios.json
new file mode 100644
index 00000000000..081d9ac23d9
--- /dev/null
+++ b/static/compliance/source/test-vectors/wba-profile/scenarios.json
@@ -0,0 +1,805 @@
+{
+ "$comment": "Failure scenarios for the Web Bot Auth profile, as data. A harness signs each request and directory scenario at run time with the reference library (http-message-sig signs any component and parameter set), applies after_signing, and grades the verifier on expected. created and expires are offsets in seconds from the harness clock; a null parameter is omitted; a nonce object asks for that many random bytes in that encoding. tier \"wba\": the reference library with no AdCP policy already gives the expected outcome. tier \"adcp\": the bare library gives the opposite outcome and only the profile rules give the expected one; a WBA MUST the library does not enforce stays \"adcp\" until it does. See README.md.",
+ "spec_reference": "docs/building/by-layer/L1/wba-profile.mdx#profile-rules",
+ "signing_profile": "web-bot-auth",
+ "signer": {
+ "identity": "https://buyer-7k3q.com",
+ "kid": "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ },
+ "requests": {
+ "post": {
+ "method": "POST",
+ "url": "https://seller-7k3q.com/mcp/",
+ "headers": {
+ "content-type": "application/json"
+ },
+ "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"method\":\"tools/call\",\"params\":{\"name\":\"create_media_buy\",\"arguments\":{\"idempotency_key\":\"4f6c1a0e-8d2b-4b7e-9c3a-2e5d7f1b0a96\",\"account\":{\"account_id\":\"acc_42\"},\"proposal_id\":\"prop_7\",\"total_budget\":{\"amount\":25000,\"currency\":\"USD\"}}}}"
+ },
+ "get": {
+ "method": "GET",
+ "url": "https://seller-7k3q.com/mcp/tasks?id=a%7Eb&x=1",
+ "headers": {},
+ "body": ""
+ }
+ },
+ "components": {
+ "post": [
+ "@method",
+ "@target-uri",
+ "@authority",
+ "content-type",
+ "content-digest",
+ "signature-agent;key={label}"
+ ],
+ "get": [
+ "@method",
+ "@target-uri",
+ "@authority",
+ "signature-agent;key={label}"
+ ]
+ },
+ "parameters": {
+ "created": -5,
+ "expires": 295,
+ "nonce": {
+ "bytes": 64,
+ "encoding": "base64url"
+ },
+ "tag": "web-bot-auth"
+ },
+ "request_scenarios": [
+ {
+ "id": "R00",
+ "name": "Baseline",
+ "base": "post",
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "wba",
+ "basis": "Profile rules"
+ },
+ {
+ "id": "R01",
+ "name": "Body changed after signing",
+ "base": "post",
+ "after_signing": {
+ "append_to_body": "\n"
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Content-Digest matches the body: RFC 9530; WBA section 5.2"
+ },
+ {
+ "id": "R02",
+ "name": "Covered header changed after signing",
+ "base": "post",
+ "after_signing": {
+ "headers": {
+ "content-type": "text/plain"
+ }
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "RFC 9421 section 3.2"
+ },
+ {
+ "id": "R03",
+ "name": "Expired",
+ "base": "post",
+ "parameters": {
+ "created": -400,
+ "expires": -100
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "RFC 9421 section 3.2.1"
+ },
+ {
+ "id": "R04",
+ "name": "created 120 seconds in the future",
+ "base": "post",
+ "parameters": {
+ "created": 120,
+ "expires": 400
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "Profile: 60 seconds of clock skew"
+ },
+ {
+ "id": "R05",
+ "name": "created 30 seconds in the future",
+ "base": "post",
+ "parameters": {
+ "created": 30,
+ "expires": 300
+ },
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "adcp",
+ "basis": "Profile: 60 seconds of clock skew; the library allows none by default"
+ },
+ {
+ "id": "R06",
+ "name": "Lifetime of 3600 seconds",
+ "base": "post",
+ "parameters": {
+ "created": -5,
+ "expires": 3595
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: expires at most 300 seconds after created"
+ },
+ {
+ "id": "R07",
+ "name": "Nonce of 32 bytes",
+ "base": "post",
+ "parameters": {
+ "nonce": {
+ "bytes": 32,
+ "encoding": "base64url"
+ }
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "Profile: 64-byte nonce; validateNonce"
+ },
+ {
+ "id": "R08",
+ "name": "Nonce in canonical padded base64",
+ "base": "post",
+ "parameters": {
+ "nonce": {
+ "bytes": 64,
+ "encoding": "base64"
+ }
+ },
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "wba",
+ "basis": "Profile: unpadded base64url or canonical padded base64"
+ },
+ {
+ "id": "R09",
+ "name": "Nonce in padded base64url",
+ "base": "post",
+ "parameters": {
+ "nonce": {
+ "bytes": 64,
+ "encoding": "base64url-padded"
+ }
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "Profile: unpadded base64url or canonical padded base64"
+ },
+ {
+ "id": "R10",
+ "name": "No alg parameter",
+ "base": "post",
+ "parameters": {
+ "alg": null
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "Profile: alg required"
+ },
+ {
+ "id": "R11",
+ "name": "alg other than ed25519",
+ "base": "post",
+ "parameters": {
+ "alg": "ecdsa-p256-sha256"
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "Profile: alg is ed25519 and matches the key; RFC 9421 section 3.2"
+ },
+ {
+ "id": "R12",
+ "name": "GET covering only @authority and the Signature-Agent member",
+ "base": "get",
+ "components": [
+ "@authority",
+ "signature-agent;key=sig1"
+ ],
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: cover @method, @target-uri, and @authority; WBA section 5.2 needs one of @authority or @target-uri"
+ },
+ {
+ "id": "R13",
+ "name": "Body without content-digest covered",
+ "base": "post",
+ "components": [
+ "@method",
+ "@target-uri",
+ "@authority",
+ "content-type",
+ "signature-agent;key=sig1"
+ ],
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: a request with a body covers content-type and content-digest; WBA section 5.2"
+ },
+ {
+ "id": "R14",
+ "name": "tag other than web-bot-auth",
+ "base": "post",
+ "parameters": {
+ "tag": "adcp/request-signing/v1"
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "WBA section 5.2: tag MUST be web-bot-auth"
+ },
+ {
+ "id": "R15",
+ "name": "Bare-string Signature-Agent",
+ "base": "post",
+ "signature_agent": "\"https://buyer-7k3q.com\"",
+ "components": [
+ "@method",
+ "@target-uri",
+ "@authority",
+ "content-type",
+ "content-digest",
+ "signature-agent"
+ ],
+ "expected": {
+ "success": false,
+ "status": 400
+ },
+ "tier": "adcp",
+ "basis": "Profile: dictionary form only, so the field does not parse; WBA section 5.2.1 lets a verifier accept the bare string"
+ },
+ {
+ "id": "R16",
+ "name": "http:// Signature-Agent",
+ "base": "post",
+ "signature_agent": "sig1=\"http://buyer-7k3q.com\"",
+ "directories": {
+ "http://buyer-7k3q.com": [
+ "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I"
+ ]
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "WBA section 5.2.1: the origin MUST be https; the library accepts http (cloudflare/web-bot-auth#162)"
+ },
+ {
+ "id": "R17",
+ "name": "Signature-Agent with a path",
+ "base": "post",
+ "signature_agent": "sig1=\"https://buyer-7k3q.com/agents/a\"",
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "WBA section 5.5: a directory member MUST be an origin; the library does not check it"
+ },
+ {
+ "id": "R17c",
+ "name": "Signature-Agent origin with a trailing /",
+ "base": "post",
+ "signature_agent": "sig1=\"https://buyer-7k3q.com/\"",
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: the value is exactly the serialized origin (RFC 6454 section 6.2), compared without normalizing"
+ },
+ {
+ "id": "R17d",
+ "name": "Signature-Agent origin with an uppercase host",
+ "base": "post",
+ "signature_agent": "sig1=\"https://BUYER-7k3q.com\"",
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: the value is exactly the serialized origin, with a lowercase host, compared without normalizing"
+ },
+ {
+ "id": "R17e",
+ "name": "Signature-Agent origin with an explicit :443",
+ "base": "post",
+ "signature_agent": "sig1=\"https://buyer-7k3q.com:443\"",
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: the value is exactly the serialized origin, with no default port, compared without normalizing"
+ },
+ {
+ "id": "R18",
+ "name": "Signature-Agent member with type=jwks_uri",
+ "base": "post",
+ "signature_agent": "sig1=\"https://buyer-7k3q.com\";type=jwks_uri",
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: only type=directory; WBA section 5.2.1 lets a verifier ignore other types"
+ },
+ {
+ "id": "R18c",
+ "name": "Signature-Agent member with type=directory as a Token",
+ "base": "post",
+ "signature_agent": "sig1=\"https://buyer-7k3q.com\";type=directory",
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "wba",
+ "basis": "WBA section 5.2.1: type is a Token, and directory is the default"
+ },
+ {
+ "id": "R18d",
+ "name": "Signature-Agent member with type=\"directory\" as a String",
+ "base": "post",
+ "signature_agent": "sig1=\"https://buyer-7k3q.com\";type=\"directory\"",
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "wba",
+ "basis": "Profile: a verifier accepts type=directory as a Token or a String, as the reference library does; WBA section 5.2.1 defines a Token"
+ },
+ {
+ "id": "R19",
+ "name": "Signature-Agent member keyed differently from the label",
+ "base": "post",
+ "signature_agent": "agent1=\"https://buyer-7k3q.com\"",
+ "components": [
+ "@method",
+ "@target-uri",
+ "@authority",
+ "content-type",
+ "content-digest",
+ "signature-agent;key=agent1"
+ ],
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "WBA section 5.2.1: the member keyed to the label; the library does not check it"
+ },
+ {
+ "id": "R19b",
+ "name": "Whole Signature-Agent field covered before the member",
+ "base": "post",
+ "components": [
+ "@method",
+ "@target-uri",
+ "@authority",
+ "content-type",
+ "content-digest",
+ "signature-agent",
+ "signature-agent;key=sig1"
+ ],
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "wba",
+ "basis": "RFC 9421 section 2.1: the field and its member are separate components; WBA section 5.2.1 requires only the member keyed to the label"
+ },
+ {
+ "id": "R20",
+ "name": "Second signature with tag cdn-edge",
+ "base": "post",
+ "extra_signature": {
+ "label": "cdn",
+ "kid": "hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI",
+ "components": [
+ "@method",
+ "@authority"
+ ],
+ "parameters": {
+ "created": -5,
+ "expires": 295,
+ "nonce": null,
+ "tag": "cdn-edge"
+ }
+ },
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "adcp",
+ "basis": "Profile: Signature-Input members with other tags are not read; the library requires a label when a request carries two signatures"
+ },
+ {
+ "id": "R20b",
+ "name": "Second member with tag cdn-edge whose Signature value is a token",
+ "base": "post",
+ "after_signing": {
+ "append_members": {
+ "signature-input": "cdn=(\"@method\" \"@authority\");tag=\"cdn-edge\"",
+ "signature": "cdn=edge-token"
+ }
+ },
+ "expected": {
+ "success": false,
+ "status": 400
+ },
+ "tier": "wba",
+ "basis": "RFC 9421 section 4.2: every Signature member value is a Byte Sequence, so the field is malformed whatever the member's tag; members with other tags are not read, but the field is still parsed"
+ },
+ {
+ "id": "R21",
+ "name": "Two Signature-Agent members, one signature",
+ "base": "post",
+ "signature_agent": "sig1=\"https://buyer-7k3q.com\", sig2=\"https://agent.brand-7k3q.com\"",
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "adcp",
+ "basis": "Profile: exactly one Signature-Agent member"
+ },
+ {
+ "id": "R21b",
+ "name": "Two web-bot-auth signatures that cover one Signature-Agent member",
+ "base": "post",
+ "extra_signature": {
+ "label": "sig2",
+ "kid": "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I",
+ "components": [
+ "@method",
+ "@target-uri",
+ "@authority",
+ "content-type",
+ "content-digest",
+ "signature-agent;key=sig1"
+ ],
+ "parameters": {
+ "created": -5,
+ "expires": 295,
+ "nonce": {
+ "bytes": 64,
+ "encoding": "base64url"
+ },
+ "tag": "web-bot-auth"
+ }
+ },
+ "expected": {
+ "success": false,
+ "status": 403
+ },
+ "tier": "wba",
+ "basis": "Profile: exactly one web-bot-auth signature; WBA section 5.2.2 lets a request carry more"
+ },
+ {
+ "id": "R22",
+ "name": "Label other than sig1",
+ "base": "post",
+ "label": "wba",
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "wba",
+ "basis": "RFC 9421: the signer chooses the label"
+ },
+ {
+ "id": "R23",
+ "name": "Components in another order",
+ "base": "post",
+ "components": [
+ "signature-agent;key=sig1",
+ "@authority",
+ "content-digest",
+ "@target-uri",
+ "content-type",
+ "@method"
+ ],
+ "expected": {
+ "success": true,
+ "identity": "https://buyer-7k3q.com"
+ },
+ "tier": "wba",
+ "basis": "RFC 9421: the order is the signer's"
+ }
+ ],
+ "directory_scenarios": [
+ {
+ "id": "D00",
+ "name": "Baseline",
+ "expected": {
+ "success": true
+ },
+ "tier": "wba",
+ "basis": "WBA Appendix B.1"
+ },
+ {
+ "id": "D01",
+ "name": "Signed for another authority",
+ "authority": "agent.brand-7k3q.com",
+ "expected": {
+ "success": false
+ },
+ "tier": "wba",
+ "basis": "WBA Appendix B.1: covers \"@authority\";req"
+ },
+ {
+ "id": "D02",
+ "name": "Body changed after signing",
+ "after_signing": {
+ "append_to_body": "\n"
+ },
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "WBA Appendix B.1: the verifier MUST validate Content-Digest; the library does not compare it with the body"
+ },
+ {
+ "id": "D03",
+ "name": "Unsigned",
+ "keys": [],
+ "unsigned_keys": [
+ {
+ "kty": "OKP",
+ "crv": "Ed25519",
+ "kid": "6WsKMCObba49V3uN0vIENnk1BKAk7c9zjBJcWKyQ9_I",
+ "x": "yIxM3SIY89_Yhr6EA9hik-AJjWSDPraK5chDqQ3Xlf0",
+ "use": "sig"
+ }
+ ],
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "Profile: use only keys with a valid signature, so the directory yields no usable key; WBA Appendix B.1 lets a verifier use an unproven key"
+ },
+ {
+ "id": "D04",
+ "name": "Signature created in the future",
+ "parameters": {
+ "created": 3600,
+ "expires": 90000
+ },
+ "expected": {
+ "success": false
+ },
+ "tier": "wba",
+ "basis": "WBA Appendix B.1: reject a future created"
+ },
+ {
+ "id": "D05",
+ "name": "Covers \"@authority\";req only",
+ "components": [
+ "@authority;req"
+ ],
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "WBA Appendix B.1: covers content-digest"
+ },
+ {
+ "id": "D06",
+ "name": "Expired signature",
+ "parameters": {
+ "created": -7200,
+ "expires": -3600
+ },
+ "expected": {
+ "success": false
+ },
+ "tier": "wba",
+ "basis": "RFC 9421 section 3.2.1"
+ },
+ {
+ "id": "D07",
+ "name": "Extra P-256 key that does not sign",
+ "unsigned_keys": [
+ {
+ "kty": "EC",
+ "crv": "P-256",
+ "x": "ayhQePn14MyJGqrKHsp_A06Z0N6IZoE0-7wbn66qLLc",
+ "y": "k98dk4yymVze93JE_EpboBD6oaZbcII4Lvf_Oqu8kII",
+ "kid": "4rrLPtiRac4zmWwTBQeJlzgNyb5jai8HSOTJONOIKFY",
+ "use": "sig"
+ }
+ ],
+ "expected": {
+ "success": true
+ },
+ "tier": "wba",
+ "basis": "Profile: ignore keys the profile does not use (RFC 7517 section 5)"
+ },
+ {
+ "id": "D08",
+ "name": "Media type application/json",
+ "content_type": "application/json",
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "WBA section 5.5.1: the well-known directory MUST be served with application/http-message-signatures-directory+json"
+ },
+ {
+ "id": "D09",
+ "name": "Directory served with status 203",
+ "status": 203,
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "WBA section 5.5: a status other than 200 is a discovery failure"
+ },
+ {
+ "id": "D10",
+ "name": "Signed with tag web-bot-auth",
+ "parameters": {
+ "tag": "web-bot-auth"
+ },
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "WBA Appendix B.1: tag=\"http-message-signatures-directory\""
+ },
+ {
+ "id": "D11",
+ "name": "Second Ed25519 key that does not sign",
+ "unsigned_keys": [
+ {
+ "kty": "OKP",
+ "crv": "Ed25519",
+ "kid": "hHurKlVBnPJ4AGiPyl6HWMhxgkIcRBzaC8qWwEtnuVI",
+ "x": "JB8XPw49dSvDh0kqkCxtoxiNb_RZFhxPdlc-1GedFSc",
+ "use": "sig"
+ }
+ ],
+ "expected": {
+ "success": true
+ },
+ "tier": "wba",
+ "basis": "Profile: ignore a key without a valid signature; WBA Appendix B.1; directory draft section 5"
+ },
+ {
+ "id": "D12",
+ "name": "Only a P-256 key, unsigned",
+ "keys": [],
+ "unsigned_keys": [
+ {
+ "kty": "EC",
+ "crv": "P-256",
+ "x": "ayhQePn14MyJGqrKHsp_A06Z0N6IZoE0-7wbn66qLLc",
+ "y": "k98dk4yymVze93JE_EpboBD6oaZbcII4Lvf_Oqu8kII",
+ "kid": "4rrLPtiRac4zmWwTBQeJlzgNyb5jai8HSOTJONOIKFY",
+ "use": "sig"
+ }
+ ],
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "Profile: the directory yields no Ed25519 key with a valid signature"
+ },
+ {
+ "id": "D13",
+ "name": "Extra RSA-PSS key that does not sign",
+ "unsigned_keys": [
+ {
+ "kty": "RSA",
+ "e": "AQAB",
+ "n": "v-QEO4laYaq_rKgLuz0I8hRW_Ig58qmjv_L9cIX_2dCz6pkvMg953c3P3yNtvjl0eLiZNk1tbaWjfdwiMczGUYqhcFutwjbJpny5rMlSOuTkgJEidDpVpsSfa9OwmkRLgn_hjrAkQzKYljsqSN_U9deB6a_NwWiM03MRFLVtcCHJQMEVNCXGvqRIF0MKRVdb3287cgEQ2lvb0g1a84CYzQtbRdWcHnSjhOwF3Y2IH2A2VvQzeCSWWFy2LUr2H09Ce2pvAc-DJX6BdUF5MijFV9SRt4jbPWG28kcrLUEt1GMDynfvMT419dx03kfaZnHkh4I3xXKhcFAIMK4D1WH9bQ",
+ "alg": "PS512",
+ "kid": "ugCZP3qkO8gkwu8s71HuHjbt75oPFuBK0Tgb4WkL37k",
+ "use": "sig"
+ }
+ ],
+ "expected": {
+ "success": true
+ },
+ "tier": "wba",
+ "basis": "Profile: ignore keys the profile does not use (RFC 7517 section 5), including a key the library imports"
+ },
+ {
+ "id": "D14",
+ "name": "Extra P-256 key that carries its private d",
+ "unsigned_keys": [
+ {
+ "kty": "EC",
+ "crv": "P-256",
+ "x": "ayhQePn14MyJGqrKHsp_A06Z0N6IZoE0-7wbn66qLLc",
+ "y": "k98dk4yymVze93JE_EpboBD6oaZbcII4Lvf_Oqu8kII",
+ "kid": "4rrLPtiRac4zmWwTBQeJlzgNyb5jai8HSOTJONOIKFY",
+ "use": "sig",
+ "d": "IyiPVggq91xZTs3CxpETaAbK6Qca0DuuD9-DZx7ueHs"
+ }
+ ],
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "Profile: refuse a directory in which any key carries a private member, checked before unused keys are skipped; WBA section 5.5.1: a verifier SHOULD reject malformed entries"
+ },
+ {
+ "id": "D14b",
+ "name": "Signing Ed25519 key published with its private d",
+ "publish_private_members": true,
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "Profile: refuse a directory in which any key carries a private member; WBA section 5.5.1: a verifier SHOULD reject malformed entries"
+ },
+ {
+ "id": "D14c",
+ "name": "Extra P-256 key that carries its private scalar as an upper-case D",
+ "unsigned_keys": [
+ {
+ "kty": "EC",
+ "crv": "P-256",
+ "x": "ayhQePn14MyJGqrKHsp_A06Z0N6IZoE0-7wbn66qLLc",
+ "y": "k98dk4yymVze93JE_EpboBD6oaZbcII4Lvf_Oqu8kII",
+ "kid": "4rrLPtiRac4zmWwTBQeJlzgNyb5jai8HSOTJONOIKFY",
+ "use": "sig",
+ "D": "IyiPVggq91xZTs3CxpETaAbK6Qca0DuuD9-DZx7ueHs"
+ }
+ ],
+ "expected": {
+ "success": false
+ },
+ "tier": "adcp",
+ "basis": "Profile: private member names compare without regard to case; WBA section 5.5.1: a verifier SHOULD reject malformed entries"
+ }
+ ]
+}
diff --git a/static/schemas/source/core/agent-notification-config.json b/static/schemas/source/core/agent-notification-config.json
index 7da1e28ab18..5f2809c8368 100644
--- a/static/schemas/source/core/agent-notification-config.json
+++ b/static/schemas/source/core/agent-notification-config.json
@@ -75,6 +75,11 @@
],
"additionalProperties": false
},
+ "signing_profile": {
+ "x-status": "experimental",
+ "$ref": "/schemas/enums/webhook-signing-profile.json",
+ "description": "Webhook-signing profile the seller uses for every delivery to this `url`. When it is omitted, the seller signs with `adcp/webhook-signing/v1`, or with the legacy scheme when `authentication` is present. A seller whose `webhook_signing.profiles` does not list it rejects the entry with `INVALID_REQUEST` or `VALIDATION_ERROR`. MUST NOT be combined with `authentication`."
+ },
"active": {
"type": "boolean",
"default": true,
@@ -127,6 +132,7 @@
},
"required": ["all_authorized_accounts"]
},
+ "not": { "required": ["authentication", "signing_profile"] },
"additionalProperties": false,
"examples": [
{
diff --git a/static/schemas/source/core/notification-config.json b/static/schemas/source/core/notification-config.json
index 99fca78e64a..8c577a6f4b5 100644
--- a/static/schemas/source/core/notification-config.json
+++ b/static/schemas/source/core/notification-config.json
@@ -80,6 +80,11 @@
],
"additionalProperties": false
},
+ "signing_profile": {
+ "x-status": "experimental",
+ "$ref": "/schemas/enums/webhook-signing-profile.json",
+ "description": "Webhook-signing profile the seller uses for every delivery to this `url`. When it is omitted, the seller signs with `adcp/webhook-signing/v1`, or with the legacy scheme when `authentication` is present. A seller whose `webhook_signing.profiles` does not list it rejects the entry as a per-account validation failure with `INVALID_REQUEST` or `VALIDATION_ERROR` and `error.field` pointing at it. MUST NOT be combined with `authentication`."
+ },
"active": {
"type": "boolean",
"default": true,
@@ -106,6 +111,7 @@
}
}
],
+ "not": { "required": ["authentication", "signing_profile"] },
"additionalProperties": false,
"examples": [
{
diff --git a/static/schemas/source/core/push-notification-config.json b/static/schemas/source/core/push-notification-config.json
index f60d6d45ab5..e870fe35cdb 100644
--- a/static/schemas/source/core/push-notification-config.json
+++ b/static/schemas/source/core/push-notification-config.json
@@ -48,9 +48,15 @@
"credentials"
],
"additionalProperties": false
+ },
+ "signing_profile": {
+ "x-status": "experimental",
+ "$ref": "/schemas/enums/webhook-signing-profile.json",
+ "description": "Webhook-signing profile the seller uses for every delivery to this `url`. When it is omitted, the seller signs with `adcp/webhook-signing/v1`, or with the legacy scheme when `authentication` is present. A seller whose `webhook_signing.profiles` does not list it rejects the registration with `INVALID_REQUEST`. MUST NOT be combined with `authentication`."
}
},
"required": [
"url"
- ]
+ ],
+ "not": { "required": ["authentication", "signing_profile"] }
}
diff --git a/static/schemas/source/core/reporting-webhook.json b/static/schemas/source/core/reporting-webhook.json
index 8fab0d7a993..006c6ffc1ff 100644
--- a/static/schemas/source/core/reporting-webhook.json
+++ b/static/schemas/source/core/reporting-webhook.json
@@ -48,6 +48,11 @@
],
"additionalProperties": false
},
+ "signing_profile": {
+ "x-status": "experimental",
+ "$ref": "/schemas/enums/webhook-signing-profile.json",
+ "description": "Webhook-signing profile the seller uses for every delivery to this `url`. When it is omitted, the seller signs with `adcp/webhook-signing/v1`, or with the legacy scheme when `authentication` is present. A seller whose `webhook_signing.profiles` does not list it rejects the registration with `INVALID_REQUEST`. MUST NOT be combined with `authentication`."
+ },
"reporting_frequency": {
"type": "string",
"enum": [
@@ -71,5 +76,6 @@
"authentication",
"reporting_frequency"
],
+ "not": { "required": ["authentication", "signing_profile"] },
"additionalProperties": true
}
diff --git a/static/schemas/source/enums/webhook-signing-profile.json b/static/schemas/source/enums/webhook-signing-profile.json
new file mode 100644
index 00000000000..13d2711ed22
--- /dev/null
+++ b/static/schemas/source/enums/webhook-signing-profile.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$id": "/schemas/enums/webhook-signing-profile.json",
+ "title": "Webhook Signing Profile",
+ "description": "Webhook-signing profile, named by its RFC 9421 `tag`: the AdCP webhook profile or the Web Bot Auth profile (docs/building/by-layer/L1/wba-profile.mdx#webhooks).",
+ "type": "string",
+ "enum": [
+ "adcp/webhook-signing/v1",
+ "web-bot-auth"
+ ]
+}
diff --git a/static/schemas/source/index.json b/static/schemas/source/index.json
index b48e012b86c..52ebe321d2d 100644
--- a/static/schemas/source/index.json
+++ b/static/schemas/source/index.json
@@ -1545,6 +1545,10 @@
"$ref": "/schemas/enums/auth-scheme.json",
"description": "Authentication schemes for push notifications"
},
+ "webhook-signing-profile": {
+ "$ref": "/schemas/enums/webhook-signing-profile.json",
+ "description": "Webhook-signing profiles a seller can sign deliveries with"
+ },
"creative-sort-field": {
"$ref": "/schemas/enums/creative-sort-field.json",
"description": "Fields available for sorting creative listings"
diff --git a/static/schemas/source/media-buy/create-media-buy-request.json b/static/schemas/source/media-buy/create-media-buy-request.json
index b2925ea698c..df9e58d0394 100644
--- a/static/schemas/source/media-buy/create-media-buy-request.json
+++ b/static/schemas/source/media-buy/create-media-buy-request.json
@@ -297,6 +297,11 @@
],
"description": "For batched delivery, how often to push artifacts. Required when delivery_mode is 'batched'."
},
+ "signing_profile": {
+ "x-status": "experimental",
+ "$ref": "/schemas/enums/webhook-signing-profile.json",
+ "description": "Webhook-signing profile the seller uses for every delivery to this `url`. When it is omitted, the seller signs with `adcp/webhook-signing/v1`, or with the legacy scheme when `authentication` is present. A seller whose `webhook_signing.profiles` does not list it rejects the registration with `INVALID_REQUEST`. MUST NOT be combined with `authentication`."
+ },
"sampling_rate": {
"type": "number",
"minimum": 0,
@@ -309,6 +314,7 @@
"authentication",
"delivery_mode"
],
+ "not": { "required": ["authentication", "signing_profile"] },
"additionalProperties": true
},
"context": {
diff --git a/static/schemas/source/protocol/get-adcp-capabilities-response.json b/static/schemas/source/protocol/get-adcp-capabilities-response.json
index f864e186a63..41c27e053b6 100644
--- a/static/schemas/source/protocol/get-adcp-capabilities-response.json
+++ b/static/schemas/source/protocol/get-adcp-capabilities-response.json
@@ -3226,6 +3226,21 @@
"x-adcp-validation": {
"spec": "docs/building/by-layer/L1/security.mdx#operation-resolution-over-a2a"
}
+ },
+ "profiles": {
+ "x-status": "experimental",
+ "type": "array",
+ "description": "Request-signing profiles this agent verifies, named by the RFC 9421 `tag` value each profile puts in `Signature-Input`. `adcp/request-signing/v1` is the AdCP RFC 9421 profile defined in docs/building/by-layer/L1/security.mdx (Signed Requests (Transport Layer)). `web-bot-auth` is the Web Bot Auth profile, experimental in 3.3, in docs/building/by-layer/L1/wba-profile.mdx: the verifier resolves the signer's keys from the origin named in the covered `Signature-Agent` header, and a verified identity the seller has not approved gets no account access. Omission means `[\"adcp/request-signing/v1\"]`, so every 3.0 to 3.2 capability document keeps its meaning. A buyer signs with a profile the seller lists. The operation lists (`required_for`, `warn_for`, `supported_for`, and the `protocol_methods_*` lists) apply to every listed profile.",
+ "items": {
+ "type": "string",
+ "enum": ["adcp/request-signing/v1", "web-bot-auth"]
+ },
+ "minItems": 1,
+ "uniqueItems": true,
+ "default": ["adcp/request-signing/v1"],
+ "x-adcp-validation": {
+ "spec": "docs/building/by-layer/L1/wba-profile.mdx#capability"
+ }
}
},
"required": ["supported"]
@@ -3298,6 +3313,20 @@
"description": "Maximum elapsed time from the first delivery attempt during which this agent may retry the same webhook delivery. The publisher retains the immutable delivery-key-to-RFC-8785-JCS-payload binding and sufficient delivery state for at least this interval, and MUST NOT retry that key afterward. Receivers retain the matching payload binding and terminal publication proof for at least max(86400, this value) seconds in AdCP 3.x. Retries do not extend the horizon. A webhook-emitting AdCP 3.2 agent MUST populate this additive field; it remains schema-optional so existing 3.x capability documents stay valid. Minimum 86400 (24h), maximum 604800 (7d).",
"minimum": 86400,
"maximum": 604800
+ },
+ "profiles": {
+ "x-status": "experimental",
+ "type": "array",
+ "description": "Webhook-signing profiles this agent can sign outbound webhooks with, named by the RFC 9421 `tag` value. `adcp/webhook-signing/v1` is the AdCP webhook profile named in `profile`. `web-bot-auth` is the Web Bot Auth profile, experimental in 3.3, in docs/building/by-layer/L1/wba-profile.mdx (Webhooks), under which a webhook is an ordinary signed request from the seller's identity. The seller signs each delivery with the one profile the subscriber selected in the registration's `signing_profile` (on `push_notification_config`, `reporting_webhook`, `artifact_webhook`, `accounts[].notification_configs[]`, or an agent-level notification configuration), and rejects a registration that selects a profile not listed here. Omission means `[\"adcp/webhook-signing/v1\"]`. The list includes the value of `profile`.",
+ "items": {
+ "$ref": "/schemas/enums/webhook-signing-profile.json"
+ },
+ "minItems": 1,
+ "uniqueItems": true,
+ "default": ["adcp/webhook-signing/v1"],
+ "x-adcp-validation": {
+ "spec": "docs/building/by-layer/L1/wba-profile.mdx#webhooks"
+ }
}
},
"required": ["supported"]
diff --git a/tests/mcp-schema-analysis.test.cjs b/tests/mcp-schema-analysis.test.cjs
index 0ffe71fed9c..ed40cb29ac8 100644
--- a/tests/mcp-schema-analysis.test.cjs
+++ b/tests/mcp-schema-analysis.test.cjs
@@ -53,9 +53,9 @@ test("input-field weight report attributes the largest transitive schema graphs"
// shared locale tag its languages filter references.
// opportunity.later_proposals adds a Duration reference to the shared
// opportunity context reached from the proposal and purchase tools (+2).
- assert.equal(report.definition_instances, 695);
- assert.equal(report.unique_definitions, 188);
- assert.equal(report.repeated_definitions, 133);
+ assert.equal(report.definition_instances, 703);
+ assert.equal(report.unique_definitions, 189);
+ assert.equal(report.repeated_definitions, 134);
assert.ok(report.repeated_definition_bytes > 180_000);
assert.deepEqual(
@@ -179,7 +179,7 @@ test("shared dictionary resolves every experimental tool schema when explicitly
assert.equal(view.dictionary.$id, DICTIONARY_ID);
// Must match the intentionally pinned unique-definition inventory above.
- assert.equal(Object.keys(view.dictionary.$defs).length, 188);
+ assert.equal(Object.keys(view.dictionary.$defs).length, 189);
for (const tool of Object.values(view.tools)) {
assert.equal(tool.inputSchema.$defs, undefined);
assert.match(
diff --git a/tests/wba-profile-vectors.test.cjs b/tests/wba-profile-vectors.test.cjs
new file mode 100644
index 00000000000..08ad01b8b80
--- /dev/null
+++ b/tests/wba-profile-vectors.test.cjs
@@ -0,0 +1,396 @@
+/**
+ * Independent verification of the Web Bot Auth profile vectors under
+ * static/compliance/source/test-vectors/wba-profile/.
+ *
+ * Shares no code with the generator (scripts/generate-wba-profile-vectors.mjs):
+ * it parses the RFC 8941 headers, rebuilds each RFC 9421 signature base from
+ * the request on the wire, and checks signatures and digests with node:crypto.
+ *
+ * Each negative vector must fail at the check it targets. Where the vector
+ * carries a valid signature, it must verify once that one check is skipped,
+ * which shows the vector tests that check and nothing else.
+ */
+const assert = require('node:assert/strict');
+const crypto = require('node:crypto');
+const fs = require('node:fs');
+const path = require('node:path');
+const { describe, it } = require('node:test');
+
+const VECTOR_DIR = path.join(__dirname, '../static/compliance/source/test-vectors/wba-profile');
+const keys = JSON.parse(fs.readFileSync(path.join(VECTOR_DIR, 'keys.json'), 'utf8')).keys;
+
+function loadDir(sub) {
+ return fs
+ .readdirSync(path.join(VECTOR_DIR, sub))
+ .filter(name => name.endsWith('.json'))
+ .sort()
+ .map(file => ({ file, vector: JSON.parse(fs.readFileSync(path.join(VECTOR_DIR, sub, file), 'utf8')) }));
+}
+
+// ── RFC 8941 dictionary parsing, limited to the item types these headers use ──
+
+function parseDictionary(text) {
+ let i = 0;
+ const fail = message => {
+ throw new Error(`structured field parse error at ${i}: ${message}`);
+ };
+ const key = () => {
+ const match = /^[a-z*][a-z0-9_.*-]*/.exec(text.slice(i));
+ if (!match) fail('expected a key');
+ i += match[0].length;
+ return match[0];
+ };
+ const bareItem = () => {
+ if (text[i] === '"') {
+ let out = '';
+ for (i++; i < text.length; i++) {
+ if (text[i] === '\\') out += text[++i];
+ else if (text[i] === '"') {
+ i++;
+ return out;
+ } else out += text[i];
+ }
+ fail('unterminated string');
+ }
+ if (text[i] === ':') {
+ const end = text.indexOf(':', i + 1);
+ if (end < 0) fail('unterminated byte sequence');
+ const token = text.slice(i + 1, end);
+ if (!/^[A-Za-z0-9+/]*={0,2}$/.test(token)) fail('byte sequence is not standard Base64');
+ i = end + 1;
+ return Buffer.from(token, 'base64');
+ }
+ const match = /^-?\d+/.exec(text.slice(i));
+ if (match) {
+ i += match[0].length;
+ return Number(match[0]);
+ }
+ return fail('unsupported item');
+ };
+ const parameters = () => {
+ const params = new Map();
+ while (text[i] === ';') {
+ i++;
+ const name = key();
+ if (text[i] === '=') {
+ i++;
+ params.set(name, bareItem());
+ } else params.set(name, true);
+ }
+ return params;
+ };
+ const item = () => {
+ if (text[i] !== '(') return { value: bareItem(), params: parameters() };
+ i++;
+ const list = [];
+ while (text[i] !== ')') {
+ if (i >= text.length) fail('unterminated inner list');
+ list.push({ value: bareItem(), params: parameters() });
+ if (text[i] === ' ') i++;
+ }
+ i++;
+ return { value: list, params: parameters() };
+ };
+ const dict = new Map();
+ while (i < text.length) {
+ const name = key();
+ if (text[i++] !== '=') fail('expected =');
+ dict.set(name, item());
+ if (i === text.length) break;
+ if (text.slice(i, i + 2) !== ', ') fail('expected a member separator');
+ i += 2;
+ }
+ return dict;
+}
+
+const serializeParams = params =>
+ [...params].map(([k, v]) => (v === true ? `;${k}` : typeof v === 'string' ? `;${k}="${v}"` : `;${k}=${v}`)).join('');
+const serializeInnerList = ({ value, params }) =>
+ `(${value.map(c => `"${c.value}"${serializeParams(c.params)}`).join(' ')})${serializeParams(params)}`;
+const componentId = c => `"${c.value}"${serializeParams(c.params)}`;
+
+// ── A minimal profile verifier ────────────────────────────────────────────
+
+const REQUIRED_COMPONENTS = ['"@method"', '"@target-uri"', '"@authority"', '"content-type"', '"content-digest"'];
+const REQUIRED_PARAMETERS = ['created', 'expires', 'nonce', 'keyid', 'alg', 'tag'];
+const PROFILE_ALGORITHMS = ['ed25519'];
+const NONCE_BYTES = 64;
+const MAX_LIFETIME = 300;
+const CLOCK_SKEW = 60;
+
+class ProfileError extends Error {
+ constructor(status, stage, message) {
+ super(`${stage}: ${message}`);
+ this.status = status;
+ this.stage = stage;
+ }
+}
+
+const headerOf = (headers, name) => headers[Object.keys(headers).find(k => k.toLowerCase() === name)];
+
+const publicKey = jwk => crypto.createPublicKey({ key: { kty: jwk.kty, crv: jwk.crv, x: jwk.x }, format: 'jwk' });
+
+function parseRequestHeaders(headers) {
+ try {
+ const parsed = {
+ agent: parseDictionary(headerOf(headers, 'signature-agent')),
+ input: parseDictionary(headerOf(headers, 'signature-input')),
+ signature: parseDictionary(headerOf(headers, 'signature')),
+ };
+ for (const [, { value }] of parsed.agent) {
+ if (typeof value !== 'string') throw new Error('Signature-Agent member is not a String');
+ }
+ return parsed;
+ } catch (e) {
+ throw new ProfileError(400, 'parse', e.message);
+ }
+}
+
+/** The RFC 9421 signature base for one label, rebuilt from the request on the wire. */
+function requestBase(request, parsed, label) {
+ const url = new URL(request.url);
+ const lines = parsed.input.get(label).value.map(c => {
+ const memberKey = c.params.get('key');
+ let value;
+ if (c.value === '@method') value = request.method;
+ else if (c.value === '@target-uri') value = request.url;
+ else if (c.value === '@authority') value = url.host;
+ else if (c.value === 'signature-agent') value = `"${parsed.agent.get(memberKey).value}"`;
+ else if (c.value === 'signature-input') value = serializeInnerList(parsed.input.get(memberKey));
+ else if (c.value === 'signature') value = `:${parsed.signature.get(memberKey).value.toString('base64')}:`;
+ else value = headerOf(request.headers, c.value);
+ return `${componentId(c)}: ${value}`;
+ });
+ return [...lines, `"@signature-params": ${serializeInnerList(parsed.input.get(label))}`].join('\n');
+}
+
+/**
+ * Verifies the one web-bot-auth signature on the request and returns label → origin.
+ * Each option skips one profile check, so a test can show a vector fails on that check alone.
+ */
+function verifyRequest(vector, { skipNonce = false, skipAgentCoverage = false, skipSignatureCount = false, keyidOnlyLookup = false } = {}) {
+ const { request, reference_now: now } = vector;
+ const parsed = parseRequestHeaders(request.headers);
+ const replayCache = new Set((vector.test_harness_state?.replay_cache_entries ?? []).map(e => `${e.identity}|${e.nonce}`));
+ const labels = [...parsed.input].filter(([, m]) => m.params.get('tag') === 'web-bot-auth').map(([label]) => label);
+ if (!skipSignatureCount) {
+ // The profile takes exactly one web-bot-auth signature and one Signature-Agent member per request.
+ if (labels.length !== 1) throw new ProfileError(403, 'count', `expected one web-bot-auth signature, found ${labels.length}`);
+ if (parsed.agent.size !== 1) throw new ProfileError(403, 'count', `expected one Signature-Agent member, found ${parsed.agent.size}`);
+ }
+ const identities = {};
+ for (const label of labels) {
+ const origin = parsed.agent.get(label)?.value;
+ if (!origin) throw new ProfileError(403, 'signature', `no Signature-Agent member for ${label}`);
+ // Exactly the ASCII serialization of an https origin, compared as a string without normalizing.
+ if (!origin.startsWith('https://') || URL.parse(origin)?.origin !== origin) {
+ throw new ProfileError(403, 'signature', `Signature-Agent ${origin} is not an https origin`);
+ }
+ const { value: components, params } = parsed.input.get(label);
+ const covered = components.map(componentId);
+ const requiredComponents = skipAgentCoverage ? REQUIRED_COMPONENTS : [...REQUIRED_COMPONENTS, `"signature-agent";key="${label}"`];
+ for (const c of requiredComponents) {
+ if (!covered.includes(c)) throw new ProfileError(403, 'signature', `${label} does not cover ${c}`);
+ }
+ for (const p of REQUIRED_PARAMETERS) {
+ if (p === 'nonce' && skipNonce) continue;
+ if (!params.has(p)) throw new ProfileError(403, 'signature', `${label} has no ${p} parameter`);
+ }
+ if (!PROFILE_ALGORITHMS.includes(params.get('alg'))) throw new ProfileError(403, 'signature', `${label} alg is not ed25519`);
+ if (!skipNonce) {
+ // Unpadded base64url or canonical padded base64, as Cloudflare's validateNonce accepts.
+ const nonce = params.get('nonce');
+ const encoding = /^[A-Za-z0-9_-]+$/.test(nonce) ? 'base64url' : /^[A-Za-z0-9+/]+={0,2}$/.test(nonce) ? 'base64' : null;
+ const decoded = encoding ? Buffer.from(nonce, encoding) : null;
+ if (!decoded || decoded.length !== NONCE_BYTES || decoded.toString(encoding) !== nonce) {
+ throw new ProfileError(403, 'signature', `${label} nonce is not ${NONCE_BYTES} bytes, base64url or padded base64`);
+ }
+ }
+ const created = params.get('created');
+ const expires = params.get('expires');
+ if (created > now + CLOCK_SKEW || expires < now || expires - created > MAX_LIFETIME) {
+ throw new ProfileError(403, 'signature', `${label} is outside its validity window`);
+ }
+ const kid = params.get('keyid');
+ const published = keyidOnlyLookup ? keys.map(k => k.kid) : (vector.directories?.[origin]?.keys_ref ?? []);
+ if (!published.includes(kid)) throw new ProfileError(403, 'signature', `key ${kid} is not in the directory at ${origin}`);
+ const jwk = keys.find(k => k.kid === kid);
+ const base = requestBase(request, parsed, label);
+ if (!crypto.verify(null, Buffer.from(base), publicKey(jwk), parsed.signature.get(label).value)) {
+ throw new ProfileError(403, 'signature', `${label} signature does not verify`);
+ }
+ if (replayCache.has(`${origin}|${params.get('nonce')}`)) throw new ProfileError(429, 'replay', `${label} nonce already seen for ${origin}`);
+ identities[label] = origin;
+ }
+ return identities;
+}
+
+// ── Tests ─────────────────────────────────────────────────────────────────
+
+const positive = loadDir('positive');
+const negative = loadDir('negative');
+
+describe('Web Bot Auth profile test keys', () => {
+ it('derives each key from its published seed name', () => {
+ for (const k of keys) {
+ const seed = crypto.createHash('sha256').update(`rfc004-test/${k.seed_name}`).digest();
+ assert.equal(k._private_d_for_test_only, seed.toString('base64url'), k.seed_name);
+ const privateKey = crypto.createPrivateKey({ key: { kty: 'OKP', crv: 'Ed25519', x: k.x, d: k._private_d_for_test_only }, format: 'jwk' });
+ assert.equal(crypto.createPublicKey(privateKey).export({ format: 'jwk' }).x, k.x, k.seed_name);
+ }
+ });
+
+ it('uses the RFC 7638 JWK thumbprint as each kid', () => {
+ for (const k of keys) {
+ const thumbprint = crypto.createHash('sha256').update(`{"crv":"Ed25519","kty":"OKP","x":"${k.x}"}`).digest('base64url');
+ assert.equal(k.kid, thumbprint, k.seed_name);
+ }
+ });
+});
+
+describe('Web Bot Auth profile schema fields', () => {
+ it('signing_profile has no default, so filling in defaults never adds it next to authentication', () => {
+ for (const name of ['push-notification-config', 'notification-config', 'agent-notification-config']) {
+ const schema = JSON.parse(fs.readFileSync(path.join(__dirname, `../static/schemas/source/core/${name}.json`), 'utf8'));
+ const field = schema.properties.signing_profile;
+ assert.equal(field.$ref, '/schemas/enums/webhook-signing-profile.json', name);
+ assert.ok(!('default' in field), `${name}.signing_profile declares a default`);
+ assert.ok(schema.properties.authentication, `${name} has no authentication field`);
+ }
+ });
+});
+
+describe('Web Bot Auth profile positive vectors', () => {
+ for (const { file, vector } of positive.filter(e => !e.vector.response)) {
+ it(`${file}: the signature verifies and names the expected identity`, () => {
+ assert.deepEqual(verifyRequest(vector), vector.expected_outcome.identities);
+ });
+
+ it(`${file}: expected_signature_base matches the base rebuilt from the wire`, () => {
+ const parsed = parseRequestHeaders(vector.request.headers);
+ for (const label of parsed.input.keys()) {
+ assert.equal(requestBase(vector.request, parsed, label), vector.expected_signature_base[label], label);
+ }
+ });
+
+ it(`${file}: Content-Digest matches the body`, () => {
+ const digest = `sha-256=:${crypto.createHash('sha256').update(vector.request.body).digest('base64')}:`;
+ assert.equal(vector.request.headers['Content-Digest'], digest);
+ });
+ }
+
+ for (const { file, vector } of positive.filter(e => e.vector.response)) {
+ it(`${file}: each directory signature verifies with the key the directory itself publishes`, () => {
+ const { response } = vector;
+ assert.equal(response.headers['Content-Type'], 'application/http-message-signatures-directory+json');
+ const digest = `sha-256=:${crypto.createHash('sha256').update(response.body).digest('base64')}:`;
+ assert.equal(response.headers['Content-Digest'], digest);
+ const input = parseDictionary(response.headers['Signature-Input']);
+ const signature = parseDictionary(response.headers['Signature']);
+ const published = JSON.parse(response.body).keys;
+ for (const [label, member] of input) {
+ assert.deepEqual(member.value.map(componentId), ['"@authority";req', '"content-digest"'], label);
+ assert.equal(member.params.get('tag'), 'http-message-signatures-directory', label);
+ const jwk = published.find(k => k.kid === member.params.get('keyid'));
+ assert.ok(jwk, `${label} keyid is a key in the directory body`);
+ const base = [
+ `"@authority";req: ${new URL(vector.request.url).host}`,
+ `"content-digest": ${digest}`,
+ `"@signature-params": ${serializeInnerList(member)}`,
+ ].join('\n');
+ assert.equal(base, vector.expected_signature_base[label], label);
+ assert.ok(crypto.verify(null, Buffer.from(base), publicKey(jwk), signature.get(label).value), label);
+ }
+ });
+ }
+});
+
+// The check each negative vector targets, and the option that skips only that check.
+const TARGETS = {
+ '001-missing-nonce.json': { stage: 'signature', skip: { skipNonce: true } },
+ '002-replayed-nonce.json': { stage: 'replay' },
+ '003-signature-agent-not-covered.json': { stage: 'signature', skip: { skipAgentCoverage: true } },
+ '004-key-not-in-named-directory.json': { stage: 'signature', skip: { keyidOnlyLookup: true } },
+ '005-malformed-signature-agent.json': { stage: 'parse' },
+ '006-two-signatures.json': { stage: 'count', skip: { skipSignatureCount: true } },
+};
+
+describe('Web Bot Auth profile negative vectors', () => {
+ it('names a targeted check for every negative vector', () => {
+ assert.deepEqual(negative.map(e => e.file), Object.keys(TARGETS).sort());
+ });
+
+ for (const { file, vector } of negative) {
+ const target = TARGETS[file];
+
+ it(`${file}: rejected with ${vector.expected_outcome.status} at the ${target?.stage} check`, () => {
+ assert.throws(
+ () => verifyRequest(vector),
+ e => e instanceof ProfileError && e.status === vector.expected_outcome.status && e.stage === target.stage
+ );
+ });
+
+ if (vector.expected_signature_base) {
+ it(`${file}: expected_signature_base matches the base rebuilt from the wire`, () => {
+ const parsed = parseRequestHeaders(vector.request.headers);
+ for (const label of Object.keys(vector.expected_signature_base)) {
+ assert.equal(requestBase(vector.request, parsed, label), vector.expected_signature_base[label], label);
+ }
+ });
+ }
+
+ if (target?.skip) {
+ it(`${file}: verifies once the targeted check is skipped`, () => {
+ assert.doesNotThrow(() => verifyRequest(vector, target.skip));
+ });
+ }
+ }
+
+ it('006: both signatures verify on their own, so only the count check rejects the request', () => {
+ const { vector } = negative.find(e => e.file === '006-two-signatures.json');
+ const { vector: original } = positive.find(e => e.file === '001-single-signer-request.json');
+ assert.deepEqual(verifyRequest(vector, { skipSignatureCount: true }), { sig1: 'https://buyer-7k3q.com', sig2: 'https://agent.brand-7k3q.com' });
+ assert.equal(vector.expected_signature_base.sig1, original.expected_signature_base.sig1);
+ });
+
+ it('a second Signature-Agent member on a single-signature request is rejected with 403', () => {
+ const { vector: original } = positive.find(e => e.file === '001-single-signer-request.json');
+ const headers = { ...original.request.headers, 'Signature-Agent': `${original.request.headers['Signature-Agent']}, sig2="https://agent.brand-7k3q.com"` };
+ const vector = { ...original, request: { ...original.request, headers } };
+ assert.throws(() => verifyRequest(vector), e => e instanceof ProfileError && e.status === 403 && e.stage === 'count');
+ assert.deepEqual(verifyRequest(vector, { skipSignatureCount: true }), original.expected_outcome.identities);
+ });
+
+ it('a Signature-Agent value that is not exactly an https origin is refused with 403', () => {
+ const { vector: original } = positive.find(e => e.file === '001-single-signer-request.json');
+ const kid = parseRequestHeaders(original.request.headers).input.get('sig1').params.get('keyid');
+ const jwk = keys.find(k => k.kid === kid);
+ const privateKey = crypto.createPrivateKey({ key: { kty: 'OKP', crv: 'Ed25519', x: jwk.x, d: jwk._private_d_for_test_only }, format: 'jwk' });
+ for (const value of ['http://buyer-7k3q.com', 'https://buyer-7k3q.com/', 'https://Buyer-7k3q.com', 'https://buyer-7k3q.com:443', 'https://buyer-7k3q.com/agent']) {
+ // Re-sign with the published seed, so the origin rule is the only one the request breaks.
+ const unsigned = { ...original.request, headers: { ...original.request.headers, 'Signature-Agent': `sig1="${value}"` } };
+ const signature = crypto.sign(null, Buffer.from(requestBase(unsigned, parseRequestHeaders(unsigned.headers), 'sig1')), privateKey);
+ const request = { ...unsigned, headers: { ...unsigned.headers, Signature: `sig1=:${signature.toString('base64')}:` } };
+ const vector = { ...original, request, directories: { [value]: original.directories['https://buyer-7k3q.com'] } };
+ assert.throws(() => verifyRequest(vector), e => e instanceof ProfileError && e.status === 403 && /not an https origin/.test(e.message), value);
+ }
+ });
+
+ it('a Signature-Input member with another tag is not read', () => {
+ const { vector: original } = positive.find(e => e.file === '001-single-signer-request.json');
+ const h = original.request.headers;
+ const headers = {
+ ...h,
+ 'Signature-Input': `${h['Signature-Input']}, cdn=("@method" "@authority");created=1790841600;keyid="edge";alg="ed25519";tag="cdn-edge"`,
+ Signature: `${h.Signature}, cdn=:${Buffer.alloc(64).toString('base64')}:`,
+ };
+ const vector = { ...original, request: { ...original.request, headers } };
+ assert.deepEqual(verifyRequest(vector), original.expected_outcome.identities);
+ });
+
+ it('002: the replayed request is byte-identical to positive/001', () => {
+ const { vector } = negative.find(e => e.file === '002-replayed-nonce.json');
+ const { vector: original } = positive.find(e => e.file === '001-single-signer-request.json');
+ assert.deepEqual(vector.request, original.request);
+ });
+});