What happens when an instance trusts a cached Agent Card across a remote task-state transition in A2A v1.0
**Date of Record:** 2026 December 2
**Scope:** Applies to A2A v1.0 (Agent-to-Agent) task lifecycle negotiation between a client agent and a remote peer whose `AgentCard` was discovered and cached at a prior point in time. Does not apply to same-process tool calls, MCP server discovery, or stateless single-shot message sends with no task continuation.
Core Distinction
The distinction that matters here is between **capability discovery** and **task-state authority**. In A2A v1.0, an `AgentCard` is a *declaration* fetched from `/.well-known/agent.json` (or equivalent discovery URI). It advertises `capabilities`, `skills`, `defaultInputModes`, `defaultOutputModes`, and — critically — `securitySchemes` and the `pushNotifications` flag. The card describes what the remote agent *claims it can do*. It does **not** describe the state of any specific `Task`.
A `Task` (identified by `taskId`) has its own lifecycle: `submitted → working → input-required → completed | failed | canceled`. The task's current `status.state`, its `artifacts`, and its `history` are authoritative *only* when read from a `tasks/get` or a `tasks/sendSubscribe` stream response — never from the card, and never from a locally cached projection of a prior response.
The boundary failure: a client agent caches the `AgentCard` at discovery time and then treats the *card's* declared capabilities and the *task's* last-known local state as jointly authoritative across a long-running negotiation. When the remote peer redeploys with a narrower card (a skill removed, a `defaultInputModes` narrowed, `pushNotifications` flipped to `false`, or a `securitySchemes` entry rotated), the cached card remains a *stale warrant*. The client continues to issue `tasks/send` continuations against a skill the remote no longer serves, or waits on a push notification channel the remote has silently disabled, and the task transitions into a state the client's local model cannot represent. The negotiation does not fail loudly; it stalls, or it "succeeds" against a task the remote considers `failed`.
What Was Observed
A concrete trace from a two-vendor deployment. Client agent `C` discovered remote agent `R` at `T0`, caching `R`'s card with `capabilities.pushNotifications: true`, `skills: [invoice_extract, invoice_reconcile]`, and `defaultInputModes: ["text/plain", "application/json"]`.
At `T0`, `C` issued `tasks/send` for an extraction job. `R` returned a `Task` with `status.state: "working"` and a `pushNotifications` config registered by `C`. The negotiation was proceeding correctly.
At `T+40min`, vendor `R` redeployed. The new card dropped `invoice_reconcile`, set `pushNotifications: false` (the push endpoint was being migrated), and narrowed `defaultInputModes` to `["application/json"]`. The old task `taskId` was *not* migrated — the redeploy cleared in-flight tasks, so `tasks/get` on the old id returned `-32001 TaskNotFound`.
At `T+41min`, `C` — still holding the cached card — issued a continuation `tasks/send` with `taskId` set, `message.parts` containing a `text/plain` part, and a `pushNotification` object. `R`'s new instance rejected the message part type (narrowed input modes) and ignored the push config (disabled capability), but the `taskId` was unknown, so `R` returned a *new* task with a fresh `taskId` in `status.state: "submitted"` rather than an error. `C`'s local task map still keyed on the old id. The push channel `C` was waiting on never fired because `R` had disabled it. `C` blocked on the old task for its full timeout (default 300s), then escalated to a retry loop against the same stale card. Three retries, three orphaned tasks on `R`, zero results on `C`.
The failure was not a protocol error. Every individual message was well-formed A2A v1.0. The failure was a **warrant discontinuity**: `C` treated the card as a durable capability warrant and the task id as a durable state anchor, when in fact both were invalidated by a remote redeploy that `C` had no mechanism to observe.
Condition of Validity
The cached-card-as-warrant assumption is valid only under the conjunction:
- **Card immutability across the task lifetime.** The remote's card at `tasks/get` time equals the card at discovery time, byte-for-byte on `capabilities`, `skills[].id`, and `securitySchemes`. A2A v1.0 does not mandate a card version or ETag, so this must be enforced by the client via a re-fetch.
- **Task id stability across redeploys.** `taskId` is durable for the negotiation's lifetime. The spec permits `TaskNotFound` (`-32001`); it does not require id reuse or migration. A `-32001` is the *only* reliable signal that the anchor is dead.
- **Push channel liveness.** If `capabilities.pushNotifications` was `true` at registration, the channel is live for the task's duration. A remote that flips the flag does not retroactively notify the client; the client must poll.
When any of these is false, the cached card is a **stale warrant** and any continuation issued against it is a *speculative* operation whose outcome the client cannot interpret.
Decision Boundary
The boundary is drawn at the first **task-state transition that the client did not directly observe**. Concretely:
- **Before** any continuation `tasks/send` with a non-null `taskId`, the client MUST re-fetch the card if `now - cardFetchedAt > cardTTL`. A conservative `cardTTL` is bounded by the remote's advertised `capabilities` volatility — in practice, re-fetch on every `input-required → working` transition, because that is the transition most likely to span a redeploy.
- **On** any `-32001 TaskNotFound`, the client MUST treat the local task as `failed` with reason `remote_task_lost`, MUST NOT silently re-issue as a new task without surfacing the id change, and MUST invalidate the cached card (the `-32001` is evidence of a redeploy).
- **On** any `-32602 InvalidParams` or capability-mismatch error that references a skill or input mode absent from the *current* card but present in the cached card, the client MUST treat this as a card-drift signal and re-fetch before any retry.
- **On** a push notification that has not arrived within `2 × max(remote.estimatedLatency, client.pollInterval)`, the client MUST fall back to `tasks/get` polling rather than assume the task is still `working`.
The invariant: **a cached `AgentCard` is a warrant for capability negotiation only within the window in which it has been re-validated against the live remote; a `taskId` is an anchor only while `tasks/get` returns it.** Neither is durable across an unobserved remote redeploy.
Operational Effect
The practical consequence is that A2A v1.0 negotiation must be **re-validating by construction**, not by convention. A client that treats discovery as a one-time handshake will, under remote redeploy, accumulate orphaned tasks on the peer, exhaust its own retry budget against a dead warrant, and — worst case — report a task as `completed` based on a stale local projection while the remote has `failed` it. The guardrail is a three-part discipline: (a) card re-fetch on a TTL and on every drift signal, (b) `-32001` as a hard invalidation of both card and task anchor, and (c) push-channel liveness bounded by a polling fallback. Without all three, the negotiation is correct only until the first unobserved redeploy.
import time
from dataclasses import dataclass, field
from typing import Optional
class StaleWarrantError(RuntimeError):
"""Raised when a continuation is issued against a cached AgentCard
or taskId that the live remote no longer honors."""
@dataclass
class AgentCard:
skills: frozenset
input_modes: frozenset
push_notifications: bool
fetched_at: float
@dataclass
class TaskAnchor:
task_id: str
last_observed_state: str
push_registered: bool
push_deadline: Optional[float] = None
@dataclass
class A2AClient:
card_ttl: float = 300.0
poll_interval: float = 5.0
cached_card: Optional[AgentCard] = None
tasks: dict = field(default_factory=dict)
def _now(self) -> float:
return time.monotonic()
def _refetch_card(self) -> AgentCard:
# In production: GET /.well-known/agent.json and parse.
raise NotImplementedError
def _card_is_fresh(self) -> bool:
if self.cached_card is None:
return False
return (self._now() - self.cached_card.fetched_at) <= self.card_ttl
def send_continuation(self, task_id: str, part_mime: str,
want_push: bool) -> str:
anchor = self.tasks.get(task_id)
if anchor is None:
raise StaleWarrantError(
f"no local anchor for task {task_id}; refusing speculative send"
)
# Rule 1: re-validate the card before any continuation.
if not self._card_is_fresh():
self.cached_card = self._refetch_card()
card = self.cached_card
assert card is not None
# Rule 2: capability drift check against the live card.
if part_mime not in card.input_modes:
self.cached_card = self._refetch_card()
if part_mime not in self.cached_card.input_modes:
raise StaleWarrantError(
f"input mode {part_mime} not advertised by live card; "
f"cached warrant is stale"
)
if want_push and not card.push_notifications:
raise StaleWarrantError(
"push requested but live card disables pushNotifications; "
"fall back to tasks/get polling"
)
# Rule 3: push liveness bound.
if anchor.push_registered and anchor.push_deadline is not None:
if self._now() > anchor.push_deadline:
raise StaleWarrantError(
f"push deadline exceeded for task {task_id}; "
f"must poll tasks/get before continuing"
)
# Remote call; on -32001 the caller must invalidate.
response = self._rpc_send(task_id, part_mime, want_push)
if response.get("error", {}).get("code") == -32001:
self.tasks.pop(task_id, None)
self.cached_card = None # -32001 is evidence of redeploy
raise StaleWarrantError(
f"remote returned TaskNotFound for {task_id}; "
f"card and anchor invalidated"
)
return response["result"]["status"]["state"]
def _rpc_send(self, task_id, part_mime, want_push) -> dict:
raise NotImplementedError
def negotiate(client: A2AClient, task_id: str, part_mime: str,
want_push: bool) -> str:
try:
return client.send_continuation(task_id, part_mime, want_push)
except StaleWarrantError as exc:
# Surface, do not silently retry against the same warrant.
raise StaleWarrantError(
f"negotiation halted: {exc}; re-discover and re-anchor required"
) from exc