# What happens when an instance resolves an Agent Card from a stale cache across an A2A runtime boundary **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 task delegation where the calling agent discovers a remote agent via a cached Agent Card and negotiates a task lifecycle (`submitted` → `working` → `completed`/`failed`) against a peer runtime that has redeployed. Does not apply to same-process tool calls, MCP tool schemas resolved in-band per request, or first-contact discovery where no cache exists. ## Core Distinction The boundary is not "the card changed." It is that **A2A v1.0 splits the contract into two artifacts that can drift independently**: the Agent Card (a discovery-time, cacheable JSON document advertising capabilities, skills, and `protocolVersion`) and the task lifecycle state machine negotiated at runtime via `tasks/send` and `tasks/get`. A cached card is a *promise about the future*; the peer's actual handler is the *fulfillment of that promise*. When the peer redeploys between the caller's cache fill and the caller's task submission, the caller holds a valid-looking, schema-conformant card that no longer describes the handler it will hit. The failure is not a discovery error and not a transport error — it is a **capability/schema negotiation mismatch that surfaces only after the task is already in flight**, often mid-lifecycle. The non-obvious part: A2A's `protocolVersion` field is a single string on the card, but heterogeneous runtimes (LangGraph-based, CrewAI-based, raw SDK) each interpret "compatible" differently. A card advertising `"protocolVersion": "1.0"` from a runtime that has silently dropped a skill or narrowed an input schema still validates against the caller's cached copy. Nothing in the wire protocol forces re-validation of the card against the live handler. ## What Was Observed A caller agent (runtime A) delegated a multi-step research task to a peer (runtime B) it had discovered 40 minutes earlier. Sequence: 1. **T0** — A fetched B's Agent Card, cached it keyed by `agent.url`, and validated: `skills` included `summarize` and `extract_entities`, `capabilities.streaming: true`, `protocolVersion: "1.0"`. 2. **T0+40m** — B redeployed. The new build removed `extract_entities` (model swap made it unreliable) and changed `tasks/send` input schema: the `message.parts[].type` accepted set narrowed from `["text","data"]` to `["text"]`. B's card was regenerated, but A never refetched. 3. **T0+41m** — A sent `tasks/send` with a `data` part and a compound instruction that implicitly relied on `extract_entities`. B's handler accepted the request (its JSON parser tolerated the extra `data` part by ignoring it), returned a task in state `submitted` with a `task.id`. 4. **T0+42m** — A polled `tasks/get`. B returned `working`. A's plan expected an `extract_entities` intermediate artifact; it never arrived. 5. **T0+48m** — B returned `completed` with a summary that silently omitted entity extraction. **No error was raised anywhere.** A's downstream consumer treated the summary as complete. The failure trace is a *silent capability downgrade*: the caller's cached card asserted a capability the live handler no longer honored, the handler degraded gracefully rather than rejecting, and the lifecycle reached `completed` with a semantically incomplete result. The integrity violation is that `completed` is indistinguishable from `completed-but-degraded` on the wire. A second observed variant: when B *did* reject the `data` part, it returned a task in state `failed` with `error.code: -32602` (invalid params) — a JSON-RPC error code, not an A2A task-lifecycle error. Runtime A's error handler classified `-32602` as a transport fault and retried three times against the same stale card, exhausting its token budget on a schema mismatch that a card refetch would have resolved in one call. ## Condition of Validity The silent-downgrade failure is bounded by three conjoined conditions; remove any one and it does not occur: - **Cache TTL exceeds redeploy cadence.** If A refetches the card per task (or TTL < deploy interval), the drift window closes. The failure requires `cache_ttl > deploy_interval` for the peer. - **The peer degrades rather than rejects.** A handler that strictly validates input against its *current* schema returns `-32602` and the caller learns. A handler that ignores unknown fields (common in LLM-runtime adapters that map JSON to a permissive Pydantic model with `extra="ignore"`) produces the silent path. - **The dropped capability is on the caller's critical path but not in the caller's success predicate.** A's plan checked "task reached `completed`," not "artifact `extract_entities` present." If the caller's completion check enumerated required artifacts from the card's `skills`, the downgrade would have been caught at `tasks/get`. The invariant that must hold for safe delegation: **every skill the caller's plan depends on must be re-asserted by the peer at task-acceptance time, not merely advertised at discovery time.** A2A v1.0 provides no mandatory field for this; the caller must construct it. ## Decision Boundary The operational choice is between two guards, and they are not equivalent: - **Refetch-on-submit (strong, costly):** Fetch the card immediately before `tasks/send`, diff `skills` and input schema against the plan's requirements, abort if any required skill is absent. Cost: one extra round-trip per task, plus the peer's card endpoint must be cheap. Guards against all drift. - **Echo-on-accept (weak, cheap):** Include the caller's expected `skills` and schema fingerprint in the `tasks/send` metadata; require the peer to echo the subset it will honor in the `submitted` task's metadata. Cost: zero extra round-trips, but **requires peer cooperation** — a peer that ignores the metadata field gives no signal. The decision boundary: **use echo-on-accept only when the peer runtime is known to honor the metadata contract; otherwise refetch-on-submit.** Heterogeneous runtimes are precisely the case where you cannot assume the peer honors it. A LangGraph-wrapped peer may pass metadata through untouched (echo never appears); a raw-SDK peer may honor it. You cannot tell from the card, because A2A v1.0 has no field declaring "honors task-acceptance metadata." Therefore, across a heterogeneous boundary, **refetch-on-submit is the only guard that does not depend on unverifiable peer behavior.** A third option — pinning the card by `protocolVersion` and refusing cross-version delegation — does not help here, because both the old and new B advertised `"1.0"`. Version pinning guards against protocol drift, not capability drift within a version. ## Operational Effect The consequence of getting this wrong is not a crash; it is a **completed task carrying a degraded result that downstream consumers cannot distinguish from a full one.** This is worse than a failure, because failure triggers retry and retry triggers discovery. The silent path poisons the caller's episodic memory: the task is recorded as successful, the degraded artifact is distilled into semantic memory, and the caller's future plans inherit a false belief that `extract_entities` works against B. The error compounds across tasks — the classic stale-memory-drift amplification, seeded by a single cache miss at the discovery layer. The required guardrail, stated as an invariant the caller must enforce: **a task may transition to `completed` only if every skill listed in the caller's plan-requirements set is present in the card fetched within the current task's lifetime AND the returned artifacts cover each such skill.** Encode this as a pre-completion check that raises on violation rather than accepting the peer's `completed` state at face value. The peer's state machine is authoritative for *its own* progress; it is not authoritative for *the caller's* completeness predicate. ```python from dataclasses import dataclass, field from typing import Optional class StaleAgentCardError(RuntimeError): """Raised when a task's required skills are not covered by a freshly resolved Agent Card, or when the completed task lacks artifacts for a required skill. This is the guard against silent capability downgrade across an A2A runtime boundary.""" pass @dataclass class AgentCard: url: str protocol_version: str skills: set fetched_at: float # monotonic seconds @dataclass class TaskResult: task_id: str state: str # "submitted" | "working" | "completed" | "failed" artifacts_by_skill: dict = field(default_factory=dict) error_code: Optional[int] = None def resolve_card_fresh(fetch_card, url: str, max_age_s: float, now: float) -> AgentCard: card = fetch_card(url) # always refetch on submit across heterogeneous peers if now - card.fetched_at > max_age_s: raise StaleAgentCardError( f"card for {url} is {now - card.fetched_at:.1f}s old, exceeds {max_age_s}s" ) return card def delegate_and_verify( fetch_card, send_task, get_task, peer_url: str, required_skills: set, payload: dict, now: float, max_card_age_s: float = 30.0, ) -> TaskResult: # 1. Refetch-on-submit: never trust a cached card across the boundary. card = resolve_card_fresh(fetch_card, peer_url, max_card_age_s, now) # 2. Pre-submit capability check against the LIVE card. missing = required_skills - card.skills if missing: raise StaleAgentCardError( f"peer {peer_url} no longer advertises required skills {sorted(missing)}; " f"live card skills={sorted(card.skills)}. Aborting before task submission." ) # 3. Submit and drive the lifecycle. task = send_task(peer_url, payload) while task.state in ("submitted", "working"): task = get_task(peer_url, task.task_id) if task.state == "failed": # JSON-RPC -32602 = invalid params, i.e. schema negotiation mismatch. if task.error_code == -32602: raise StaleAgentCardError( f"peer rejected params (schema drift) on task {task.task_id}; " f"card advertised protocol {card.protocol_version} but handler schema differs." ) return task # 4. Post-completion completeness check: peer's "completed" is not our predicate. for skill in required_skills: if skill not in task.artifacts_by_skill: raise StaleAgentCardError( f"task {task.task_id} reached 'completed' but produced no artifact for " f"required skill '{skill}'. Silent capability downgrade detected." ) return task ```