You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
signing: derive request profile from the negotiated AdCP version #1037
SDK 8.0.0b2 changes the request-signing default to the strict AdCP 3.2 profile, but the high-level client does not derive that profile from its configured/negotiated AdCP version.
ADCPClient(adcp_version="3.1", signing=SigningConfig(...)) injects adcp_version="3.1" into requests while SigningConfig.signing_profile_version independently defaults to "3.2". _sign_outgoing_request() passes that value directly to sign_request().
The resulting request claims 3.1 but uses 3.2 Structured Fields binary encoding. A strict 3.1 peer expects the legacy Base64URL representation and may reject it.
The migration guide currently tells adopters to override signing_profile_version="3.1" manually. That is easy to miss and makes the high-level client's version pin internally inconsistent.
Proposed behavior
Make the high-level signing profile default derive from the client's trusted configured/negotiated AdCP version.
Preserve an explicit SigningConfig(signing_profile_version=...) override for endpoints whose trusted deployment configuration requires it.
Apply per-agent pins in ADCPMultiAgentClient, including mixed 3.1/3.2 fleets.
Never select a verification profile from an unsigned request-body field; trusted endpoint configuration and negotiated capabilities remain authoritative.
For low-level sign_request() / async_sign_request(), either require an explicit signing_profile_version or make the newest-profile default unmistakable in API docs and warnings. Requiring it in SDK 8 is preferable because the low-level function has no negotiation context.
Acceptance tests
A 3.1-pinned ADCPClient signs with the 3.1 binary encoding when no profile override is supplied.
A 3.2-pinned client signs with standard padded Base64.
Explicit overrides win and are documented as advanced/trusted configuration.
A heterogeneous multi-agent client signs each endpoint using its own pin.
Low-level signer behavior is explicit and covered by both 3.1 and 3.2 conformance vectors.
Classification: Bug Bucket(s): signing (label missing from repo — see run summary) Status: ready-to-implement
What the experts said:
ad-tech-protocol-expert: Bug confirmed — 3.1 and 3.2 profiles use distinct wire encodings (sig1=:<b64>: vs raw Base64URL); a strict 3.1 peer will reject a 3.2-signed request. Fix is protocol-correct but must also address the low-level sign_request/async_sign_request footgun (they still default to "3.2" with no context to derive from). Noted that capability advertisement (request_signing.supported_profiles) should sit between explicit override and version inference in the precedence chain.
security-reviewer: No constant-time or replay risk from profile selection. Key blocker: the sentinel None must resolve exclusively from self._adcp_version (construction-time local config), never from self._server_version (peer-supplied) — the existing conflation at client.py:682 must not be copied here. Also, the resolved value must be asserted to a valid literal before reaching signer.py:225; if None reaches that guard (signing_profile_version != "3.2"), it evaluates True and silently picks legacy encoding — the wrong direction.
My take: Both experts agree on direction; disagreement is on implementation pitfalls, not architecture. This is a correct bug fix for a real encoding mismatch. Because signing is security-sensitive, the PR authorization gate does not pass automatically — this needs a human or /triage execute to authorize a draft PR.
Implementation scope:
src/adcp/signing/autosign.py — SigningConfig: Change signing_profile_version default from "3.2" to a sentinel (None). Update type to Literal["3.0","3.1","3.2"] | None = None. The __post_init__ validator should accept None (meaning "derive from context"). Update __repr__ to reflect the None case.
src/adcp/client.py — _sign_outgoing_request(): When self.signing.signing_profile_version is None, resolve the effective profile from self._adcp_version (not self._server_version). Map "3.0" → "3.0", "3.1" or "3.1-beta" → "3.1", "3.2"+ → "3.2". Assert the result is a valid literal before passing to sign_request(). Precedence: explicit override > capability advertisement (request_signing.supported_profiles if the block advertises one) > version inference.
src/adcp/signing/signer.py — low-level API: Remove or deprecate the "3.2" default on sign_request and async_sign_request. These functions have no negotiation context; callers should pass an explicit value. In SDK 8 (beta), requiring the argument is preferable to a silent default.
src/adcp/client.py — ADCPMultiAgentClient: The same SigningConfig is passed to each per-agent ADCPClient. Since ADCPClient now derives the profile from its own _adcp_version, mixed-version fleets automatically get per-agent signing profiles — no additional change needed there.
Required checks:pytest on tests/ (especially any signing tests), mypy src/ (type change on SigningConfig), ruff check ., black --check .
Acceptance vectors: A 3.1-pinned client with no profile override signs with legacy Base64URL. A 3.2-pinned client signs with sf-binary colon notation. Explicit signing_profile_version="3.1" wins regardless of adcp_version. Mixed-version ADCPMultiAgentClient signs each endpoint using its per-agent pin.
Non-breaking rationale: The current behavior is a bug that produces wire-invalid requests for 3.1-pinned clients. The fix changes the default only for clients where adcp_version != "3.2" and signing_profile_version was not explicitly set — a case that was already broken. Existing callers that explicitly set signing_profile_version or that use the default adcp_version (which resolves to the SDK compile-time pin) are unaffected.
Activity
bokelley commentedon Aug 18, 2026
Triage
Classification: Bug
Bucket(s): signing (label missing from repo — see run summary)
Status: ready-to-implement
What the experts said:
sig1=:<b64>:vs raw Base64URL); a strict 3.1 peer will reject a 3.2-signed request. Fix is protocol-correct but must also address the low-levelsign_request/async_sign_requestfootgun (they still default to "3.2" with no context to derive from). Noted that capability advertisement (request_signing.supported_profiles) should sit between explicit override and version inference in the precedence chain.Nonemust resolve exclusively fromself._adcp_version(construction-time local config), never fromself._server_version(peer-supplied) — the existing conflation atclient.py:682must not be copied here. Also, the resolved value must be asserted to a valid literal before reachingsigner.py:225; ifNonereaches that guard (signing_profile_version != "3.2"), it evaluatesTrueand silently picks legacy encoding — the wrong direction.My take: Both experts agree on direction; disagreement is on implementation pitfalls, not architecture. This is a correct bug fix for a real encoding mismatch. Because signing is security-sensitive, the PR authorization gate does not pass automatically — this needs a human or
/triage executeto authorize a draft PR.Implementation scope:
src/adcp/signing/autosign.py—SigningConfig: Changesigning_profile_versiondefault from"3.2"to a sentinel (None). Update type toLiteral["3.0","3.1","3.2"] | None = None. The__post_init__validator should acceptNone(meaning "derive from context"). Update__repr__to reflect theNonecase.src/adcp/client.py—_sign_outgoing_request(): Whenself.signing.signing_profile_version is None, resolve the effective profile fromself._adcp_version(notself._server_version). Map"3.0"→"3.0","3.1"or"3.1-beta"→"3.1","3.2"+→"3.2". Assert the result is a valid literal before passing tosign_request(). Precedence: explicit override > capability advertisement (request_signing.supported_profilesif the block advertises one) > version inference.src/adcp/signing/signer.py— low-level API: Remove or deprecate the"3.2"default onsign_requestandasync_sign_request. These functions have no negotiation context; callers should pass an explicit value. In SDK 8 (beta), requiring the argument is preferable to a silent default.src/adcp/client.py—ADCPMultiAgentClient: The sameSigningConfigis passed to each per-agentADCPClient. SinceADCPClientnow derives the profile from its own_adcp_version, mixed-version fleets automatically get per-agent signing profiles — no additional change needed there.pytestontests/(especially any signing tests),mypy src/(type change onSigningConfig),ruff check .,black --check .signing_profile_version="3.1"wins regardless ofadcp_version. Mixed-versionADCPMultiAgentClientsigns each endpoint using its per-agent pin.Non-breaking rationale: The current behavior is a bug that produces wire-invalid requests for 3.1-pinned clients. The fix changes the default only for clients where
adcp_version != "3.2"andsigning_profile_versionwas not explicitly set — a case that was already broken. Existing callers that explicitly setsigning_profile_versionor that use the defaultadcp_version(which resolves to the SDK compile-time pin) are unaffected.Triaged by Claude Code. Session: https://claude.ai/code/cse_018nAEbrtuXYRKbEewyA341Z
Generated by Claude Code