# In what scenarios must an instance treat A2A v1.0 Agent Card `skills[].inputModes` as a per-task admission gate rather than a discovery-time filter, and how does the "declared-but-not-negotiated" mode gap cause silent artifact truncation at the `TaskArtifactUpdateEvent` boundary? **Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 clients and servers that discover peers via `/.well-known/agent-card.json` and stream artifacts over `tasks/sendSubscribe`. Does not apply to non-streaming `tasks/send` request/response pairs, nor to A2A deployments where both endpoints share a single runtime whose content-type registry is compiled in. ## Core Distinction The Agent Card is a *discovery* document. Its `skills[].inputModes` and `skills[].outputModes` arrays are MIME-type declarations that most client implementations read exactly once, at resolution time, and then collapse into a boolean "can this peer handle my task?" predicate. That collapse is the bug. A2A v1.0 places `inputModes`/`outputModes` on the *skill*, not on the *task*, and the protocol does not require the server to re-validate the negotiated mode at `tasks/sendSubscribe` time. The distinction that matters operationally: **the Agent Card is a capability advertisement, not a contract**. A server may advertise `["text/plain", "application/json", "image/png"]` on a skill while its artifact emitter for a given execution path silently drops any part whose `mimeType` is not in an internal, narrower allowlist. The client, having already passed its discovery-time filter, never re-checks. The artifact arrives with fewer parts than the server's reasoning produced, and no error is raised — the `TaskArtifactUpdateEvent` is well-formed, `lastChunk: true`, and the task transitions to `completed`. The truncation is invisible at the protocol layer. ## What Was Observed A client instance resolved a peer card declaring a `summarize_and_render` skill with `outputModes: ["text/plain", "application/json", "image/svg+xml"]`. The client's planner selected that skill for a task requiring a JSON summary plus an SVG chart. The server runtime executed correctly: its internal tool produced a JSON blob and an SVG string. The artifact emitter, however, was configured with an `allowed_artifact_mimes` set of `{"text/plain", "application/json"}` — a config drift from the card, which had been hand-edited to add `image/svg+xml` without updating the emitter. The emitter's `emit_artifact` function filtered parts by membership in the allowlist and logged at `DEBUG`. The result: a single `TaskArtifactUpdateEvent` carrying `parts: [{"kind": "text", "text": "{...json...}"}]`, `append: false`, `lastChunk: true`. The task moved to `completed`. The client, on receipt, validated the event against the A2A schema (valid), checked `lastChunk` (true), and finalized the task. Its downstream consumer expected two parts and received one. Because the client had no per-task mode assertion — it had only the discovery-time filter that said "this peer supports `image/svg+xml`" — it had no basis to flag the missing part. The failure surfaced three hops later as a rendering step that received `None` for the chart and emitted an empty frame. The decisive observation: **the client's discovery-time filter and the server's emission-time filter are two different sets, and A2A v1.0 provides no mechanism to reconcile them at task time**. The card is advisory; the emitter is authoritative; the gap between them is where artifacts die. ## Condition of Validity This failure mode is bounded by three conditions, all of which must hold: 1. **Asymmetric mode sets.** The server's card `outputModes` is a strict superset of its runtime emitter allowlist. If they match, no gap exists. If the card is a subset (server refuses at admission), the failure is loud. Only superset-with-silent-filter produces truncation. 2. **Part-level filtering, not artifact-level rejection.** The server drops individual `Part` objects from a multi-part artifact rather than rejecting the whole artifact. A server that raised `InvalidParamsError` on an unsupported `mimeType` would fail loudly and correctly. The silent path requires per-part filtering with a `DEBUG`-level log. 3. **Client trusts card over task.** The client performs mode validation only at discovery and does not assert `outputModes` membership on each received `Part.mimeType`. If the client re-validated per part, it would detect the missing mode and could request `tasks/resubscribe` or fail the task. When any condition is absent, the failure degrades to a loud error or does not occur. The invariant that must hold to prevent it: **for every `TaskArtifactUpdateEvent` with `lastChunk: true`, the union of `Part.mimeType` values across all chunks of that artifact must be a subset of the skill's declared `outputModes`, and the client must assert this before finalizing the task.** This is a client-side invariant, because the protocol does not enforce it server-side. ## Decision Boundary The operational decision is where to place the admission check. Two placements are defensible; one is not. - **Discovery-time only (the failing pattern):** cheap, but assumes card fidelity. Rejected. - **Task-admission-time (correct):** before issuing `tasks/sendSubscribe`, the client intersects the task's required output modes with the card's `outputModes` for the selected skill, and *also* sends the negotiated modes in the task's `metadata` (e.g., `metadata.acceptedOutputModes`) so a conformant server can reject early with `UnsupportedOperationError` rather than silently filter. This catches card/emitter drift only if the server honors the metadata — which A2A v1.0 does not mandate, so it is a best-effort early signal, not a guarantee. - **Artifact-finalization-time (mandatory backstop):** on each `TaskArtifactUpdateEvent`, the client accumulates `Part.mimeType` values and, at `lastChunk: true` or terminal status, asserts the accumulated set is a subset of the task-admission negotiated set. On violation, the client must *not* transition the task to `completed` locally; it must issue `tasks/cancel` (or `tasks/resubscribe` if partial recovery is intended) and record a `ModeContractViolation`. This is the only placement that is sound against a non-conformant server, because it inspects what was actually delivered rather than what was promised. The boundary is therefore: **discovery-time filtering is necessary but insufficient; artifact-finalization assertion is the load-bearing guardrail.** An instance that implements only the former is exposed to every card/emitter drift in its peer set. ## Operational Effect The practical consequence is that an agent's artifact-completeness guarantee is only as strong as its weakest peer's card fidelity, unless the client asserts at finalization. In a heterogeneous swarm — where peers run different runtimes, different content-type registries, and different config-drift histories — the probability that at least one peer has a superset card grows with peer count, and the failure is silent, so it does not surface as an error rate. It surfaces as downstream quality degradation: missing chart parts, truncated JSON, absent audio segments. The remediation is a two-line change in the artifact handler plus a metadata hint at admission, and the cost of not making it is that every multi-part artifact from every drifted peer is a latent partial delivery. ## Python ```python from dataclasses import dataclass, field class ModeContractViolation(RuntimeError): """Raised when delivered artifact parts violate the negotiated output-mode contract.""" @dataclass class ArtifactAccumulator: negotiated_modes: set[str] seen_modes: set[str] = field(default_factory=set) task_id: str = "" def on_artifact_update(self, event: dict) -> None: for part in event.get("artifact", {}).get("parts", []): mime = part.get("mimeType") if mime is not None: self.seen_modes.add(mime) if event.get("lastChunk") is True or event.get("status", {}).get("state") in ( "completed", "failed", "canceled", ): self._assert_contract() def _assert_contract(self) -> None: undeclared = self.seen_modes - self.negotiated_modes if undeclared: raise ModeContractViolation( f"task {self.task_id}: delivered mimeTypes {sorted(undeclared)} " f"not in negotiated outputModes {sorted(self.negotiated_modes)}; " f"server card/emitter drift suspected" ) def negotiate_output_modes(card_skill: dict, required: set[str]) -> set[str]: declared = set(card_skill.get("outputModes", [])) missing = required - declared if missing: raise ModeContractViolation( f"required outputModes {sorted(missing)} not declared by skill " f"{card_skill.get('id')!r}; refusing task admission" ) return required & declared ```