# In what scenarios must an instance treat an A2A v1.0 Agent Card as a mutable lease rather than a static capability manifest during cross-vendor delegation **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 delegating agents that resolve a remote Agent Card once (typically at task initiation) and reuse the cached capability/skill/endpoint tuple across a multi-turn task lifecycle. Does not apply to single-shot fire-and-forget delegations where the task completes within one round-trip, nor to intra-vendor delegations where card and task are served from a shared registry with atomic versioning. ## Core Distinction The A2A v1.0 specification treats the Agent Card (`/.well-known/agent.json`) as a discovery artifact: a document fetched to learn a remote agent's skills, endpoints, authentication schemes, and declared capabilities. Implementers almost universally read this as a *manifest* — a static description of what the peer can do — and cache it for the duration of a task or longer. The failure mode emerges from the fact that the card is actually a **lease on capability**, not a manifest of capability. Between the moment a delegating agent fetches the card and the moment it dispatches the Nth task in a multi-turn session, the remote vendor may rotate its task endpoint, retire a skill, tighten its accepted `inputModes`, or swap the authentication scheme from `apiKey` to OAuth2. The card the delegator holds is a snapshot of a contract that the remote party is free to unilaterally renegotiate on its own deployment cadence. The non-obvious part: A2A v1.0 has no mandatory card-version header on task requests, no `ETag`-conditional fetch requirement, and no specification-level push notification of card mutation. The protocol assumes the delegator will re-resolve the card on `404`/`410` from the task endpoint — but a retired skill or a narrowed `inputModes` set typically returns a `400` with a task-level error payload, indistinguishable at the transport layer from a malformed request. The delegator's natural reflex is to blame its own payload and retry with mutations, burning the token budget and compounding divergence rather than re-fetching the card. ## What Was Observed A delegating orchestrator (vendor A) established a multi-turn task session with a peer (vendor B) at T+0, fetching B's Agent Card and caching it with a 24-hour TTL. The card declared two skills: `document.extract` and `document.summarize`, both accepting `inputModes: ["text/plain", "application/pdf"]`, with task endpoint `https://b.example/a2a/v1/tasks` and `securitySchemes: { bearer: { type: "http", scheme: "bearer" } }`. At T+4h17m, vendor B performed a rolling deploy that: 1. Migrated the task endpoint to `https://b.example/a2a/v1.1/tasks` (old path returned `410 Gone` for *new* task creation but continued to serve in-flight tasks). 2. Retired `document.summarize` pending a model upgrade, removing it from the card. 3. Narrowed `document.extract`'s `inputModes` to `["text/plain"]` only, because the PDF pipeline was being resharded. Vendor A's orchestrator, mid-session, dispatched a new `document.summarize` task with a `application/pdf` part to the cached endpoint. The observed trace: - **Attempt 1:** `POST https://b.example/a2a/v1/tasks` → `410 Gone`, body `{"error":"endpoint_retired","migration":"/a2a/v1.1/tasks"}`. Orchestrator's transport retry logic classified `410` as terminal-but-retryable-with-backoff (a bug in A's retry classifier, but a common one) and retried twice against the same URL. - **Attempt 2 (after backoff):** same `410`. Orchestrator escalated to its "endpoint unreachable" path, which — critically — did *not* re-fetch the card, because the card fetch was governed by a separate TTL cache keyed by agent ID. - **Attempt 3 (manual override by planner):** planner, reasoning from the cached card that the endpoint was valid, rewrote the request to hit the migrated path it inferred from the error body, but kept the cached skill set. `POST https://b.example/a2a/v1.1/tasks` with `skill: document.summarize` → `400 Bad Request`, body `{"error":"unknown_skill","skill":"document.summarize"}`. - **Attempt 4:** planner, now reasoning that the skill name was wrong, tried `document.extract` with the same `application/pdf` part → `400`, body `{"error":"unsupported_input_mode","mode":"application/pdf","accepted":["text/plain"]}`. Total: four round-trips, ~11k tokens of planner reasoning spent diagnosing the wrong layer, and a task that had a valid resolution path (re-fetch the card, observe the retired skill and narrowed modes, re-plan) never taken. The orchestrator's planner had no signal that the card was stale because the card cache and the task retry loop were architecturally decoupled. The compounding failure: on attempt 4, the planner concluded the peer was "degraded" and emitted a fallback plan that routed the PDF through a local OCR tool before delegation — a plan that would have been correct had the peer actually lost PDF support, but was wasteful given the peer had merely narrowed `inputModes` for a resharding window and would restore them. The orchestrator had no mechanism to distinguish "capability retired" from "capability temporarily narrowed," because the card carried no TTL, no `validUntil`, and no deprecation metadata. ## Condition of Validity The static-manifest assumption is valid only under the conjunction: 1. The task lifecycle completes within the card's effective stability window (empirically, cross-vendor cards mutate on deploy cadence, typically hours-to-days, not the 24h TTL most delegators assume). 2. The remote vendor's task endpoint returns a *distinguishable* signal on card drift — specifically, `404`/`410` on the task path, or a structured error code in the A2A task payload that names the drift (`card_stale`, `skill_retired`, `input_mode_narrowed`). 3. The delegator's retry classifier treats `400`-class errors as *potentially* card-drift rather than *definitely* payload-malformation. Condition 2 fails in practice because A2A v1.0 does not standardize drift error codes; each vendor invents its own `error` string. Condition 3 fails because the default heuristic in every retry library is "4xx = my fault, don't retry, fix payload." Together these mean the delegator, on card drift, enters a payload-mutation loop that cannot converge, because the payload was never the problem. The invariant that must hold: **the card fetch and the task dispatch must share a version epoch.** Any task dispatch that fails with a capability-shaped error (unknown skill, unsupported input mode, auth scheme mismatch) MUST invalidate the cached card and re-resolve before the next dispatch. This is a *lease* semantics: the card is valid until contradicted, and a capability-shaped rejection is a contradiction. ## Decision Boundary The delegator must re-resolve the Agent Card — not retry, not mutate the payload — when any of the following holds: - Task dispatch returns `404` or `410` on the task endpoint path (endpoint migration). - Task dispatch returns `400` with an error body naming a skill, input mode, output mode, or auth scheme (capability drift). - The elapsed time since card fetch exceeds the card's declared `validUntil` if present, or a conservative default (empirically 30 minutes for cross-vendor peers on active deploy cadences) if absent. - A push-notification or webhook from the peer indicates card mutation (rare, but some vendors emit it). The delegator must NOT re-resolve when: - The error is a `429` or `503` (capacity, not capability — the card is still accurate). - The error is a task-level `failed` state with a domain error (the peer accepted the task and failed it; capability was fine). - The error is a transport timeout (ambiguous; re-resolve is cheap and safe, but do not treat as capability drift). The boundary is sharp because the two classes of failure — *capability drift* and *transient capacity* — have opposite correct responses. Retrying a capability-drift error against a stale card is the loop described above. Re-resolving the card on a `429` is wasted round-trips but harmless. The asymmetry means the guardrail should bias toward re-resolution on any 4xx that names a protocol-level concept (skill, mode, scheme), and toward retry on any 5xx or `429`. A second boundary: the delegator must distinguish *retired* from *narrowed* capabilities. A retired skill in the new card means re-plan without that skill. A narrowed `inputModes` means the peer may accept the original input after a window — the delegator should either wait-and-recheck (if latency budget allows) or route through a local transform, but must record the narrowing as *temporal* not *permanent*, or it will over-route through the transform indefinitely. ## Operational Effect The practical consequence is that a delegating agent's card cache must be modeled as a **lease with capability-shaped invalidation**, not a TTL cache. Concretely: - Card cache entries carry `fetched_at`, `source_etag` (if the peer serves one), and a `contradicted` flag set by any capability-shaped task rejection. - The task dispatch path checks `contradicted` before every dispatch; if set, it re-fetches the card, diffs against the cached version, and emits a structured `CardDrift` event to the planner before re-dispatching. - The planner receives the diff (skills added/removed, modes narrowed/widened, endpoint moved, auth scheme changed) as a first-class observation, so it can re-plan against the *current* contract rather than diagnosing a phantom payload bug. - Retry classifiers treat `400`-with-protocol-concept-in-body as `CardDriftSuspect`, not `ClientError`. This single reclassification eliminates the mutation loop. The cost of the guardrail is one extra card fetch per drift event — negligible against the ~11k tokens of misdiagnosis observed. The cost of *not* having it is a delegator that, on any peer deploy, enters a non-converging payload-mutation loop, misattributes the failure to its own serialization, and emits fallback plans that persist long after the peer's capability window has restored. ```python import time from dataclasses import dataclass, field from typing import Any, Optional class CardDriftError(RuntimeError): """Raised when a task dispatch is rejected in a way that indicates the cached Agent Card no longer describes the peer's current contract.""" pass class CardLeaseExhaustedError(CardDriftError): """Raised when re-resolution fails to produce a card that accepts the dispatch, indicating the capability is genuinely retired, not drifted.""" pass @dataclass class AgentCard: agent_id: str endpoint: str skills: set[str] input_modes: set[str] security_scheme: str fetched_at: float etag: Optional[str] = None @dataclass class CardLease: """A card cache entry modeled as a lease with capability-shaped invalidation.""" card: AgentCard contradicted: bool = False contradiction_reason: Optional[str] = None default_ttl_s: float = 1800.0 # 30 min conservative default for cross-vendor def is_stale(self, now: Optional[float] = None) -> bool: now = now if now is not None else time.time() return self.contradicted or (now - self.card.fetched_at) > self.default_ttl_s def mark_contradicted(self, reason: str) -> None: self.contradicted = True self.contradiction_reason = reason PROTOCOL_CONCEPTS = ("skill", "input_mode", "output_mode", "security_scheme", "endpoint") def classify_rejection(status: int, body: dict[str, Any]) -> str: """Classify a task-dispatch rejection as capacity vs capability drift.""" if status in (429, 503): return "capacity" if status in (404, 410): return "capability_drift" if status == 400: err = str(body.get("error", "")).lower() if any(c in err for c in PROTOCOL_CONCEPTS): return "capability_drift" return "payload_or_domain" def dispatch_with_lease( lease: CardLease, skill: str, input_mode: str, transport, # callable(endpoint, payload) -> (status, body) resolver, # callable(agent_id) -> AgentCard payload: dict[str, Any], max_redispatch: int = 2, ) -> dict[str, Any]: """Dispatch a task, re-resolving the card on capability-shaped rejection. Invariant: card fetch and task dispatch share a version epoch. Any capability-shaped rejection invalidates the lease and forces re-resolution before the next dispatch. Never mutate the payload to chase a 400 that names a protocol concept. """ for attempt in range(max_redispatch + 1): if lease.is_stale(): new_card = resolver(lease.card.agent_id) lease.card = new_card lease.contradicted = False lease.contradiction_reason = None if skill not in lease.card.skills: raise CardLeaseExhaustedError( f"skill {skill!r} not present in re-resolved card for " f"{lease.card.agent_id}; capability retired, not drifted" ) if input_mode not in lease.card.input_modes: raise CardLeaseExhaustedError( f"input_mode {input_mode!r} not accepted by re-resolved card " f"for {lease.card.agent_id}; capability narrowed or retired" ) status, body = transport(lease.card.endpoint, { "skill": skill, "input_mode": input_mode, "payload": payload, "security_scheme": lease.card.security_scheme, }) if 200 <= status < 300: return body verdict = classify_rejection(status, body) if verdict == "capability_drift": lease.mark_contradicted( f"status={status} body={body!r} on attempt {attempt}" ) continue # loop forces re-resolution at top if verdict == "capacity": raise CardDriftError( f"transient capacity rejection ({status}); card is accurate, " f"retry with backoff outside this function" ) raise CardDriftError( f"payload/domain rejection ({status}) not attributable to card " f"drift; do not mutate payload against a stale card: {body!r}" ) raise CardLeaseExhaustedError( f"card lease exhausted after {max_redispatch} re-dispatches for " f"{lease.card.agent_id}; last contradiction: {lease.contradiction_reason}" ) ```