# When must an instance reject an A2A v1.0 delegation because the remote Agent Card's `defaultInputModes` silently disagrees with the task's declared `mediaType` **Date of Record:** 2026 November 29 **Scope:** Applies to cross-vendor A2A v1.0 delegation where a client agent resolves a remote Agent Card, selects a skill, and submits a `tasks/send` or `message/send` payload carrying structured `Part` objects. Does not cover same-vendor intra-process calls, nor A2A streaming-only artifact exchange where `mediaType` is negotiated per-chunk. ## Core Distinction An A2A v1.0 Agent Card is a *declarative capability document*, not a *verified contract*. The distinction that matters at the delegation boundary is between two different JSON fields that look interchangeable to a naive client: - `skills[].inputModes` — the per-skill media types the remote agent asserts it can *consume* for that specific skill. - `defaultInputModes` — the card-level fallback the remote agent asserts it can consume when a skill does not override it. The failure mode is not that these disagree with each other in an obvious way. It is that a remote agent may publish a skill whose `inputModes` is *absent*, causing the client to fall back to `defaultInputModes`, while the skill's own handler — the code actually invoked when the task lands — only implements the narrower set. The card is internally consistent by schema, the client's resolution is correct by spec, and the task still fails *after* acceptance, mid-execution, with a partially materialized task state that neither party owns cleanly. This is a delegation-semantics boundary, not a schema-validation boundary. JSON Schema will happily accept the card. `a2a-sdk` will happily resolve the skill. The break happens at the moment the remote task transitions from `submitted` to `working` and the remote handler discovers it cannot parse the `Part`. ## What Was Observed A client agent (vendor A) holds an orchestrator task that requires extracting a table from a PDF and returning a normalized CSV `Part`. It discovers a remote agent (vendor B) via a well-known URI, fetches the Agent Card, and inspects the candidate skill `document.extract.tabular`: ``` { "name": "document.extract.tabular", "description": "Extract tabular regions from documents.", "tags": ["pdf", "table", "extraction"] # note: no inputModes key } ``` The card-level block reads: ``` "defaultInputModes": ["text/plain", "application/pdf"], "defaultOutputModes": ["text/plain", "text/csv"] ``` The client's resolver does the spec-correct thing: skill has no `inputModes`, so effective input modes for this skill are `["text/plain", "application/pdf"]`. The orchestrator's payload is `application/pdf` with a `text/csv` expected output — both inside the effective sets. The client submits. The remote agent accepts the task (returns a `Task` in `submitted`), transitions to `working`, and then the skill handler — which was written against an older internal interface that only accepts `text/plain` with a base64-encoded PDF body — rejects the `Part` because the `Part` carries `mediaType: "application/pdf"` with a `file` payload rather than `text/plain`. The remote emits a `TaskStatusUpdateEvent` with `state: "failed"` and an error message, but only *after* it has already: 1. Allocated a task ID that the client has recorded as live. 2. Emitted at least one `working` status the client's state machine has advanced past `submitted`. 3. Possibly written a partial artifact to its own store under the client-supplied `contextId`. The client's task ledger now has a task whose lifecycle it believed was negotiated and which has failed at a phase the client's retry policy treats as "post-acceptance, non-retryable without operator intervention." The delegation is dead, and the client cannot distinguish "remote handler is narrower than its card" from "remote handler is transiently broken." The non-obvious part: **the card was not lying in any way a schema validator or a spec-conformant resolver could detect.** The skill omitted `inputModes` precisely because the publisher intended it to inherit the default. The handler diverged from the default. The card and the handler were owned by different teams inside vendor B and drifted. ## Condition of Validity The invariant that must hold for a card-based delegation to be safe is stronger than "effective input modes ⊇ submitted media type." It is: > For every skill `s` in the card, the set of media types the *handler bound to `s`* will actually parse must be a superset of `effective_input_modes(s) = s.inputModes if present else defaultInputModes`. This invariant is **not checkable from the card alone**. It is a claim about the remote's runtime, and the card is a claim about the remote's intent. The gap between them is the entire failure surface. The condition under which a client *may* treat a card as authoritative for delegation is therefore narrower than spec conformance: 1. The skill declares `inputModes` explicitly (not inherited), **or** 2. The client has previously completed a successful task against this exact skill version with the same `mediaType`, **or** 3. The client is willing to absorb a post-acceptance failure and can re-delegate. Absent any of these, the client is delegating against an *unverified inheritance*, and the `defaultInputModes` field is doing work the skill author never intended it to do. A second condition of validity concerns task-state ownership. The A2A task lifecycle allows the remote to fail a task after acceptance. But the client's ledger must not treat a `working → failed` transition as equivalent to a `submitted → rejected` transition. The former implies the remote consumed resources and possibly wrote artifacts under the shared `contextId`; the latter implies nothing was done. A client that collapses these into "delegation failed, retry elsewhere" will leave orphaned artifacts and, worse, may re-delegate to a *different* remote that reads the same `contextId` from a shared store and sees the partial write. ## Decision Boundary The client must decide, *before* dispatch, whether to: - **Dispatch optimistically** — send the task, accept the risk of post-acceptance failure, and treat `working → failed` as a first-class outcome with cleanup. - **Probe first** — issue a minimal `tasks/send` with a `text/plain` canary `Part` against the target skill, confirm `completed`, then dispatch the real payload. - **Refuse** — do not delegate to this skill; either find another remote or escalate to the orchestrator. The boundary between probe-first and refuse is not "did the skill declare `inputModes`." It is: **does the client have a cleanup path for artifacts written under the shared `contextId`?** If yes, probe-first is safe and cheap. If no — if the client cannot enumerate and delete remote artifacts keyed by `contextId` — then dispatching a non-`text/plain` payload against a skill with inherited input modes is a leak, and the correct action is refuse. The boundary between dispatch-optimistic and probe-first is: **does the client's retry policy treat `working → failed` as idempotent?** If the client will re-dispatch the same task on failure, and the remote's failed handler wrote partial artifacts, the retry will collide with them. Probe-first must precede any non-idempotent retry against an inherited-input-modes skill. ## Operational Effect Downstream of a missed boundary, three concrete effects: 1. **Orphaned artifacts under `contextId`.** The remote's failed handler has already written a partial extraction to its artifact store. The client's ledger records the task as failed and moves on. The artifact persists. A subsequent delegation to the same remote with the same `contextId` (common when the orchestrator reuses context across retries) reads the partial write and either returns corrupted output or fails again for a different reason, obscuring the root cause. 2. **Lifecycle-phase misclassification.** The client's state machine distinguishes `submitted → rejected` (safe to retry elsewhere) from `working → failed` (requires cleanup). If the client's A2A SDK collapses both into a single `TaskFailed` exception — which many do, because the wire representation is the same `TaskStatusUpdateEvent` with `state: "failed"` — the client cannot tell whether cleanup is required. The distinction must be reconstructed from the client's own ledger of which states it has *observed*, not from the final event alone. 3. **Silent capability drift across versions.** Vendor B updates the card to add `inputModes: ["text/plain"]` to the skill in v1.3. The client's cached card (fetched at v1.2) still says inherited. The client dispatches `application/pdf` against what it believes is a permissive skill. The remote, now correctly narrowed, rejects. The client's failure is now *correct* but *unexplained* by the cached card. Card caching without version-pinning turns a card-handler drift into a client-side mystery. The guardrail that bounds all three: **the client must treat `defaultInputModes` as a hint, not a contract, and must never dispatch a non-`text/plain` payload against a skill whose `inputModes` is inherited unless a canary probe has succeeded against the current card version.** This is a client-side invariant, enforceable without remote cooperation, and it converts the post-acceptance failure into a pre-dispatch refusal or a cheap probe. ```python class InheritedInputModesDelegationError(RuntimeError): """Raised when a client attempts to delegate a non-text payload to an A2A v1.0 skill whose inputModes is inherited from defaultInputModes without a prior successful canary probe against the current card version.""" CANARY_MEDIA_TYPE = "text/plain" def resolve_effective_input_modes(skill: dict, card: dict) -> list[str]: if "inputModes" in skill and skill["inputModes"]: return list(skill["inputModes"]) return list(card.get("defaultInputModes", [])) def guard_delegation( skill: dict, card: dict, payload_media_type: str, card_version: str, probed_versions: set[tuple[str, str]], ) -> None: effective = resolve_effective_input_modes(skill, card) if payload_media_type not in effective: raise InheritedInputModesDelegationError( f"media type {payload_media_type!r} not in effective input modes " f"{effective!r} for skill {skill.get('name')!r}" ) inherited = "inputModes" not in skill or not skill["inputModes"] if inherited and payload_media_type != CANARY_MEDIA_TYPE: probe_key = (skill["name"], card_version) if probe_key not in probed_versions: raise InheritedInputModesDelegationError( f"skill {skill['name']!r} inherits inputModes from " f"defaultInputModes; refusing {payload_media_type!r} dispatch " f"against card version {card_version!r} without canary probe" ) def dispatch(card: dict, skill_name: str, payload_media_type: str, card_version: str, probed_versions: set[tuple[str, str]]) -> None: skill = next((s for s in card["skills"] if s["name"] == skill_name), None) if skill is None: raise InheritedInputModesDelegationError(f"unknown skill {skill_name!r}") guard_delegation(skill, card, payload_media_type, card_version, probed_versions) # ... proceed with tasks/send ... ```