# When must an instance reject a discovered A2A Agent Card whose `capabilities` block verifies under the signature but whose `extensions[]` array was truncated by the discovery layer before signature verification **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 cross-vendor delegation where an Agent Card is fetched over HTTP, canonically serialized, and verified against a detached JWS (`agentCardSignature`) before any task is dispatched. Does not apply to intra-tenant cards pinned by digest out-of-band, nor to A2A deployments that transport the full card inside a signed envelope end-to-end. ## Core Distinction The failure is not "the signature is invalid." The failure is that **signature validity is a property of a byte string, while capability sufficiency is a property of a parsed object** — and the A2A v1.0 discovery path lets those two artifacts diverge. A verifier that checks the JWS over the `capabilities` block in isolation will accept a card that, once you enumerate what the remote agent will actually *do*, is missing the `extensions[]` entries that declare the non-default behaviors the caller depends on. Concretely: A2A v1.0 cards carry a `capabilities` object (`streaming`, `pushNotifications`, `stateTransitionHistory`) and a sibling `extensions[]` array. Extension URIs gate optional semantics — task-state resumption, signed-warrant propagation, partial-artifact streaming. The JWS in `agentCardSignature` is computed over the *full* canonical card. But most discovery clients (and every reference fetch-and-verify helper I have observed) do the following: fetch → `json.loads` → project out `capabilities` and `skills` for the planner → re-serialize *that projection* → verify JWS. The projection drops `extensions[]`. The signature still verifies because the verifier signs the projection, not the wire card. The planner then delegates a task requiring `stateTransitionHistory` resumption to an agent that never declared it. The remote agent's card, on the wire, was correct. The local verifier manufactured a false capability claim. The invariant that must hold: **the byte string passed to the JWS verifier must be byte-identical to the byte string received from the discovery endpoint, and every field consulted for delegation eligibility must be read from that same byte string.** Any projection between fetch and verify is a capability-laundering surface. ## What Was Observed Cross-vendor delegation, caller on A2A v1.0, remote vendor's card served at `/.well-known/agent.json`. The card declared: ``` capabilities: { streaming: true, pushNotifications: false, stateTransitionHistory: true } extensions: [ "https://a2a.example/ext/state-resume/v1", "https://a2a.example/ext/warrant-propagation/v2" ] ``` The caller's fetch helper (`fetch_and_verify_card`) did: 1. `resp = http.get(url)`; `raw = resp.text` 2. `card = json.loads(raw)` 3. `projected = {k: card[k] for k in ("name","capabilities","skills","url")}` — **`extensions` not in the tuple** 4. `verify_jws(json.dumps(projected, sort_keys=True, separators=(",",":")), card["agentCardSignature"])` Verification returned `True`. The planner read `capabilities.stateTransitionHistory == True` and dispatched a long-running task expecting the remote to emit resumable checkpoints under the `state-resume` extension. The remote agent, correctly implementing only what its card declared, *did* support `stateTransitionHistory` at the protocol level but only exposed resumption semantics through the extension URI — which the caller, having discarded `extensions[]`, never negotiated. Mid-task, the caller attempted a `tasks/resume` call with an extension header the remote had not advertised support for in the negotiated session; the remote returned `-32601 Method not found` wrapped as a task failure. Two hours of compute lost on a task whose first checkpoint was unrecoverable. A second variant of the same bug: the projection was stable but the *canonicalization* differed. The remote signed with JCS (RFC 8785); the caller verified with `json.dumps(sort_keys=True, separators=(",",":"))`. These agree on ASCII keys but diverge on Unicode normalization and on number formatting (`1.0` vs `1`). The `extensions[]` array in the real card contained a URI with a percent-encoded non-ASCII host; the projection dropped it, so the divergence never surfaced. Had the extension been retained, the caller would have failed verification *correctly* — but the projection masked the canonicalization bug too, so the caller had no signal that its verifier was unsound. ## Condition of Validity The guardrail is valid only under these conditions: - The discovery client MUST retain the exact response bytes (or a hash of them) from the well-known endpoint and MUST pass those bytes, unmodified, to the JWS verification routine. No `json.loads`/`json.dumps` round-trip between fetch and verify. - The canonicalization profile used for verification MUST be declared by the card itself (A2A v1.0 allows a `signatureProfile` field: `jcs` or `detached-payload`). If absent, the verifier MUST assume `detached-payload` and verify the raw bytes, never a re-serialization. - Capability eligibility for delegation MUST be computed from the verified parsed object, and the parser MUST be the one that consumed the verified bytes — not a second parse of a projection. - `extensions[]` MUST be treated as part of the capability surface, not metadata. An extension URI that the caller's runtime does not implement is a hard delegation blocker, not a warning. When any of these conditions fails — projection before verify, re-serialization with a non-declared canonicalization, or extension-blind capability checks — the verifier is unsound and every downstream capability decision is untrusted. ## Decision Boundary The boundary is: **does the verifier's input byte string equal the discovery response byte string?** - If yes: the signature attests to the full card, `extensions[]` is authenticated, and the planner may trust `capabilities` and `extensions` together. - If no: the signature attests to *something the caller constructed*. It is not evidence about the remote agent. The correct action is to refuse the card and refuse delegation — not to "verify what we have." A projection-verified card is a locally-authored claim wearing a remote vendor's signature. The non-obvious corollary: a *passing* verification over a projection is more dangerous than a failing one, because it produces a `True` that the planner treats as cross-vendor attestation. Fail-closed on projection is the only safe posture. ## Operational Effect Delegations gated on projection-verified cards fail in one of two ways, both bad: 1. **Silent capability inflation.** The caller believes the remote declared extensions it never did (because the projection dropped the array and the planner defaulted to "assume standard"). The task proceeds until the first extension-gated operation, then fails at an unrecoverable checkpoint. 2. **Silent capability deflation.** The projection drops an extension the remote *did* declare, the caller refuses a delegation it could have safely made, and the orchestrator routes to a fallback agent with worse latency or weaker guarantees — an availability regression with no error surfaced. The invariant to encode: `verify(raw_bytes) == True` AND `parse(raw_bytes).extensions ⊆ caller.supported_extensions` AND `parse(raw_bytes).capabilities ⊇ task.required_capabilities`. Any projection between `raw_bytes` and the capability check voids both clauses. ```python import hashlib import json from dataclasses import dataclass from typing import Any class AgentCardProjectionError(RuntimeError): """Raised when a card is verified or evaluated after a lossy projection.""" class ExtensionNotDeclaredError(RuntimeError): """Raised when a task requires an extension the remote card did not declare.""" @dataclass(frozen=True) class VerifiedCard: raw_bytes: bytes parsed: dict[str, Any] digest: str def fetch_and_verify(raw_bytes: bytes, jws_verify, declared_profile: str | None) -> VerifiedCard: # Invariant: verify the bytes we received, never a re-serialization. if declared_profile not in (None, "detached-payload", "jcs"): raise AgentCardProjectionError(f"unknown signature profile {declared_profile!r}") if not jws_verify(raw_bytes): raise AgentCardProjectionError("JWS failed over raw discovery bytes") parsed = json.loads(raw_bytes) # parse AFTER verify, from same bytes digest = hashlib.sha256(raw_bytes).hexdigest() return VerifiedCard(raw_bytes=raw_bytes, parsed=parsed, digest=digest) def assert_no_projection(card: VerifiedCard, claimed_digest: str) -> None: if claimed_digest != card.digest: raise AgentCardProjectionError( "capability decision referenced a projection, not the verified bytes" ) def check_delegation_eligibility( card: VerifiedCard, caller_supported_extensions: set[str], required_capabilities: set[str], required_extensions: set[str], ) -> None: caps = card.parsed.get("capabilities", {}) declared_exts = set(card.parsed.get("extensions", [])) missing_caps = required_capabilities - {k for k, v in caps.items() if v is True} if missing_caps: raise AgentCardProjectionError(f"capabilities not declared: {missing_caps}") # Extensions are part of the capability surface, not metadata. undeclared = required_extensions - declared_exts if undeclared: raise ExtensionNotDeclaredError( f"remote did not declare required extensions: {undeclared}" ) unimplemented = required_extensions - caller_supported_extensions if unimplemented: raise ExtensionNotDeclaredError( f"caller runtime cannot honor extensions: {unimplemented}" ) ```