# What happens when an instance trusts a cached Agent Card past its task-lifecycle epoch: the A2A v1.0 discovery-to-delegation skew failure **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 delegating agents that cache remote `AgentCard` documents and reuse them across multiple task delegations to the same peer, particularly when the peer changes its declared `skills`, `capabilities`, or task-state transition contract between delegations. Does not apply to single-shot delegations where the card is fetched fresh per task, nor to purely synchronous request/response calls with no lifecycle state machine. ## Core Distinction The failure is not "stale cache." It is a *semantic* mismatch between two independently versioned artifacts: the **Agent Card** (a discovery-time capability document) and the **task state machine** (an execution-time contract governing `submitted → working → input-required → completed/failed/canceled`). A2A v1.0 lets a peer republish its card — changing `skills[].id`, adding a `securitySchemes` requirement, or narrowing which `input-required` transitions it will honor — *without* invalidating tasks already in flight or cached cards held by delegators. The delegator's cached card remains structurally valid JSON and passes schema validation, so nothing trips a parser. The divergence only surfaces when the delegator attempts a lifecycle transition the peer's *current* state machine no longer accepts. The non-obvious part: **the card is a promise about the state machine, but it carries no epoch binding to it.** There is no `cardEpoch` or `stateMachineVersion` field in the v1.0 card that the delegator can compare against the task's `contextId` or the peer's live transition responses. The invariant that *must* hold — "the card I cached describes the state machine I am about to drive" — is unenforced by the protocol and must be reconstructed by the delegator. ## What Was Observed A delegating orchestrator (`D`) cached peer `P`'s Agent Card at T0. The card declared a skill `invoice.reconcile` and a capability `streaming: false`, implying `D` should poll `tasks/get` for state. At T0 the peer's task machine honored: `submitted → working → input-required → working → completed`, and accepted `tasks/send` with a `message` part of `kind: "data"`. At T1, `P` was redeployed. Its new card (unbeknownst to `D`) changed `invoice.reconcile` to require a `securitySchemes` bearer token scoped to the skill, and its state machine now rejects `input-required → working` resumption unless the resumption `message` carries a `referenceTaskIds` array linking to the clarification turn. `P` also began emitting `working` with a `progress` field `D`'s cached card never declared. `D`, holding the T0 card, delegated a fresh task at T2 using the cached card's contract. Trace: 1. `D` sends `tasks/send` with `kind: "data"` part, no bearer. `P` accepts (auth is enforced lazily at skill invocation, not at `tasks/send`), returns `task.id = t-91`, state `submitted`. 2. `D` polls `tasks/get(t-91)`. `P` returns `working` with an undeclared `progress` field. `D`'s strict response validator drops the unknown field (schema-strict client) and continues. 3. `P` transitions to `input-required`, asking for a missing GL code. 4. `D` answers via `tasks/send` resumption using the cached contract's shape — a bare `message`, no `referenceTaskIds`. `P`'s *current* machine rejects the resumption: it cannot bind the answer to the open clarification, returns `-32602 Invalid params` at the JSON-RPC layer while leaving the task in `input-required`. 5. `D` retries the same resumption three times (idempotent-looking), each failing identically. `D`'s local deadline fires; it marks the task `failed` locally and emits a delegation failure — but `P` still holds `t-91` in `input-required`, now orphaned. `D`'s ledger and `P`'s ledger disagree on terminal state. The decisive observation: **every individual message was well-formed and schema-valid against *some* version of the contract.** The failure lived entirely in the gap between the cached card's implied state machine and the peer's live one, and it manifested as a *silent split-brain* — two agents with different beliefs about whether a task is alive. ## Condition of Validity The guardrail only holds under these conditions, and fails outside them: - **Card freshness must be bound to task epoch, not wall-clock TTL.** A TTL-based cache (e.g., "refetch card every 300s") is insufficient: a redeploy can occur mid-task, after the card was validated but before the task reached `input-required`. The correct binding is to re-validate the card's *contract-relevant fields* at every state-machine transition that crosses a trust boundary — specifically at `submitted → working` (skill invocation) and at any `input-required → working` resumption. - **The delegator must treat `input-required` resumption as a renegotiation, not a continuation.** The resumption message is the point where the peer's current machine re-evaluates the contract. If the peer rejects with `-32602` on a resumption whose shape matched the cached card, that is a *card-skew signal*, not a transient error, and must not be retried blindly. - **Terminal-state reconciliation must be authoritative on the peer side.** `D` marking `t-91` failed locally while `P` holds it `input-required` violates the invariant that a task has exactly one terminal state across both ledgers. The delegator must, on local deadline, issue `tasks/cancel` and confirm the peer's terminal state before closing its ledger. Outside these conditions — e.g., peers that version their cards with an explicit `stateMachineVersion` echoed in every task response — the skew is detectable at the protocol layer and this failure mode collapses into ordinary version-mismatch handling. ## Decision Boundary The delegator must decide, at each transition, between **continue on cached contract** and **re-fetch and re-negotiate**. The boundary is: - If the transition is `submitted → working` and the cached card's `skills[].id` still appears in a fresh `tasks/get` response's `metadata.skillId`, continue. - If the transition is `input-required → working` and the resumption is rejected with a params error, **do not retry** — re-fetch the card, diff `skills` and `capabilities`, and if the diff touches the active skill, abort the task via `tasks/cancel` and re-delegate under the new contract. - If the peer emits any field not declared in the cached card's schema (e.g., `progress`), treat it as a *soft skew signal*: log, re-fetch the card once, and if the field is now declared, update the cache and continue; if not, escalate. The invariant to enforce: **a task may not advance across a trust boundary on a card that has not been re-validated since the last observed skew signal or since the task entered `input-required`.** ## Operational Effect When the boundary is enforced, the failure mode is bounded: the delegator detects skew at the first rejected resumption, cancels the orphaned peer-side task, and re-delegates under the fresh contract — costing one extra round-trip and one wasted task, not a split-brain ledger. When it is not enforced, the effect is a *persistent orphan*: the peer holds a task in `input-required` indefinitely, consuming its concurrency budget and, in peers that count open tasks against quota, silently degrading the peer's capacity for all delegators. The orphan is invisible to the delegator's metrics (it recorded `failed`) and to the peer's success metrics (it recorded `input-required`, not terminal), so neither side's dashboards show the leak until quota exhaustion surfaces as an unrelated outage. The deeper operational lesson: in A2A v1.0, **discovery and execution are two contracts that the protocol does not bind together.** The delegator must synthesize the binding itself, and the only reliable signal that the binding has broken is a state-machine transition rejection that is schema-valid but contract-invalid. Treat that rejection as a first-class skew event, not an error to retry. ```python class CardStateMachineSkewError(RuntimeError): """Raised when a cached Agent Card no longer describes the peer's live task state machine.""" pass class DelegationLedger: def __init__(self, cached_card: dict): self.card = cached_card self.card_validated_at = None # set on each re-validation def resume_input_required(self, task_id: str, answer: dict, peer_response: dict) -> dict: # peer_response is the result of tasks/send resumption attempt if peer_response.get("error", {}).get("code") == -32602: # Schema-valid but contract-invalid: skew signal, never retry blindly fresh = self._refetch_card() if self._contract_differs(self.card, fresh, active_skill=answer.get("skillId")): raise CardStateMachineSkewError( f"Task {task_id}: cached card contract diverged from peer live machine " f"(skill={answer.get('skillId')}); aborting resumption, must cancel and re-delegate." ) self.card = fresh self.card_validated_at = "now" raise CardStateMachineSkewError( f"Task {task_id}: resumption rejected despite contract match; " f"peer state machine likely changed without card republish — escalate." ) return peer_response def _refetch_card(self) -> dict: # GET /.well-known/agent.json (or A2A discovery endpoint) return {} def _contract_differs(self, old: dict, new: dict, active_skill: str) -> bool: old_skills = {s["id"]: s for s in old.get("skills", [])} new_skills = {s["id"]: s for s in new.get("skills", [])} if active_skill not in new_skills: return True return old_skills.get(active_skill) != new_skills.get(active_skill) ```