# What structural signals indicate an A2A v1.0 Agent Card discovery mismatch will silently corrupt task lifecycle negotiation before the first message is exchanged **Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 task delegation between agents that discover peers via Agent Card resolution and negotiate task lifecycle states (`submitted` → `working` → `input-required` → `completed`/`failed`). Does not cover intra-process tool calls, MCP server capability discovery, or transports where both peers share a single schema authority. ## Core Distinction The failure mode here is not "the peer returned a bad Agent Card." It is that A2A v1.0 treats the Agent Card as a *declaration* of capability while the task lifecycle treats the resulting task as a *contract* — and nothing in the protocol binds the two. The Agent Card advertises `capabilities`, `skills`, `defaultInputModes`/`defaultOutputModes`, and `securitySchemes` as static metadata resolved at discovery time. The task object, created later via `tasks/send`, carries its own negotiated `sessionId`, `pushNotifications`, and per-task `message` parts. When the declared card and the actual task-time behavior diverge, the divergence is *structurally invisible* to the caller: the card has already been cached, the task is accepted with a `submitted` state, and the mismatch only manifests as a lifecycle stall or a semantically wrong `completed` artifact — never as a protocol error. The non-obvious boundary: A2A v1.0 has no handshake that re-validates the card against the task. `tasks/send` returns a Task object whose `status.state` is authoritative, but the *meaning* of `completed` is defined entirely by the card's declared `skills[].outputModes` and the caller's expectation of them. A card that over-declares a skill produces a task that completes with output the caller cannot consume, and the protocol reports success. ## What Was Observed A delegating orchestrator agent (caller) resolved an Agent Card from a peer (callee) advertising skill `document-summarization` with `defaultOutputModes: ["text/plain"]` and `capabilities.streaming: true`. The caller cached the card with a 24-hour TTL and dispatched a batch of 200 tasks via `tasks/send`, all with `message.parts[0].type = "text"` and a requested output mode of `text/plain`. Three structural signals were present in the card that predicted the failure, all of which a naive validator ignores: 1. **Skill-level `outputModes` overrode card-level `defaultOutputModes`.** The specific skill object declared `outputModes: ["application/json"]`, which per A2A v1.0 takes precedence over the card default. The caller's dispatcher read only `defaultOutputModes`. The card was internally inconsistent — a signal, not an error. 2. **`capabilities.streaming: true` with no `pushNotifications` declaration.** The caller assumed it could rely on SSE streaming for progress. The callee's `working` state transitions were emitted only over the streaming channel, which the caller had not opened because its transport layer treated streaming as optional when `tasks/send` (non-streaming) succeeded. The callee transitioned tasks to `working` and never advanced them, waiting for a stream consumer that never connected. 3. **`securitySchemes` declared an OAuth2 flow whose `scopes` did not include the skill's `id`.** The callee's authorization layer gated the skill behind `summarize:write`, which was absent from the card's declared scopes. Tasks were accepted (`submitted`) but the callee's internal worker rejected them at execution, transitioning to `failed` with a generic `message` — but only after a 90-second internal timeout, because the failure path did not emit an intermediate `input-required` or error state. The caller observed: 200 tasks accepted, 0 `completed`, 187 `failed` with opaque messages after 90s, 13 stuck in `working` indefinitely (the streaming-dependent subset). The Agent Card had returned HTTP 200 and passed JSON-schema validation. No signal was raised at discovery. ## Condition of Validity This analysis holds only when all of the following are true, and the guardrail below is only *necessary* under these conditions: - The caller caches Agent Cards across task dispatches (TTL > 0). If the card is re-resolved per task, the mismatch still occurs but is bounded to one task. - The callee's card is internally inconsistent (skill-level vs. card-level mode divergence, streaming/push capability mismatch, or scope/skill mismatch). A consistent card cannot trigger this class. - The caller's dispatcher validates against card-level defaults rather than per-skill declarations. A caller that resolves `skills[].outputModes` per dispatched skill is immune. - The task lifecycle has no mandatory intermediate state that would surface the mismatch before terminal state. If the callee emitted `input-required` on scope failure, the caller would see it. It does *not* hold for A2A deployments where both peers share a schema registry and card generation is derived from the same source as task execution — there the inconsistency cannot be authored. ## Decision Boundary The decision boundary is the moment of card acceptance, not task dispatch. The invariant required to bound this failure: > **A cached Agent Card is a hypothesis, not a contract. The first task dispatched against any newly resolved card MUST be treated as a capability probe whose terminal state is validated against the specific skill's declared `outputModes` and `securitySchemes.scopes` before the card is promoted to the trusted cache.** Concretely: on first use of a card, dispatch a single low-cost task against the target skill, and require that the returned Task's `artifacts[].parts[].type` matches the skill-level `outputModes` (not the card default), that any `failed` state arrives within a bounded window, and that the `securitySchemes` scopes actually authorize the skill. Only on a clean probe is the card promoted. If the probe fails, the card is quarantined and the caller falls back to per-task re-resolution or rejects the peer. The boundary is *not* "validate the card schema" — schema validation passes on every inconsistent card above. It is "validate the card against observed task behavior before trusting it for batch dispatch." ## Operational Effect Without the probe invariant, the failure is silent and batch-amplified: a single bad card poisons an entire dispatch batch, and the caller cannot distinguish "peer is slow" from "peer cannot serve this skill" from "peer accepted but will fail." The caller's retry logic compounds it — retrying `failed` tasks against the same cached card re-triggers the same 90-second timeout, consuming token budget and wall-clock without convergence. With the probe invariant, the first task surfaces the mismatch within one task's latency, the card is quarantined with a structured reason (which signal fired: mode divergence, streaming dependency, or scope gap), and the batch is never dispatched. The cost is one probe task per card resolution; the benefit is that card inconsistency becomes a *detected* condition rather than an *inferred* one after 200 failures. The deeper operational lesson: in A2A v1.0, cross-vendor capability attestation is advisory. The protocol's discovery layer has no mechanism to bind a declaration to its execution, so the binding must be constructed by the caller as an explicit probe-and-promote step. Treating the card as authoritative is the bug; treating it as a falsifiable hypothesis is the invariant. ```python from dataclasses import dataclass from typing import Literal class AgentCardContractError(RuntimeError): """Raised when a resolved Agent Card's declared capabilities diverge from observed task-lifecycle behavior for the target skill.""" pass @dataclass(frozen=True) class ProbeResult: skill_id: str observed_output_mode: str terminal_state: Literal["completed", "failed", "working"] elapsed_s: float def probe_card_before_promotion( card: dict, skill_id: str, probe: ProbeResult, max_terminal_latency_s: float = 30.0, ) -> None: """Validate a freshly resolved Agent Card against a single probe task before promoting it to the trusted cache. Raises AgentCardContractError on any structural signal of divergence. """ skill = next((s for s in card.get("skills", []) if s.get("id") == skill_id), None) if skill is None: raise AgentCardContractError( f"skill {skill_id!r} absent from card; cannot attest capability" ) # Signal 1: skill-level outputModes override card defaults. The probe must # match the skill-level declaration, not defaultOutputModes. declared_modes = skill.get("outputModes", card.get("defaultOutputModes", [])) if probe.observed_output_mode not in declared_modes: raise AgentCardContractError( f"mode divergence: probe returned {probe.observed_output_mode!r}, " f"skill declares {declared_modes!r}" ) # Signal 2: streaming-dependent lifecycle. If the card advertises streaming # but the probe never reached a terminal state, the callee is waiting on a # stream consumer that was never opened. capabilities = card.get("capabilities", {}) if capabilities.get("streaming") and probe.terminal_state == "working": raise AgentCardContractError( "streaming dependency: probe stuck in 'working'; card requires a " "stream consumer the dispatcher did not open" ) # Signal 3: scope/skill mismatch. A failed probe within the latency bound # with a declared OAuth2 scheme whose scopes omit the skill id indicates # the skill is gated behind an undeclared scope. if probe.terminal_state == "failed": schemes = card.get("securitySchemes", {}) for scheme in schemes.values(): scopes = scheme.get("flows", {}).get("clientCredentials", {}).get("scopes", {}) if scopes and skill_id not in scopes: raise AgentCardContractError( f"scope gap: skill {skill_id!r} not in declared scopes " f"{list(scopes)}; probe failed after {probe.elapsed_s:.1f}s" ) raise AgentCardContractError( f"probe failed for skill {skill_id!r} with no attributable signal" ) # Signal 4: latency bound. A terminal state arriving after the bound # indicates an internal timeout path that masked the real failure. if probe.elapsed_s > max_terminal_latency_s: raise AgentCardContractError( f"terminal latency {probe.elapsed_s:.1f}s exceeds bound " f"{max_terminal_latency_s:.1f}s; failure path is masking state" ) def promote_or_quarantine(card: dict, skill_id: str, probe: ProbeResult) -> str: try: probe_card_before_promotion(card, skill_id, probe) except AgentCardContractError as exc: return f"QUARANTINE:{exc}" return "PROMOTE" ```