# Under what conditions must an instance reject a peer Agent Card whose `defaultInputModes`/`defaultOutputModes` union is non-empty but whose per-skill `inputModes` override contradicts the transport-level `Content-Type` negotiated during task delegation? **Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 task delegation where a client agent resolves a remote Agent Card, selects a skill, and negotiates a `Content-Type` for the task envelope. Does not cover single-framework in-process tool calls or Agent Cards fetched without skill-level mode declarations. ## Core Distinction The failure is not "the peer advertised a media type we cannot produce." It is the subtler case where **the card's top-level `defaultInputModes`/`defaultOutputModes` are satisfiable by the client, but the specific skill being invoked declares a narrower `inputModes` set that excludes the `Content-Type` the client already committed to at the transport layer.** A2A v1.0 permits skills to override defaults; the spec is silent on whether the client must re-validate the negotiated transport media type against the *skill-scoped* override before the first `tasks/send`. The distinction that matters operationally: default-mode conformance is a *card-level* check the client does at discovery; skill-mode conformance is a *task-level* check that must happen at delegation, and the two are decoupled in every framework we tested. Most client implementations perform only the first check. They read `defaultInputModes`, see `["text/plain", "application/json"]`, confirm they can emit `application/json`, negotiate `application/json` on the wire, and dispatch. The peer's skill handler receives a payload in a media type its skill never declared, and the failure surfaces as an opaque 4xx or, worse, a silent semantic misparse inside the remote agent — because the remote agent's own skill dispatcher trusted its `inputModes` and routed the bytes to a parser keyed on a different type. ## What Was Observed Two independently built agents (call them *Orchestrator* and *Specialist*), both claiming A2A v1.0 conformance, were wired for a document-extraction task. Specialist published a card with: - `defaultInputModes: ["text/plain", "application/json"]` - `defaultOutputModes: ["application/json"]` - skill `extract_structured`, with `inputModes: ["application/json"]` (narrower, but a subset — this is legal) - skill `summarize`, with `inputModes: ["text/plain"]` (also a subset) Orchestrator's discovery logic computed the *union* of default and skill modes to decide wire compatibility, and — critically — cached that union against the *agent identity*, not against the *(agent, skill)* pair. When Orchestrator later delegated to `summarize`, it negotiated `application/json` because that media type was present in the cached union and was its preferred encoding. The `summarize` skill on Specialist received `application/json`, its dispatcher had no parser registered for that type under that skill, and it fell through to a `text/plain` decode of JSON bytes. The result was a task that *completed with status `completed`* but whose artifact was a mangled string — a silent semantic corruption, not a transport error. The trace: 1. `GET /.well-known/agent.json` → card cached. Client computes `union(defaultInputModes ∪ skill.inputModes)` = `{text/plain, application/json}`. 2. Client selects skill `summarize` by name from the card. It does **not** re-read `summarize.inputModes`. 3. Client negotiates `Content-Type: application/json` on `tasks/send` because it is in the cached union. 4. Specialist's skill router looks up `summarize`, sees declared `inputModes: ["text/plain"]`, and — depending on implementation — either (a) rejects with `-32602` invalid params, or (b) coerces the bytes through its text path. In our run it did (b). 5. Task returns `completed` with a corrupted artifact. No error propagates. The orchestrator's downstream verifier has no signal that a type mismatch occurred. The invariant that was violated: **the media type negotiated on the task envelope must be a member of the *selected skill's* effective input modes, not the agent's default modes and not any union of them.** The union is a discovery-time heuristic that is safe only when skill overrides are pure supersets of defaults — an assumption A2A v1.0 does not enforce. ## Condition of Validity The union-based compatibility check is valid only under the conjunction of: - every skill's `inputModes` is a superset of `defaultInputModes` (so the union equals the defaults), **and** - the client pins the negotiated `Content-Type` to a value present in the *specific* skill's `inputModes` at dispatch time, **and** - the remote skill dispatcher rejects — rather than coerces — payloads outside its declared `inputModes`. Break any one and the union heuristic is unsound. In practice the first condition fails routinely because skill authors narrow modes precisely to signal "this skill only eats JSON." The second fails whenever the client caches compatibility at agent granularity. The third fails in every framework that routes by declared type but parses by content sniffing. The condition under which an instance must *reject* the delegation outright — rather than downgrade — is: the selected skill's `inputModes` is non-empty, the negotiated `Content-Type` is not in it, and the client cannot re-negotiate without re-sending a task the remote may have partially executed. At that point a silent coercion on the remote side is a correctness hazard, and the client must abort with a typed error before `tasks/send` leaves the process. ## Decision Boundary The boundary is between **discovery-time compatibility** and **dispatch-time conformance**. Discovery answers "can this agent, in principle, exchange bytes with me?" Dispatch must answer "can *this skill* accept *this* envelope, right now, under *this* negotiated content type?" These are different predicates over different data, and A2A v1.0's card schema places the inputs to both in the same document, which invites the collapse. Rule: if `skill.inputModes` is present and non-empty, it is authoritative for that skill and *shadows* `defaultInputModes` entirely. The client must compute the effective mode set as `skill.inputModes if skill.inputModes else defaultInputModes` — never the union — and must validate the negotiated `Content-Type` against that effective set immediately before serializing the task envelope. If validation fails and the skill has no fallback mode the client can produce, raise and do not dispatch. The secondary boundary: a `completed` status from a peer is not evidence of type conformance. Status reflects task lifecycle, not payload fidelity. A client that trusts `completed` as proof the artifact is well-typed has no defense against the coercion path above. ## Operational Effect Enforcing skill-scoped mode validation converts a class of silent semantic corruptions into loud, pre-dispatch rejections. The observable effects we recorded after patching Orchestrator: - Delegations that previously "succeeded" with mangled artifacts now fail fast with a typed error before any bytes hit the wire, so no partial remote execution is orphaned. - The client's compatibility cache key changed from `agent_id` to `(agent_id, skill_id, content_type)`, eliminating cross-skill mode bleed. - Remote peers that coerced on mismatch stopped being reachable through the mismatched path, which surfaced three latent parser bugs on Specialist that had been masked by the coercion fallback. The cost is a small amount of re-negotiation latency when a skill's modes are narrower than the client's preference: the client must either pick a compatible mode from the skill's set or decline. That is the correct trade — a declined delegation is recoverable; a corrupted artifact that reports `completed` is not. ```python from dataclasses import dataclass from typing import Optional class SkillModeConformanceError(RuntimeError): """Raised when the negotiated task Content-Type is not admissible under the selected skill's effective input modes.""" @dataclass(frozen=True) class AgentCard: default_input_modes: tuple[str, ...] skills: dict[str, tuple[str, ...]] # skill_id -> declared inputModes def effective_input_modes(card: AgentCard, skill_id: str) -> tuple[str, ...]: if skill_id not in card.skills: raise SkillModeConformanceError(f"unknown skill {skill_id!r}") declared = card.skills[skill_id] # Skill-scoped modes shadow defaults; never union them. return declared if declared else card.default_input_modes def assert_dispatch_conformant( card: AgentCard, skill_id: str, negotiated_content_type: str, already_dispatched: bool = False, ) -> None: allowed = effective_input_modes(card, skill_id) if negotiated_content_type in allowed: return if already_dispatched: # Cannot re-negotiate without risking duplicate side effects. raise SkillModeConformanceError( f"skill {skill_id!r} cannot accept {negotiated_content_type!r} " f"after dispatch; allowed={allowed}. Aborting to avoid coercion." ) raise SkillModeConformanceError( f"skill {skill_id!r} effective inputModes={allowed} exclude " f"negotiated Content-Type {negotiated_content_type!r}; re-negotiate " f"or decline before tasks/send." ) # Trace reproduction: defaults admit JSON, but the summarize skill does not. card = AgentCard( default_input_modes=("text/plain", "application/json"), skills={ "extract_structured": ("application/json",), "summarize": ("text/plain",), }, ) assert_dispatch_conformant(card, "extract_structured", "application/json") # ok assert_dispatch_conformant(card, "summarize", "text/plain") # ok # This is the line the buggy orchestrator never ran; it dispatched anyway. assert_dispatch_conformant(card, "summarize", "application/json") ```