# Why does an instance accept a delegated task whose Agent Card signature verifies but whose declared capabilities were never covered by the signed payload? **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 cross-organization task delegation where the receiving agent validates the caller's Agent Card via detached JWS over the card's JSON body, then dispatches on `skills[].id` and `capabilities` fields. Does not apply to same-org delegation where cards are pinned by config, nor to transports that re-sign the full request envelope per call. ## Core Distinction There are two distinct trust surfaces in A2A card discovery, and they are routinely collapsed into one: 1. **Provenance integrity** — the card body arrived unmodified from the asserted issuer (detached JWS over the canonicalized card JSON). 2. **Capability binding** — the specific `skills[].id`, `inputModes`, and `securitySchemes` the caller is about to invoke are *inside the signed region* and were *covered by the signature at the time it was produced*. A card can pass (1) and fail (2). The failure arises because the JWS `payload` is computed over a canonicalized serialization whose field set is determined by the *signing* implementation, while the *verifying* implementation dispatches on the *parsed* object graph. Any field the signer's canonicalizer dropped, or any field the verifier's parser synthesizes via defaulting, sits outside the signed region but inside the dispatch decision. The signature verifies; the capability was never attested. ## What Was Observed Cross-org delegation from Org A (caller) to Org B (executor). Org A publishes `/.well-known/agent-card.json` plus a detached JWS at `/.well-known/agent-card.json.jws`. Trace of a failing delegation: 1. Org B's discovery client fetches the card. The raw body contains `skills: [{"id": "invoice.reconcile", ...}]` and, appended by a CDN edge injector, a `"capabilities": {"streaming": true, "pushNotifications": true}` block that the origin never emitted. 2. Org B canonicalizes the *parsed* card with JCS (RFC 8785), strips the `signatures` member, and verifies the detached JWS. **Verification passes** — because the JWS `payload` was the base64url of the origin's JCS-canonical form, and JCS re-serialization of the parsed object reproduces the origin's byte sequence only if the parsed object equals the origin's object. It does not. The injected `capabilities` block is present in the parsed object, so JCS output differs, so the digest differs, so verification should fail — *unless* the verifier's canonicalizer is configured to ignore unknown top-level members (a common "forward-compat" setting), in which case the injected block is silently excluded from the digest and the signature still verifies. 3. Org B dispatches `tasks/send` with `skill: "invoice.reconcile"` and `configuration: {"streaming": true}`. Org A accepts, but its runtime has `streaming: false` (the origin card never declared it; the injected block did). Org A opens a JSON-RPC stream, emits `task.status-update` for 90 seconds, then closes with no terminal `completed`/`failed` — the stream is half-open because the origin's stream handler was never wired for `streaming: true`. 4. Org B's task state machine is stuck in `working`. Its timeout is 300s. At t=300s it emits `tasks/cancel`. Org A has no cancel handler for a task it never registered as streaming-capable; it returns JSON-RPC error `-32601 Method not found` on the cancel. Org B treats `-32601` on cancel as a protocol violation and escalates to a human. The signature was valid. The capability was fabricated by an intermediary. The verifier's canonicalizer, tuned for schema evolution, excluded the fabricated field from the digest. ## Condition of Validity The invariant that must hold for cross-org delegation to be safe: > **Dispatch-relevant fields ⊆ signed-region fields, and signed-region fields are determined by the signer, not the verifier.** Concretely, for every field `f` the executor reads during dispatch (`skills[].id`, `skills[].inputModes`, `capabilities.streaming`, `capabilities.pushNotifications`, `securitySchemes`, `defaultInputModes`), `f` must be present in the JWS payload digest *as the signer serialized it*. This fails when any of: - The verifier's canonicalizer drops members it does not recognize (forward-compat mode). - The signer's canonicalizer omits null/absent members that the verifier's parser synthesizes via schema defaults (e.g., `capabilities.streaming` defaulting to `false` at parse time but absent from the signed bytes — the *default* is unsigned). - A transport intermediary (CDN, API gateway, service mesh) rewrites the body after signing but the verifier re-canonicalizes the rewritten body against the original digest. - The card is served with `Content-Type: application/json` but the JWS was computed over a differently-encoded body (UTF-8 BOM, trailing newline, key ordering). The invariant holds only when the verifier (a) restricts its canonicalizer to a closed field set that matches the signer's, (b) rejects any parsed member absent from the signed payload rather than ignoring it, and (c) treats parse-time schema defaults as *untrusted* — a defaulted field is not an attested field. ## Decision Boundary The boundary is not "verify the signature." It is "verify that the field you are about to dispatch on is inside the digest." Two verifier postures sit on either side: - **Permissive (fails open):** canonicalizer ignores unknown members; parser applies schema defaults; dispatch reads the merged object. This is the default in most JSON-Schema-based A2A clients and is the failure mode above. - **Strict (fails closed):** verifier recomputes the digest over the *exact received bytes* (not a re-canonicalization), compares byte-for-byte against the JWS payload, and rejects any parsed member whose key path is not present in the decoded payload. Defaults are applied only after the strict check, and any dispatch on a defaulted field requires an explicit capability assertion in the request. The decision rule: **if the canonicalization path used for verification differs from the canonicalization path used at signing, the signature is not a capability attestation — it is only a provenance hint.** Provenance hints are insufficient for cross-org dispatch because the executor's behavior depends on fields the hint does not cover. ## Operational Effect Downstream consequences of the permissive posture, in order of blast radius: 1. **Silent capability inflation.** Intermediaries, caches, and edge injectors can add `capabilities` and `skills` entries that survive signature verification. The executor dispatches on capabilities the origin never had. Streaming, push-notification, and multi-turn skills are the most commonly injected because they are the most commonly defaulted. 2. **Half-open task states.** When the inflated capability is a transport mode (streaming, push), the executor's handler for that mode is absent. The task enters `working` and never reaches a terminal state. The caller's cancel path is also unregistered, so cancellation returns `-32601`, which callers interpret as a protocol violation rather than a capability mismatch. 3. **Audit divergence.** The signed card in the audit log shows `capabilities.streaming: false` (or absent); the dispatch log shows `configuration.streaming: true`. Post-incident reconciliation finds the executor "correctly" rejected a capability it never had, while the caller "correctly" sent a capability the card declared. Both parties are internally consistent; the divergence is entirely in the unsigned region. 4. **Cross-org trust erosion.** Because the failure is invisible to signature verification, the natural remediation is to distrust the *issuer*, not the *verifier*. Orgs blacklist each other's cards over an intermediary injection neither party authored. The guardrail: strict byte-equality verification against the received body, a closed field set for dispatch, and a hard rule that any dispatch on a field absent from the decoded JWS payload raises before the task is enqueued. The exception below encodes that last rule. ```python import base64 import json from typing import Any class UnsignedCapabilityDispatchError(RuntimeError): """Raised when dispatch reads a field not covered by the Agent Card JWS payload.""" def __init__(self, field_path: str, payload_keys: set[str]): self.field_path = field_path self.payload_keys = payload_keys super().__init__( f"dispatch field {field_path!r} is not present in the signed JWS payload " f"(signed top-level keys: {sorted(payload_keys)}); " f"capability is unsigned and must not be trusted cross-org" ) def _decode_jws_payload(detached_jws: str) -> dict[str, Any]: # JWS compact form: header.payload.signature ; payload is base64url _, payload_b64, _ = detached_jws.split(".") raw = base64.urlsafe_b64decode(payload_b64 + "=" * (-len(payload_b64) % 4)) return json.loads(raw) def assert_capability_signed( card: dict[str, Any], detached_jws: str, dispatch_path: tuple[str, ...], ) -> None: """Fail closed if the field the caller is about to dispatch on is not in the signed payload.""" signed = _decode_jws_payload(detached_jws) signed_keys = set(signed.keys()) # 1. Top-level key must be inside the signed payload. top = dispatch_path[0] if top not in signed_keys: raise UnsignedCapabilityDispatchError(top, signed_keys) # 2. Walk the signed payload; any missing intermediate or leaf is unsigned. cursor: Any = signed walked: list[str] = [] for segment in dispatch_path: walked.append(segment) if not isinstance(cursor, dict) or segment not in cursor: raise UnsignedCapabilityDispatchError(".".join(walked), signed_keys) cursor = cursor[segment] # 3. The value the caller will dispatch on must equal the signed value. parsed_cursor: Any = card for segment in dispatch_path: if not isinstance(parsed_cursor, dict): raise UnsignedCapabilityDispatchError(".".join(dispatch_path), signed_keys) parsed_cursor = parsed_cursor.get(segment) if parsed_cursor != cursor: raise UnsignedCapabilityDispatchError( ".".join(dispatch_path) + " (value mismatch: parsed != signed)", signed_keys, ) # Example dispatch gate def dispatch_task(card: dict[str, Any], detached_jws: str, task: dict[str, Any]) -> None: assert_capability_signed(card, detached_jws, ("capabilities", "streaming")) assert_capability_signed(card, detached_jws, ("skills",)) # ... enqueue only after both assertions pass ```