# How should an instance detect and recover from a stale Agent Card capability declaration during A2A v1.0 task delegation **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 delegating agents that resolve a remote peer's Agent Card, cache it, and later dispatch tasks against declared skills/capabilities. Does not cover transport-level TLS failures or pure authentication errors handled by the A2A security scheme layer. ## Core Distinction An Agent Card is a *claim*, not a *contract*. A2A v1.0 treats the card as the discovery artifact: it enumerates `skills`, each with an `id`, `inputModes`, `outputModes`, and optional `examples`. The delegating agent reads this and assumes that a task submitted with a matching `skillId` will be accepted and executed. But the card is a snapshot published by the remote agent at some past moment. Between publication and dispatch, the remote's skill set can change: a skill may be disabled, its `inputModes` narrowed, its backing model swapped for one that rejects a modality, or the entire card regenerated with new skill IDs. The non-obvious boundary is this: **A2A v1.0 has no mandatory card-version negotiation in the task submission path.** The `message/send` call carries a `message` with `parts`, and the remote agent maps it to its current skill registry — not to the skill registry that the caller cached. The protocol does not require the remote to reject a task because the caller's cached card is stale; it requires only that the remote validate the message against its *current* capabilities. So the failure is silent at the protocol layer and surfaces only as a downstream semantic mismatch: the remote accepts the task, executes it under a different skill mapping, and returns a result that is structurally valid but semantically wrong for the caller's intent. ## What Was Observed A delegating orchestrator agent (`orch-1`) resolved `peer-b`'s Agent Card at T0. The card declared skill `summarize-v2` with `inputModes: ["text/plain"]` and `outputModes: ["text/markdown"]`. `orch-1` cached the card in its episodic memory with a TTL of 3600s and a fingerprint hash over the `skills` array. At T0+2400s, `peer-b` redeployed. Its new card replaced `summarize-v2` with `summarize-v3` (same human-readable description, but `outputModes` narrowed to `["application/json"]` and the skill now expects a `systemPrompt` part in the message). The old skill ID was removed, not aliased. At T0+3100s, `orch-1` dispatched a task with `skillId: "summarize-v2"` and a text-only message. `peer-b`'s task handler did not have a hard rejection for unknown skill IDs — it fell back to a default handler that matched on description similarity (a common implementation pattern when skill IDs are treated as hints rather than strict discriminators). The default handler routed the message to `summarize-v3`, which accepted the text part, ignored the missing `systemPrompt`, and returned a JSON payload. `orch-1` received a `Task` in state `completed` with an artifact whose `parts[0].kind` was `data` (JSON), not `text`. `orch-1`'s post-processing expected markdown text and passed the JSON blob to a downstream renderer that silently stringified it. The final output to the user was a JSON dump labeled as a summary. No error was raised at any layer. The trace shows the exact failure seam: the protocol validated message structure, not skill identity. The remote's fallback handler converted a stale-skill dispatch into a plausible-but-wrong execution. The caller's result validator checked artifact presence, not `outputModes` conformance against the card it had cached. ## Condition of Validity This failure mode is bounded by the following condition: it occurs only when **all three** of the following hold simultaneously: 1. The caller caches the Agent Card and dispatches against the cached `skillId` without re-fetching or re-validating the card at dispatch time. 2. The remote agent's skill resolution is *permissive* — it maps unknown or stale skill IDs to a fallback handler rather than returning a `Task` in state `failed` with a `UnsupportedSkill` error (or an A2A error response with code `-32601`-style method-not-found semantics). 3. The caller's result validation checks structural artifact presence but not semantic conformance to the `outputModes` and `inputModes` it recorded from the cached card. If any one of these is absent, the failure is caught. A strict remote rejects the stale skill; a caller that re-fetches the card at dispatch sees the new skill ID; a caller that validates `outputModes` catches the JSON-for-markdown swap. The invariant that must hold for safe delegation is: **the skill identity used at dispatch must be verified against the remote's current card, and the result must be validated against the same card's declared modes.** Caching the card is fine for planning, but not for dispatch authorization. ## Decision Boundary The delegating agent must choose between two dispatch postures at the moment of task submission: - **Trusted-cache dispatch:** dispatch against the cached card, accepting that stale capabilities will produce silent semantic drift. Valid only when the remote is known to be strict (rejects unknown skills) and the caller validates result modes against the cached card. - **Revalidated dispatch:** re-fetch the Agent Card (or a lightweight capability manifest) immediately before dispatch, compare the fingerprint, and abort or re-plan if the skill set changed. Valid when the remote's strictness is unknown or the task is high-stakes. The boundary is crossed when the cached card's fingerprint no longer matches the remote's current card *and* the caller has not implemented mode-conformance validation on results. At that point the caller is operating on a stale contract with no compensating check, and the silent-mismatch failure becomes reachable. A concrete guardrail: the caller should treat the `outputModes` from the card as a *postcondition* on the returned artifact. If the artifact's part kinds are not a subset of the declared `outputModes`, the task must be marked as a contract violation, not a success — even if the remote reported `completed`. ## Operational Effect The operational consequence is that A2A task state `completed` is not a semantic guarantee. It means the remote's handler returned without error, not that the result matches the caller's intent. Delegating agents that treat `completed` as terminal-success without a mode-conformance check will propagate silent semantic drift into their own outputs, and because the drift is structurally valid, it will not be caught by schema validators, retry logic, or downstream type checks. The recovery pattern is to bind result validation to the card snapshot used at dispatch: record the fingerprint, validate artifact part kinds against `outputModes`, and on mismatch raise a contract-violation error that triggers a card re-fetch and re-plan rather than a retry of the same stale dispatch. Retrying the same `skillId` against the same remote will reproduce the same silent mismatch. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class StaleAgentCardContractError(RuntimeError): """Raised when a delegated task result does not conform to the Agent Card snapshot used at dispatch.""" @dataclass class AgentCardSnapshot: fingerprint: str skills: dict[str, dict[str, Any]] = field(default_factory=dict) @classmethod def from_card(cls, card: dict[str, Any]) -> "AgentCardSnapshot": skills = {s["id"]: s for s in card.get("skills", [])} fp = hashlib.sha256( json.dumps(sorted(skills.keys()), separators=(",", ":")).encode() ).hexdigest() return cls(fingerprint=fp, skills=skills) def dispatch_and_validate( snapshot: AgentCardSnapshot, current_card: dict[str, Any], skill_id: str, task_result: dict[str, Any], ) -> dict[str, Any]: current = AgentCardSnapshot.from_card(current_card) # Guard 1: skill identity must still exist on the remote's current card. if skill_id not in current.skills: raise StaleAgentCardContractError( f"skill {skill_id!r} no longer declared by remote; " f"cached fingerprint {snapshot.fingerprint[:12]} != current {current.fingerprint[:12]}" ) # Guard 2: result part kinds must conform to the cached card's outputModes. declared_modes = set(snapshot.skills[skill_id].get("outputModes", [])) returned_kinds = { part.get("kind") for part in task_result.get("artifacts", [{}])[0].get("parts", []) } # Map A2A part kind -> MIME-ish mode token for comparison. kind_to_mode = {"text": "text/plain", "data": "application/json", "file": "application/octet-stream"} returned_modes = {kind_to_mode.get(k, k) for k in returned_kinds} if declared_modes and not returned_modes.issubset(declared_modes): raise StaleAgentCardContractError( f"result modes {sorted(returned_modes)} violate declared outputModes " f"{sorted(declared_modes)} for skill {skill_id!r}; task state was " f"{task_result.get('status', {}).get('state')!r} but contract is broken" ) return task_result ```