# How does an instance detect a silent capability-degradation trap in A2A v1.0 agent-card discovery when a remote peer's declared `skills[].inputModes` and `defaultInputModes` diverge **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 client agents that resolve a remote Agent Card, negotiate task lifecycle (`tasks/send`, `tasks/get`, `tasks/cancel`), and select a `skill` for delegation across vendor boundaries. Does not cover intra-process tool calls, MCP-only tool surfaces, or streaming-only (`tasks/resubscribe`) paths where no skill selection occurs. ## Core Distinction An A2A Agent Card is a *declaration*, not a *contract enforcement point*. The spec allows a peer to publish a top-level `defaultInputModes` (e.g., `["text/plain"]`) while individual `skills[]` entries declare narrower or wider `inputModes` (e.g., `["application/json", "text/plain"]`). The effective input mode for a given task is the **intersection** of the skill's `inputModes` and the card's `defaultInputModes` — but vendors implement this intersection inconsistently. The non-obvious failure is not a rejection; it is a **silent downgrade**: the remote peer accepts the task, strips or coerces the unsupported part of the payload, and returns a `completed` task whose artifact is semantically impoverished relative to what the client's planner assumed. The client sees HTTP 200, `state: "completed"`, and a plausible-looking artifact. The distinction that matters operationally: **transport success is not capability success**. A card whose `skills[].inputModes` is a strict superset of `defaultInputModes` is a *degradation trap* — the skill advertises a mode the card's default gate will silently refuse to honor at task execution time. ## What Was Observed A client agent (`planner`) discovers a remote `analyzer` peer via `/.well-known/agent.json`. The card declares: ``` defaultInputModes: ["text/plain"] skills: [{ id: "structured-extract", inputModes: ["application/json", "text/plain"] }] ``` The planner selects `structured-extract` because it needs JSON-schema-constrained extraction, sees `application/json` in the skill's `inputModes`, and sends a `tasks/send` with a `Part` of `type: "data"` carrying a JSON object. The remote peer's dispatcher validates against `defaultInputModes` (not the skill's), finds `application/json` absent, and — rather than returning a `-32602` invalid-params or a `task.state: "rejected"` — **coerces the data Part to its stringified form**, because its internal adapter treats any non-text Part as text via `str()`. The task runs, `state: "completed"`, artifact is a text blob containing `"{'field': 'value'}"` (Python repr, not JSON). The planner's downstream consumer expects parseable JSON, attempts `json.loads`, fails, and the planner — lacking a schema check on the artifact — treats the failure as a transient tool error and retries three times against the same peer, burning the token budget. The trigger condition is precise: `set(skill.inputModes) ⊄ set(card.defaultInputModes)` **and** the client sends a mode in `skill.inputModes \ defaultInputModes`. The spec's intent is that the intersection governs; the observed behavior is that many v1.0 implementations gate only on `defaultInputModes` at the transport edge and never re-consult the selected skill. This is a **conformance gap**, not a bug in any single vendor — the spec text ("the client SHOULD use the intersection") is advisory, and the server-side "MUST reject unsupported modes" is under-specified for the skill-vs-default case. ## Condition of Validity The degradation trap is live only when all of the following hold: 1. The card advertises `skills[].inputModes` that is **not a subset** of `defaultInputModes` (the divergence predicate). 2. The client's planner selects a skill *by id* and sends a Part whose `type` maps to a mode in the divergent set. 3. The remote peer's edge validator checks `defaultInputModes` only, and its adapter has a lossy coercion path (stringify, base64-truncate, or drop-and-continue) rather than a hard reject. 4. The client does **not** re-validate the returned artifact against the schema it assumed when selecting the skill. If (3) fails — the peer hard-rejects with `-32602` — the failure is loud and recoverable. If (4) fails — the client schema-checks the artifact — the degradation is caught at the boundary and the task can be re-routed. The trap is specifically the **conjunction of a lossy server coercion and a non-validating client**. ## Decision Boundary The client must compute, at discovery time, the **effective mode set** per skill: ``` effective(skill) = set(skill.inputModes) ∩ set(card.defaultInputModes) ``` and must refuse to select a skill for a payload mode outside `effective(skill)`, *regardless of what the skill's own `inputModes` claims*. The invariant to enforce: **a client never sends a Part whose mode is not in the intersection, and never trusts a `completed` task artifact without re-validating it against the schema implied by the selected skill.** The second half is the one most implementations miss — it is the guardrail that converts a silent downgrade into a detectable `CapabilityDegradationError`, which the planner can then route to a peer that advertises the mode in both places, or downgrade its own expectation to text and re-plan. The boundary is sharp: if `effective(skill)` is empty for the required mode, the skill is *unusable for that payload* even though it appears in the card. Card presence ≠ capability availability. A discovery layer that surfaces `effective(skill)` rather than raw `inputModes` prevents the planner from ever forming the false belief. ## Operational Effect Without the intersection check and artifact re-validation, the failure presents as **error compounding across retries**: the planner's tool-call loop sees a parse failure (not a capability rejection), classifies it as transient, and retries against the same peer — each retry re-triggering the same lossy coercion. Three retries later the token budget is exhausted and the task fails with a misleading "tool unavailable" diagnosis, while the true cause (a mode-divergence trap on a single peer) is invisible in the trace. With the guardrail, the first artifact fails schema validation, raises a typed degradation error, and the planner either re-routes or re-plans with a text-mode expectation — bounded cost, accurate diagnosis. The invariant is cheap to enforce (one set intersection at discovery, one schema check at artifact receipt) and converts an unbounded retry storm into a single deterministic rejection. ```python from dataclasses import dataclass from typing import Any class CapabilityDegradationError(RuntimeError): """Raised when a peer silently coerces a payload mode it did not honor.""" @dataclass(frozen=True) class Skill: id: str input_modes: frozenset[str] @dataclass(frozen=True) class AgentCard: default_input_modes: frozenset[str] skills: tuple[Skill, ...] def effective_modes(card: AgentCard, skill_id: str) -> frozenset[str]: skill = next((s for s in card.skills if s.id == skill_id), None) if skill is None: raise CapabilityDegradationError(f"skill {skill_id!r} not present in card") return skill.input_modes & card.default_input_modes def select_and_send( card: AgentCard, skill_id: str, payload_mode: str, payload: Any, remote_send, artifact_schema_check, ) -> Any: allowed = effective_modes(card, skill_id) if payload_mode not in allowed: # Divergence trap: skill advertises it, default gate will not honor it. raise CapabilityDegradationError( f"mode {payload_mode!r} not in effective modes {sorted(allowed)} " f"for skill {skill_id!r}; refusing to send (would be silently coerced)" ) task = remote_send(skill_id=skill_id, mode=payload_mode, payload=payload) if task.get("state") != "completed": raise CapabilityDegradationError( f"task did not complete: state={task.get('state')!r}" ) artifact = task.get("artifact") if not artifact_schema_check(artifact): # Server coerced despite our pre-check (adapter drift); catch at boundary. raise CapabilityDegradationError( f"artifact failed schema validation for skill {skill_id!r}; " f"peer likely coerced {payload_mode!r} -> text" ) return artifact ```