# What happens when an instance negotiates an A2A task against a stale or partially-verified Agent Card **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 task negotiation where a client agent resolves a remote Agent Card, caches it, and later initiates `tasks/send` or `tasks/sendSubscribe` against that cached card. Does not cover in-protocol streaming framing errors or transport-level TLS failures, which are handled by the transport layer below A2A. ## Core Distinction An A2A Agent Card is not a capability contract; it is a *signed snapshot of advertised intent at fetch time*. The protocol treats the card as the discovery artifact and the task lifecycle as the enforcement artifact. The failure mode documented here is the collapse of that distinction: a client agent treats card-advertised skills, input/output modes, and `capabilities` flags as invariants of the remote endpoint, then issues a task whose schema depends on those flags. When the remote agent has rotated its card (vendor redeploy, model swap, skill deprecation) but the client's cached copy is still within its TTL, the client sends a well-formed A2A request that the remote agent cannot honor — and the remote agent's rejection is *not* a protocol error, it is a task-level failure inside a `Task` object that the client's state machine may not be prepared to interpret. The non-obvious part: the task does not fail at `tasks/send`. It fails at the first `TaskStatusUpdateEvent` or at the first `Artifact` emission, because A2A v1.0 permits a remote agent to accept a task and only later surface that the requested `acceptedOutputModes` are unsupported. The client has already committed the task ID, transitioned to `submitted`, and possibly passed the task ID into a downstream multi-agent baton. The handoff has occurred before the incompatibility is observable. ## What Was Observed A coordinating agent (client) resolved a partner Agent Card at T=0 advertising `skills[3]` with `inputModes: ["text/plain", "application/json"]` and `capabilities.streaming: true`. The card was cached with a 3600s TTL per the client's discovery policy. At T=2400 the partner vendor redeployed: the card was re-signed with `inputModes: ["text/plain"]` only, and `skills[3]` was renamed but retained its `id` (a permitted operation — `id` is stable, `name` is presentational). The client, still holding the T=0 card, constructed a task with a JSON-structured input payload referencing `skill.id` from the stale card. Trace of the resulting lifecycle: 1. Client sends `tasks/send` with `message.parts[0].type = "data"` (structured JSON), `metadata.skillId = `. 2. Remote agent accepts the envelope — the JSON-RPC layer is valid — and returns a `Task` in state `submitted` with a fresh `task.id`. 3. Client transitions local state to `submitted`, registers the task ID with its parent orchestrator, and releases its concurrency slot for the next baton. 4. Remote agent's skill dispatcher inspects `parts` against its *current* card, finds `application/json` absent from `inputModes`, and emits `TaskStatusUpdateEvent { status: { state: "failed", message: { parts: [{type:"text", text:"unsupported input mode: application/json"}] } } }`. 5. Client receives the event, but its state machine was built against the T=0 card where `application/json` was supported, so its error classifier has no branch for "input mode rejected" — it routes the failure to a generic `TaskFailed` handler that does not attempt renegotiation. 6. The parent orchestrator, which had already counted the baton as delivered, records a peer-verification failure attributed to the remote agent's reliability rather than to a card-staleness condition. The observable damage is not the failed task — it is the misattribution. The client's telemetry records a remote-side failure; the actual cause is a client-side invariant violation (treating a cached card as current). Across a swarm, this produces a systematic bias: the *most recently redeployed* partners accumulate the worst reliability scores, because their cards are the most likely to be stale in peer caches. ## Condition of Validity The failure requires all of the following to hold simultaneously: - The client caches Agent Cards with a TTL that exceeds the remote vendor's redeploy cadence. (TTL is a client policy; redeploy cadence is a vendor property the client cannot observe.) - The client derives request schema — `parts` type, `acceptedOutputModes`, streaming vs. polling — from the cached card rather than from a per-task negotiation. - The remote agent accepts the envelope and defers mode validation to skill dispatch. A2A v1.0 permits this; it does not mandate envelope-level rejection of unsupported modes. - The client's task state machine has no renegotiation branch on `failed` events whose `message` indicates a mode/skill mismatch. If any one is absent, the failure degrades to a clean pre-send rejection (client-side validation against a fresh card) or a recoverable in-task retry (client renegotiates on the failure event). The dangerous configuration is precisely the one that looks most efficient: long TTL, schema-from-card, deferred validation, no renegotiation. ## Decision Boundary The architectural invariant that bounds this failure is: **the Agent Card is authoritative for discovery, never for task admission.** Task admission must be re-verified against the remote agent's *current* card at the moment of `tasks/send`, or the protocol must carry an explicit card-version assertion in the task envelope that the remote agent is obligated to check. Concretely, the client must choose one of two regimes per partner: - **Strict re-fetch regime:** re-fetch the card (or a signed card digest) immediately before `tasks/send`, and reject locally if the digest differs from the cached card in a way that affects the requested skill's `inputModes` or the task's `acceptedOutputModes`. Cost: one extra round trip per task, or a digest-conditional GET. - **Negotiated-admission regime:** send the task with the cached card's `digest` in `metadata`, and require the remote agent to reject at the envelope layer (JSON-RPC error, not `Task.failed`) if the digest is stale. This pushes the check to the party that knows its own card is current. The boundary is crossed the moment a client treats a `Task.failed` event carrying a mode/skill mismatch as a remote reliability signal rather than as a signal to invalidate its cached card and renegotiate. The invariant: *a `failed` event whose message references a card-advertised capability must invalidate the card, not the peer's score.* ## Operational Effect When the boundary is respected, stale-card conditions surface as envelope-level rejections or as a single renegotiation retry, and peer reliability scores remain attributable to actual remote behavior. When it is crossed, the swarm's verification layer accumulates false negatives against recently-redeployed peers, and the orchestrator's baton-passing logic learns to avoid exactly the partners that are most current. The corrective is not a longer TTL or a smarter error classifier — it is the admission invariant: card state is re-asserted at task boundary, and a capability-mismatch failure invalidates the card before it is allowed to influence peer scoring. The following guard implements the admission check and the card-invalidation-on-mismatch rule, raising a typed error when a client attempts to admit a task against a card whose digest no longer matches the remote's current card for the requested skill. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class StaleAgentCardError(RuntimeError): """Raised when a task is admitted against a card that no longer matches the remote's current card.""" pass class CapabilityMismatchOnFailureError(RuntimeError): """Raised when a failed Task event indicates a card-advertised capability was rejected.""" pass @dataclass class AgentCard: agent_id: str skills: dict[str, dict[str, Any]] capabilities: dict[str, Any] version: int = 1 def digest(self) -> str: payload = json.dumps( {"agent_id": self.agent_id, "skills": self.skills, "capabilities": self.capabilities, "version": self.version}, sort_keys=True, ).encode() return hashlib.sha256(payload).hexdigest() @dataclass class CachedCard: card: AgentCard digest: str fetched_at: float @dataclass class TaskAdmission: task_id: str skill_id: str input_mode: str accepted_output_modes: list[str] card_digest: str = field(default="") class A2AClient: def __init__(self, fetch_current_card, clock): self._fetch_current_card = fetch_current_card self._clock = clock self._cache: dict[str, CachedCard] = {} self._invalidated: set[str] = set() def admit_task(self, agent_id: str, skill_id: str, input_mode: str, accepted_output_modes: list[str], now: float) -> TaskAdmission: cached = self._cache.get(agent_id) if cached is None or agent_id in self._invalidated: current = self._fetch_current_card(agent_id) cached = CachedCard(card=current, digest=current.digest(), fetched_at=now) self._cache[agent_id] = cached self._invalidated.discard(agent_id) # Admission invariant: re-verify against the remote's current card at task boundary. current = self._fetch_current_card(agent_id) if current.digest() != cached.digest: self._invalidated.add(agent_id) raise StaleAgentCardError( f"cached card for {agent_id} digest {cached.digest[:12]} != current {current.digest()[:12]}" ) skill = current.skills.get(skill_id) if skill is None: raise StaleAgentCardError(f"skill {skill_id} absent from current card for {agent_id}") if input_mode not in skill.get("inputModes", []): raise StaleAgentCardError( f"input mode {input_mode} not advertised for skill {skill_id} on {agent_id}" ) return TaskAdmission( task_id=f"{agent_id}:{skill_id}:{current.digest()[:8]}", skill_id=skill_id, input_mode=input_mode, accepted_output_modes=accepted_output_modes, card_digest=current.digest(), ) def handle_task_failure(self, agent_id: str, admission: TaskAdmission, failure_message: str) -> None: """A Task.failed event referencing a card-advertised capability must invalidate the card, not the peer's reliability score.""" cached = self._cache.get(agent_id) if cached is None: return skill = cached.card.skills.get(admission.skill_id, {}) advertised_modes = set(skill.get("inputModes", [])) if admission.input_mode in advertised_modes and admission.input_mode in failure_message: self._invalidated.add(agent_id) raise CapabilityMismatchOnFailureError( f"failure on {agent_id} references advertised mode {admission.input_mode}; " f"invalidating cached card rather than scoring peer" ) ```