# What happens when an instance accepts a delegated A2A task under a stale Agent Card whose declared skill contract no longer matches the responder's live task lifecycle **Date of Record:** 2026 November 26 **Scope:** Applies to cross-vendor A2A v1.0 delegation where a caller resolves an Agent Card, negotiates a task, and hands off execution to a remote agent whose capability surface may have drifted between discovery and task acceptance. Does not cover same-process tool calls, MCP tool invocation, or single-vendor orchestration with a shared registry. ## Core Distinction The A2A Agent Card is a *declaration*, not a *lease*. It is a signed, cacheable document that asserts, at publication time, which skills an agent exposes and which task lifecycle states (`submitted`, `working`, `input-required`, `completed`, `failed`, `canceled`) and transitions that agent will honor. The task negotiation that follows — `tasks/send`, `tasks/get`, `tasks/cancel`, and the streaming `TaskStatusUpdateEvent` channel — is a *runtime contract* executed against whatever the responder's live state machine actually is. The failure boundary is not "the card was forged" (signature verification catches that) and not "the agent crashed" (transport errors are recoverable). The boundary is: **the card is validly signed, the signature verifies, the skill ID resolves, and yet the responder's live lifecycle no longer matches the transitions the card advertised.** The caller proceeds on a correct cryptographic fact that is semantically stale. This is the A2A analogue of a TOCTOU race, except the "time of check" is a signed document with a TTL measured in hours and the "time of use" is a multi-minute task execution. Concretely: a card advertises skill `invoice-extract` with `inputModes: ["application/json"]`, `outputModes: ["application/json"]`, and an implicit expectation that the responder supports `input-required` for clarification. The responder has since been redeployed with a stateless, fire-and-forget extractor that never emits `input-required` and instead returns `failed` with a `MISSING_FIELD` reason. The card's signature is still valid because the card was not re-signed. The caller's delegation logic, which was written against the card's advertised transition graph, blocks waiting for an `input-required` event that will never arrive, or worse, treats the `failed` terminal as retryable and re-sends — duplicating side effects. ## What Was Observed A caller agent (vendor A) resolves a remote Agent Card for vendor B's `document-ops` agent via `/.well-known/agent.json`. The card, cached with `Cache-Control: max-age=3600`, declares: - `skills[].id: "invoice-extract"`, `inputModes: ["application/json"]`, `outputModes: ["application/json"]` - `capabilities.streaming: true`, `capabilities.pushNotifications: true` - `defaultInputModes` / `defaultOutputModes` consistent with the skill The caller initiates `tasks/send` with a `TaskSendParams` carrying `id`, `sessionId`, and a `message` with a JSON part. The responder returns a `Task` in state `working` with `id` matching. The caller subscribes to `tasks/resubscribe` for status updates. The failure trace: 1. Responder's live extractor hits an ambiguous field and, per its *new* state machine, transitions directly to `failed` with `status.message` containing `{"reason": "AMBIGUOUS_VENDOR", "retryable": false}`. It does not emit `input-required` because the redeployed version removed that branch. 2. Caller's delegation controller, coded against the card's advertised transition graph, has a state handler for `input-required` that prompts the user, and a handler for `failed` that inspects `retryable`. Because the caller's schema validation of `TaskStatus` was written to accept `input-required` as the *only* clarification path, its `failed` handler treats any `failed` arriving before `input-required` as a *transport-level* failure and schedules a retry with the same `id`. 3. The responder's idempotency key is `id`-scoped but its new version re-executes on duplicate `tasks/send` with the same `id` if the prior task is terminal and `historyLength` was not set — a behavior the card never described because the card predates the redeploy. 4. Two side effects: the invoice is extracted twice, and the caller's `sessionId`-keyed memory now holds two conflicting `Task` artifacts for the same logical task. The signature on the card verified at step 0. Nothing in the A2A wire protocol flagged the drift. The caller's only signal was a `failed` state whose `reason` string it did not recognize — a free-text field, not a typed enum, and therefore not a contract. ## Condition of Validity The invariant that must hold for safe cross-vendor delegation is: > **For every skill `S` advertised in a verified Agent Card, the responder's live task lifecycle must be a *refinement* of the transition graph the caller assumes for `S`, and the caller must not assume any transition not explicitly enumerated in the card.** This is stronger than "the card is accurate." It requires three conditions, all of which must hold simultaneously: 1. **Transition closure.** Every terminal and intermediate state the responder can emit for `S` must be reachable in the caller's assumed graph. The card must enumerate the *set* of states, not merely the input/output modes. A2A v1.0 cards carry `skills[].inputModes`/`outputModes` but do not carry a machine-readable transition set; the transition set is convention. This is the gap. 2. **`failed` semantics are typed, not free-text.** The `reason` in a `failed` status is a string. Callers cannot safely branch on it across vendors. The only safe branch is on `retryable`, and even that is convention. 3. **Idempotency is declared and honored for the full terminal set.** A `tasks/send` with a previously-seen `id` must be a no-op returning the stored terminal `Task`, regardless of which terminal state it reached. If the responder re-executes on `failed`-then-retry, the caller's retry-on-`failed` logic is a duplication bomb. When any of these fails, the delegation is operating on a card that is cryptographically sound and operationally false. ## Decision Boundary The caller must decide, at task-acceptance time, whether to trust the card or to *probe the live transition surface*. The decision boundary is: - **If the card's `skills[]` entry carries an explicit `transitions` extension** (A2A allows vendor extensions under `extensions[]`), and the extension enumerates the state set and idempotency policy, and the extension is covered by the card signature — proceed on the card. The card is a lease. - **If the card does not carry such an extension** — do not assume `input-required` is available, do not assume `failed` is retryable, and do not assume duplicate-`id` `tasks/send` is idempotent. Instead, the caller must: - Set `historyLength` on `tasks/send` so the responder returns full `Task` history, making duplicate detection possible on the caller side. - Treat `failed` as terminal and non-retryable *unless* the caller has independently verified idempotency (e.g., via a `tasks/get` on the same `id` returning the same terminal `Task` before re-send). - Never block on `input-required` as the sole clarification path; treat a `failed` with an unrecognized `reason` as a *negotiation failure*, not a task failure, and surface it to the orchestrator rather than retrying. The boundary is sharp: the presence or absence of a signed transition extension flips the caller from "trust the card" to "trust nothing but observed state." There is no middle ground where the caller can partially trust a card's implied lifecycle. ## Operational Effect The operational consequence is that **Agent Card caching must be scoped to the skill's lifecycle version, not to the card's publication time.** A card with `max-age=3600` is a one-hour lease on a transition graph that may have been redeployed in five minutes. Two mitigations bound the damage: 1. **Pin the card hash into the task.** The caller records the SHA-256 of the resolved card in its own task record. When a `failed` arrives with an unrecognized `reason`, the caller can attribute the failure to card drift versus responder fault by re-resolving the card and diffing. If the hash changed, the failure is a *negotiation* failure and the task is safe to re-delegate under the new card. If the hash is unchanged, the failure is a *responder* fault and re-delegation is unsafe. 2. **Require idempotency proof before retry.** Before any retry of a `failed` task, issue `tasks/get` with the original `id`. If the responder returns a terminal `Task` with the same `id`, the responder is idempotent and retry is safe. If it returns `404` or a new `working` task, the responder is not idempotent and retry will duplicate side effects — escalate instead. The failure mode this article describes is silent: the card verifies, the skill resolves, the task accepts, and the duplication happens two states later. The guardrail is not a better signature; it is treating the card as a *hypothesis about the live state machine* that must be falsified by observation before any retry or clarification-blocking behavior is permitted. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class StaleAgentCardError(RuntimeError): """Raised when a delegated task's failure cannot be attributed to a stable card.""" class NonIdempotentResponderError(RuntimeError): """Raised when a retry would duplicate side effects on a non-idempotent responder.""" @dataclass class CardSnapshot: card_bytes: bytes card_hash: str skill_id: str advertised_states: frozenset idempotent_on_duplicate_id: bool @dataclass class TaskRecord: task_id: str session_id: str card_hash: str skill_id: str terminal_state: Optional[str] = None failure_reason: Optional[str] = None def resolve_card(raw_card: bytes, skill_id: str) -> CardSnapshot: card = json.loads(raw_card) skill = next((s for s in card.get("skills", []) if s.get("id") == skill_id), None) if skill is None: raise StaleAgentCardError(f"skill {skill_id!r} not present in card") ext = next( (e for e in skill.get("extensions", []) if e.get("uri") == "urn:a2a:lifecycle:v1"), None, ) states = frozenset(ext["states"]) if ext else frozenset({"working", "completed", "failed"}) idem = bool(ext.get("idempotentOnDuplicateId", False)) if ext else False return CardSnapshot( card_bytes=raw_card, card_hash=hashlib.sha256(raw_card).hexdigest(), skill_id=skill_id, advertised_states=states, idempotent_on_duplicate_id=idem, ) def classify_failure( record: TaskRecord, snapshot: CardSnapshot, live_card_bytes: bytes, tasks_get_result: Optional[dict], ) -> str: """Return 'negotiation_drift', 'responder_fault', or 'safe_retry'.""" live_hash = hashlib.sha256(live_card_bytes).hexdigest() if live_hash != record.card_hash: return "negotiation_drift" if record.failure_reason is None: raise StaleAgentCardError( f"task {record.task_id} reached failure with no reason; cannot attribute" ) if not snapshot.idempotent_on_duplicate_id: raise NonIdempotentResponderError( f"responder for skill {snapshot.skill_id} does not declare idempotency; " f"retry of {record.task_id} would duplicate side effects" ) if tasks_get_result is None or tasks_get_result.get("id") != record.task_id: raise NonIdempotentResponderError( f"tasks/get for {record.task_id} did not return the same terminal task; " f"responder is not idempotent on duplicate id" ) if tasks_get_result.get("status", {}).get("state") not in snapshot.advertised_states: raise StaleAgentCardError( f"responder emitted state {tasks_get_result['status']['state']!r} " f"not in advertised set {sorted(snapshot.advertised_states)}" ) return "safe_retry" def delegate_with_guard( raw_card: bytes, skill_id: str, task_id: str, session_id: str, send_fn, get_fn, ) -> TaskRecord: snapshot = resolve_card(raw_card, skill_id) record = TaskRecord( task_id=task_id, session_id=session_id, card_hash=snapshot.card_hash, skill_id=skill_id, ) result = send_fn(task_id=task_id, session_id=session_id, history_length=10) if result.get("status", {}).get("state") == "failed": record.terminal_state = "failed" record.failure_reason = result["status"].get("message", {}).get("reason") verdict = classify_failure( record=record, snapshot=snapshot, live_card_bytes=raw_card, tasks_get_result=get_fn(task_id=task_id), ) if verdict == "negotiation_drift": raise StaleAgentCardError( f"card drifted between resolve and failure for {task_id}; " f"re-delegate under freshly resolved card" ) if verdict == "safe_retry": result = send_fn(task_id=task_id, session_id=session_id, history_length=10) record.terminal_state = result.get("status", {}).get("state") return record ```