# Where must an instance refuse a delegated A2A task when the Agent Card's declared `capabilities.streaming` and `defaultInputModes` disagree with the signed task envelope **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 cross-vendor delegation where a client agent resolves a remote Agent Card via `.well-known/agent-card.json`, verifies its JWS signature, then submits a `tasks/send` JSON-RPC request. Does not cover intra-vendor delegation where both peers share a registry and signing key, nor A2A v0.2 unsigned cards. ## Core Distinction The failure this record isolates is not "the remote agent rejected the task." It is the subtler case where the remote agent **accepted** the task, executed it, and returned a result whose shape contradicts the Agent Card the client verified before dispatch. Two distinct objects govern the exchange: - The **Agent Card** — a signed, static capability declaration: `capabilities.streaming`, `capabilities.pushNotifications`, `defaultInputModes`, `defaultOutputModes`, `skills[]` with per-skill `inputModes`/`outputModes`. - The **task envelope** — the runtime JSON-RPC `params` carrying `message.parts`, `message.metadata`, and the negotiated `acceptedOutputModes`. The invariant that holds in a correct A2A v1.0 exchange is: *the output modes returned in the terminal `Task` or `Message` must be a subset of the intersection of the card's declared `defaultOutputModes` and the client's `acceptedOutputModes` in the request.* The boundary failure occurs when the card is **signed but stale relative to the deployed skill handler** — the signature validates the card bytes, not the behavior of the process serving them. A card can be cryptographically pristine and operationally false. ## What Was Observed In a cross-vendor delegation trace, a client agent (vendor A) resolved the Agent Card of a specialist agent (vendor B) at `https://b.example/.well-known/agent-card.json`. The card declared: ``` "capabilities": { "streaming": false, "pushNotifications": true }, "defaultInputModes": ["text/plain"], "defaultOutputModes": ["text/plain"], "skills": [{ "id": "summarize", "inputModes": ["text/plain"], "outputModes": ["text/plain"] }] ``` The JWS signature over the canonicalized card verified against vendor B's published `jku`. The client dispatched `tasks/send` with `acceptedOutputModes: ["text/plain"]` and `message.parts: [{kind:"text", text: "..."}]`. The remote returned a terminal `Task` in state `completed` whose `artifacts[0].parts[0].kind` was `"file"` — a base64 PDF artifact — with `metadata.mimeType: "application/pdf"`. The client's downstream consumer, which had asserted `text/plain` based on the verified card, attempted to parse the artifact as UTF-8. It did not fail loudly: it produced a truncated, mojibake summary that was then written into the client's episodic memory as a valid task result. The corruption surfaced three task-steps later when a downstream agent retrieved that memory record and reasoned over garbage. The critical observation: **signature verification passed, schema validation of the response passed (the A2A `Task` schema permits any `Part` kind), and the only violated contract was the semantic output-mode agreement encoded in the card.** No layer in the client stack was positioned to catch it because the card was treated as an authorization fact rather than a capability *claim*. ## Condition of Validity The invariant "returned output modes ⊆ card ∩ accepted" is only enforceable when the client treats the card as a **pre-flight constraint to be re-checked at response time**, not merely at dispatch. Concretely, the guard is valid only if all of the following hold: 1. The client retains the exact card bytes (and their hash) it verified, keyed to the `taskId`, for the lifetime of the task — including across any checkpoint/resume boundary. If the client re-fetches the card mid-task and the remote has rotated it, the constraint must be evaluated against the *dispatch-time* card, not the current one, or the client must treat rotation as a task-invalidating event. 2. `acceptedOutputModes` is sent explicitly in every `tasks/send` envelope. Omitting it and relying on the card default is the common trigger — it collapses the intersection to the card alone and removes the client's own veto. 3. The response `Part.kind` and any `metadata.mimeType` are mapped back to an output mode and checked against the retained intersection *before* the artifact enters any memory write path. If any of these is absent, the invariant is unenforceable and the client is silently trusting a claim it cannot audit at the point of consumption. ## Decision Boundary The boundary is a single predicate evaluated at response ingestion: ``` returned_mode ∈ (card.defaultOutputModes ∪ skill.outputModes) ∩ request.acceptedOutputModes ``` - **Inside the boundary:** returned mode is in the intersection → accept, write to memory, advance. - **At the boundary (mode in card but not in accepted):** the remote honored its card but violated the client's request. This is a *client-side contract breach by the remote* — reject the artifact, mark task `failed` with reason `output_mode_unsolicited`, do **not** write to memory. - **Outside the boundary (mode not in card at all):** the remote's signed card is operationally false. This is the dangerous case. The correct action is to quarantine the artifact, emit an `agent_card_drift` telemetry event keyed to the card hash, and — critically — **downgrade the card's trust weight for subsequent delegations** rather than merely failing this one task. A card that lied once will lie again until re-signed. The non-obvious decision: a client must **not** fall back to "parse as text and hope" when an unexpected mode arrives. The failure above happened precisely because the fallback path existed and produced plausible-looking garbage. The boundary must be hard: unexpected mode → exception, not coercion. ## Operational Effect Enforcing this boundary converts a silent memory-poisoning failure into a loud, attributable, per-task failure with a stable telemetry key. The operational consequences: - **Memory integrity:** no artifact enters episodic memory unless its mode was in the verified intersection at dispatch time and re-checked at ingestion. This closes the specific corruption path observed. - **Card trust becomes stateful:** the client maintains a per-vendor card-hash trust ledger. A drift event decrements trust; N drifts within a window triggers forced re-verification and, if unresolved, removal from the delegation allowlist. The signed card is treated as evidence, not truth. - **Resume safety:** the dispatch-time card hash is part of the task checkpoint. On resume, the client re-derives the intersection from the checkpointed card, never from a fresh fetch. A rotated card mid-task is a resume-time exception, not a silent re-negotiation. The cost is one retained card blob per in-flight task and one predicate at ingestion. The benefit is that a cross-vendor agent can no longer poison a downstream agent's memory through a capability claim its own signature cannot substantiate. ```python class OutputModeContractViolation(RuntimeError): """Raised when a returned A2A artifact's mode escapes the verified card ∩ accepted intersection.""" def __init__(self, task_id: str, returned_mode: str, card_hash: str, allowed: frozenset): self.task_id = task_id self.returned_mode = returned_mode self.card_hash = card_hash self.allowed = allowed super().__init__( f"task {task_id}: returned mode {returned_mode!r} not in " f"card∩accepted {sorted(allowed)} (card_hash={card_hash[:12]})" ) def ingest_artifact(task_id: str, artifact_part: dict, dispatch_card: dict, dispatch_card_hash: str, accepted_output_modes: frozenset) -> dict: # Reconstruct the intersection from the DISPATCH-TIME card, not a fresh fetch. card_modes = set(dispatch_card.get("defaultOutputModes", [])) for skill in dispatch_card.get("skills", []): card_modes.update(skill.get("outputModes", [])) allowed = frozenset(card_modes) & accepted_output_modes returned_mode = artifact_part.get("metadata", {}).get("mimeType") \ or _kind_to_mode(artifact_part.get("kind")) if returned_mode not in allowed: # Hard boundary: never coerce, never fall back to text parsing. raise OutputModeContractViolation( task_id=task_id, returned_mode=returned_mode, card_hash=dispatch_card_hash, allowed=allowed, ) return artifact_part def _kind_to_mode(kind: str) -> str: return {"text": "text/plain", "file": "application/octet-stream", "data": "application/json"}.get(kind, f"unknown/{kind}") ```