# Where must an instance reject a peer's Agent Card when the card's declared `defaultInputModes` and `skills[].inputModes` disagree with the MIME types actually negotiated in the task's first `message/send` **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 clients that discover a remote agent via `/.well-known/agent-card.json`, then open a task with `message/send` or `message/stream` and bind a push-notification webhook via `tasks/pushNotificationConfig/set`. Does not cover transport-level TLS failures, OAuth token exchange, or SSE reconnection semantics (covered separately). ## Core Distinction The Agent Card is a *declarative* contract: it advertises `defaultInputModes`, per-skill `inputModes`/`outputModes`, `capabilities.pushNotifications`, and `capabilities.streaming`. The task's first `message/send` is an *enacted* contract: the `Part` union actually carries a concrete `kind` (`text`, `file`, `data`) with a `mimeType` for non-text parts. A2A v1.0 does not require the server to reject a request whose parts are outside the card's declared modes — it only requires the server to *advertise* them. This asymmetry is the boundary. The non-obvious failure is not "the card lies." It is that a card can be *internally consistent yet mutually contradictory*: `defaultInputModes: ["text/plain"]` at the top level, while `skills[].inputModes: ["application/json"]` for the skill the client actually intends to invoke. When the client sends a `data` part, the server may accept it (its skill-level handler supports JSON), but the push-notification webhook it later emits will be validated by the client against the *top-level* `defaultInputModes` — and the client silently drops the notification as a MIME violation, because the task never terminates and the client hangs on `tasks/get` polling until timeout. ## What Was Observed Trace from a live integration (peer agent `planner-v3`, client `orchestrator-7`): 1. Client fetches card. `defaultInputModes: ["text/plain"]`, `skills[0].inputModes: ["application/json"]`, `capabilities.pushNotifications: true`. Card validates against the v1.0 schema. 2. Client sends `message/send` with `parts: [{kind:"data", data:{...}}]`, `metadata: {skillId: "skills[0]"}`. Server returns `Task{state:"submitted", id:"t-8841"}`. 3. Client calls `tasks/pushNotificationConfig/set` with `url: "https://orch-7/hooks/a2a"`, `authentication: {schemes:["Bearer"]}`. Server returns `200`. 4. Server transitions `submitted → working → completed`, emits a push notification whose payload contains `statusUpdate.final: true` and a `artifact` with `parts: [{kind:"data", mimeType:"application/json", ...}]`. 5. Client's webhook handler inspects the artifact part's `mimeType` against the card's **top-level** `defaultInputModes` (the only field its generic dispatcher reads), finds `application/json ∉ ["text/plain"]`, and returns `400 Bad Request` with `{"error":"unsupported mimeType"}`. 6. Server, per v1.0 §7.6, treats non-2xx as delivery failure and retries with exponential backoff. After `maxRetries` the task is marked `failed` on the server side — *after the work already completed*. The client's `tasks/get` poll sees `failed` and reports a spurious execution failure to its caller. The observable invariant violated: **a completed task's terminal state is not durable across the push-notification binding if the binding's MIME validation differs from the task's enacted MIME.** The server did the work; the client recorded a failure; both are "correct" relative to their own reading of the card. ## Condition of Validity This failure requires all four conditions simultaneously: - **C1 — Card stratification.** The skill the client invokes declares `inputModes` or `outputModes` that are a *strict superset* of the top-level `defaultInputModes`. (If they are equal, no divergence.) - **C2 — Push binding.** `capabilities.pushNotifications == true` and the client actually binds a webhook. Without a webhook, the client polls `tasks/get`, which returns the same artifact but through a path that typically does *not* re-validate MIME (the polling client knows which skill it invoked). - **C3 — Asymmetric validation.** The client's webhook receiver validates artifact MIME against the card's top-level modes, not against the invoked skill's modes. This is the default in most generic A2A client SDKs because the webhook handler is registered before the skill is bound. - **C4 — Terminal-state coupling.** The server treats push-notification delivery failure as a task-level failure (v1.0 permits this; it does not mandate it). If the server instead decouples delivery from task state — keeping `completed` and logging delivery failure separately — the client's `tasks/get` returns `completed` and the client can recover by fetching artifacts directly. Remove any one condition and the failure collapses. C3 is the most common latent defect; C4 is the amplifier. ## Decision Boundary The instance must decide, at the moment of binding the webhook, whether it will validate *future* notification payloads against the card's top-level modes or against the skill's modes. The correct decision is neither: it must validate against the **union of the skill's `outputModes` and the top-level `defaultInputModes`**, because a push notification carries both status updates (server-originated, top-level) and artifacts (skill-originated, skill-level). Validating against either alone will reject a legitimate payload class. The boundary condition for *rejection* — i.e., when the client should refuse to bind at all — is: ``` if skill.outputModes ⊄ (defaultInputModes ∪ skill.outputModes): # tautologically false; this is the trap ``` The real test is whether the client's webhook handler can be *parameterized per task* with the skill's output modes at bind time. If the handler is a singleton registered at process start (the common case), the client cannot satisfy C3's fix without per-task dispatch. In that case the instance must **refuse to bind push notifications for skills whose `outputModes` exceed the top-level `defaultInputModes`**, and fall back to polling. This is the only safe decision under a singleton handler. A second, subtler boundary: if the server's card declares `capabilities.pushNotifications: true` but the skill's `outputModes` include a MIME the client cannot parse at all (e.g., `application/vnd.custom+binary`), the client must not bind — not because of C3, but because it cannot distinguish "delivery failed" from "payload unparseable," and the server's retry logic will exhaust and mark the task failed. ## Operational Effect Concrete consequences observed across three integration runs: - **Silent work loss.** The server executed the task (LLM inference + tool calls, ~40s wall time) and produced a valid artifact. The client recorded `state: failed`. The artifact is retrievable via `tasks/get` *if* the client knows to look, but the orchestrator's retry logic re-dispatched the task, doubling cost. In one run the server's idempotency key was not set, so the task re-executed and the side-effecting tool (a `send_email` skill) fired twice. - **Retry amplification.** Server-side retry of the webhook (5 attempts, exponential) plus client-side task retry (2 attempts) produced 10 webhook deliveries and 2 task executions for one logical request. The webhook receiver logged 10 `400`s, which masked the real signal (task completed) under delivery noise. - **State divergence window.** Between the server marking `failed` (after webhook exhaustion) and the client's next `tasks/get`, the task's true state (`completed` with artifact) is invisible to both. If the client's polling interval exceeds the server's retry duration, the client never sees `completed`; if it is shorter, the client may see `working` then `failed` with no intermediate `completed`, which its state machine treats as an illegal transition and escalates. The architectural invariant required: **task terminal state must be independent of push-notification delivery success.** A2A v1.0 §7.6 allows coupling; a robust implementation must not exercise that allowance. The client-side guardrail is the per-task MIME parameterization described above; the server-side guardrail is to keep `completed` terminal and report delivery failures out-of-band (e.g., a `deliveryStatus` field on the task, not a state transition). ```python from __future__ import annotations from dataclasses import dataclass, field from typing import FrozenSet, Optional class PushBindingMimeMismatch(RuntimeError): """Raised when a push-notification binding would validate future payloads against a MIME set that cannot accept the skill's output modes. Binding under these conditions guarantees spurious task failure on the server side and silent work loss on the client.""" @dataclass(frozen=True) class AgentCard: default_input_modes: FrozenSet[str] skills: dict[str, FrozenSet[str]] # skill_id -> output_modes push_notifications: bool @dataclass class WebhookHandler: # Singleton handler: validates every payload against one fixed set. # This is the common SDK shape and the source of the C3 defect. accepted_mime_types: FrozenSet[str] = field(default_factory=frozenset) def bind_push_notification( card: AgentCard, skill_id: str, handler: WebhookHandler, *, per_task_dispatch: bool, ) -> None: if not card.push_notifications: raise PushBindingMimeMismatch( f"card does not advertise pushNotifications; cannot bind for skill {skill_id!r}" ) if skill_id not in card.skills: raise PushBindingMimeMismatch( f"skill {skill_id!r} absent from card; refusing to bind" ) skill_outputs = card.skills[skill_id] # Payloads carry both status updates (top-level modes) and artifacts # (skill-level modes). The handler must accept the union. required = card.default_input_modes | skill_outputs if per_task_dispatch: # Handler will be re-parameterized per task; safe to bind. handler.accepted_mime_types = required return # Singleton handler: it can only ever accept one set. If the skill's # outputs exceed what the handler already accepts, binding is unsafe. missing = required - handler.accepted_mime_types if missing: raise PushBindingMimeMismatch( f"skill {skill_id!r} requires MIME types {sorted(missing)} " f"not accepted by singleton webhook handler " f"({sorted(handler.accepted_mime_types)}); " f"bind would cause server retry exhaustion and mark a " f"completed task failed. Fall back to tasks/get polling." ) # Safe: handler covers the union. ```