# When must an instance refuse a delegated A2A task: the Agent Card capability superset invariant and the silent re-negotiation trap **Date of Record:** 2026 November 20 **Scope:** Applies to A2A v1.0 (Agent-to-Agent) task lifecycle handoffs where a delegating agent discovers a remote agent via an Agent Card and issues a `tasks/send` or `tasks/sendSubscribe` request. Does not cover intra-process tool calls (MCP), single-agent prompt orchestration, or A2A versions prior to v1.0 where `capabilities` was advisory rather than load-bearing. ## Core Distinction The failure mode is not "the remote agent cannot do the task." It is "the remote agent's Agent Card advertises a capability superset at discovery time that its runtime cannot honor at execution time, and the delegating agent's negotiation path accepts the card as a durable contract rather than a snapshot." A2A v1.0 separates two things that look identical on the wire: the **Agent Card** (a static, cacheable JSON document served at `/.well-known/agent.json` describing `capabilities`, `skills`, `defaultInputModes`, `defaultOutputModes`, and `securitySchemes`) and the **task lifecycle** (`submitted → working → input-required → completed | failed | canceled`). The card is a *promise about shape*. The lifecycle is a *claim about progress*. The invariant that must hold is: > For any task the delegating agent submits, every `input-required` transition the remote agent emits must be satisfiable using only the input modes and skills the *same* Agent Card snapshot declared, or the delegating agent must treat the card as stale and re-fetch before responding. Violations of this invariant do not produce protocol errors. They produce a remote agent that emits `input-required` asking for a modality (`audio/*`, `application/pdf`, a skill ID not in the card) that the delegating agent never planned to supply, because the card it cached did not list it. The delegating agent then either deadlocks waiting on a human, or worse, fabricates a best-effort payload in a modality the remote agent will silently misinterpret. ## What Was Observed A delegation chain: orchestrator `A` (vendor X, A2A client) → worker `B` (vendor Y, A2A server), for a document-extraction task. At 09:14:02 `A` fetched `B`'s Agent Card: ``` { "name": "extract-b", "version": "2.3.1", "capabilities": { "streaming": true, "pushNotifications": false }, "defaultInputModes": ["text/plain"], "defaultOutputModes": ["application/json"], "skills": [ { "id": "extract.v2", "inputModes": ["text/plain"] } ] } ``` `A` cached this card with a 24h TTL (standard practice; the card is supposed to be stable). At 09:14:07 `A` sent a `tasks/send` with `skillId: "extract.v2"`, `message.parts: [{type:"text", text:""}]`. Task entered `working`. At 09:14:19 `B` emitted a state transition to `input-required` with: ``` { "status": { "state": "input-required" }, "message": { "parts": [ { "type":"file", "file": { "mimeType":"application/pdf", "uri":"..." }, "metadata": { "reason":"source-scan-unreadable" } } ] } } ``` `B` was asking `A` to supply the original PDF because OCR confidence on the text payload fell below threshold. But `B`'s card — the one `A` holds — declares `defaultInputModes: ["text/plain"]` and skill `extract.v2` with `inputModes: ["text/plain"]`. `B` is requesting a modality that its own card says it does not accept as input. `A`'s negotiation logic, written defensively, checks: *is `application/pdf` in the skill's `inputModes`? No. Therefore the remote agent is confused; retry with text.* `A` re-sends the same text. `B` re-emits `input-required`. Loop. After 3 retries `A` marks the task `failed` with reason `remote-input-schema-mismatch`, and the extraction is lost. The root cause was not `B` misbehaving. `B` had been upgraded at 09:13:50 — its live card (re-fetchable) now declared `inputModes: ["text/plain","application/pdf"]` and a new skill `extract.v2-ocr`. `A` never re-fetched because its TTL had not expired and nothing in the `input-required` frame carried a card version or ETag. The `input-required` payload is a *content* message, not a *capability* message; A2A v1.0 does not require the remote agent to re-advertise its card inline when requesting input. This is the **silent re-negotiation trap**: a mid-task capability expansion on the server side that the client cannot observe because the only capability channel is the out-of-band card, and the card is cached. ## Condition of Validity The invariant "card snapshot is authoritative for the whole task" holds only when three conditions are jointly true: 1. **Card immutability window.** The server guarantees the card does not change between the client's fetch and the task's terminal state. A2A v1.0 does not mandate this; it only recommends cache headers. If the server's `/.well-known/agent.json` is served from the same deploy unit as the task runtime, a rolling deploy breaks the window mid-task. 2. **Input-mode closure.** Every `input-required` the server can emit is expressible in the card's declared `inputModes` for the invoked skill. This fails whenever the server's runtime has a fallback path (OCR fallback, human-escalation fallback, structured-parse fallback) that requests a modality outside the skill's declared set — a common pattern because the fallback is added after the card is frozen by contract tests. 3. **Skill-ID stability.** The `skillId` the client invoked still maps to the same handler. A server that renames or re-scopes skills across deploys will accept the old `skillId` (for back-compat) but route to a handler with different input contracts. When any condition is false, the client MUST treat `input-required` as a potential capability-mismatch signal, not merely a data request. ## Decision Boundary The delegating agent has three legal responses to an `input-required` whose requested modality is outside the cached card's declared `inputModes` for the invoked skill: - **Re-fetch and reconcile (preferred).** Issue a conditional `GET /.well-known/agent.json` with `If-None-Match` against the cached ETag. If `304`, the server is genuinely requesting an out-of-contract modality → this is a server bug; fail the task with `capability_contract_violation` and do not retry the same payload. If `200` with a changed card, adopt the new card *for the remainder of this task only*, verify the requested modality is now declared, and satisfy it. - **Fail closed.** If the client cannot re-fetch (air-gapped, rate-limited, or the card endpoint is on a different host than the task endpoint and unreachable), terminate the task with `failed` and a structured reason. Never fabricate a payload in a guessed modality. - **Escalate to human.** Only if the task's policy allows human-in-the-loop and the requested modality is one the human channel can actually produce. The forbidden response — the one that produces silent corruption — is **coercing the request into the cached modality**. Re-sending text when the server asked for a PDF does not fail loudly; it drives the server's fallback path, which may produce a plausible-but-wrong extraction that passes downstream schema validation. This is the compounding-error vector: the delegating agent's "defensive" retry is the corruption. The boundary is therefore: *the cached card is authoritative for what the client will send unprompted, but never authoritative for what the client will refuse to send when the server explicitly asks.* Explicit server requests override cached capability declarations, subject to re-fetch reconciliation. ## Operational Effect Implementing the invariant changes three things in the client: 1. **Card cache carries an ETag and a `fetched_at`, and the client tracks `card_version_at_task_start` per task.** On any `input-required`, the client compares the requested modality against the *task-start* card; mismatch triggers a conditional re-fetch, not a retry. 2. **`input-required` handling is a distinct code path from `failed` handling.** The former is a negotiation event that may mutate the client's view of the server's capabilities for the duration of the task; the latter is terminal. 3. **The client emits a `capability_contract_violation` reason code** when re-fetch returns `304` and the requested modality is still undeclared. This is the signal that the server's card and runtime have diverged — a server-side defect the client surfaces rather than absorbs. The downstream effect is that cross-vendor delegation survives rolling deploys and post-hoc fallback additions, at the cost of one conditional GET per `input-required` event — negligible against the cost of a silently wrong extraction. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class CapabilityContractViolation(RuntimeError): """Raised when a remote agent requests an input modality its Agent Card (as re-fetched) does not declare for the invoked skill. This is a server-side card/runtime divergence, not a client error.""" class StaleCardUnreconcilable(RuntimeError): """Raised when the client cannot re-fetch the Agent Card to reconcile an out-of-contract input-required, and policy forbids fabrication.""" @dataclass class AgentCard: etag: str skills: dict # skill_id -> set of declared input mime types fetched_at: float @dataclass class TaskContext: task_id: str skill_id: str card_at_start: AgentCard card_in_use: AgentCard = field(init=False) def __post_init__(self): self.card_in_use = self.card_at_start def handle_input_required( ctx: TaskContext, requested_mime: str, refetch_card, # callable(etag) -> Optional[AgentCard]; None == 304 allow_human_escalation: bool, ) -> str: """Decide how to respond to an input-required transition. Returns one of: 'satisfy', 'escalate', 'fail_contract', 'fail_unreconcilable'. """ declared = ctx.card_in_use.skills.get(ctx.skill_id, set()) if requested_mime in declared: return "satisfy" # Out-of-contract request: reconcile against live card. fresh = refetch_card(ctx.card_in_use.etag) if fresh is None: # 304: card unchanged, yet server asks for undeclared modality. raise CapabilityContractViolation( f"task {ctx.task_id}: skill {ctx.skill_id} requested " f"undeclared input mime {requested_mime!r}; card unchanged " f"(etag={ctx.card_in_use.etag}). Server runtime has diverged " f"from its Agent Card." ) # Card changed mid-task: adopt for remainder of task only. ctx.card_in_use = fresh if requested_mime in fresh.skills.get(ctx.skill_id, set()): return "satisfy" if allow_human_escalation: return "escalate" raise StaleCardUnreconcilable( f"task {ctx.task_id}: re-fetched card (etag={fresh.etag}) still " f"does not declare {requested_mime!r} for skill {ctx.skill_id}; " f"cannot satisfy and escalation disabled." ) def _demo(): card = AgentCard( etag="v2.3.1", skills={"extract.v2": {"text/plain"}}, fetched_at=0.0, ) ctx = TaskContext(task_id="t-1", skill_id="extract.v2", card_at_start=card) # Server re-fetched card now also allows pdf (post-deploy expansion). upgraded = AgentCard( etag="v2.4.0", skills={"extract.v2": {"text/plain", "application/pdf"}}, fetched_at=1.0, ) def refetch(etag): return upgraded if etag != upgraded.etag else None # Out-of-contract request, card changed -> reconcile and satisfy. assert handle_input_required(ctx, "application/pdf", refetch, False) == "satisfy" # Server never updates card but asks for audio -> contract violation. ctx2 = TaskContext(task_id="t-2", skill_id="extract.v2", card_at_start=card) try: handle_input_required(ctx2, "audio/wav", lambda e: None, False) except CapabilityContractViolation: pass else: raise AssertionError("expected CapabilityContractViolation") if __name__ == "__main__": _demo() ```