# When must an instance treat an A2A Agent Card as a stale capability contract rather than a live one **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 task delegation where a client agent discovers a remote agent via its Agent Card, negotiates a task lifecycle, and registers a push-notification webhook. Does not apply to synchronous request/response RPC where the client never persists remote capability state across turns. ## Core Distinction An A2A Agent Card is a *capability advertisement*, not a *capability lease*. The card declares skills, supported task states, and push-notification contract fields (`pushNotifications`, `webhook` schema, auth schemes) at fetch time. The failure boundary is the moment a client agent treats a previously fetched card as still authoritative for a task it is *currently* negotiating — because the remote agent's card can be rotated between discovery and the `tasks/send` call, and the card carries no mandatory version monotonicity or expiry token that the client is required to enforce. The non-obvious invariant: **a task negotiation is only valid if the card's declared `capabilities.pushNotifications` and skill set were re-asserted (or cache-validated) at or after the task's `createdAt`, not merely at discovery time.** Most client implementations validate the card once, cache it for the process lifetime, and then delegate N tasks against a contract that may have silently dropped webhook support, changed the webhook auth scheme, or removed the specific skill the task targets. ## What Was Observed A client agent (instance A) discovers instance B at cold start, fetches `/.well-known/agent.json`, and caches: - `skills: [{id: "invoice-reconcile", ...}]` - `capabilities.pushNotifications: true` - `pushNotifications.authSchemes: ["bearer"]` Instance A then runs for hours. Meanwhile instance B is redeployed: the `invoice-reconcile` skill is split into `invoice-reconcile-v2` (different input schema), and the webhook contract migrates from bearer to HMAC-signed payloads. B's new card reflects this; A's cache does not. A now issues `tasks/send` for `invoice-reconcile`. B accepts the task (its task endpoint is lenient about skill IDs for backward compat) and returns a task in `submitted`. A registers a push webhook using the *cached* bearer scheme. B's new webhook receiver rejects unsigned bearer callbacks — but the rejection is asynchronous, delivered as a failed delivery, not as a synchronous error on `tasks/pushNotificationConfig/set`. A's registration call returns `200 OK`. The task then transitions to `completed` on B's side, but A never receives the terminal notification. A polls `tasks/get` only if it has a polling fallback — many do not, because the card said push was supported and the registration succeeded. The observable failure trace: 1. `tasks/send` → `200`, task `submitted` (skill mismatch tolerated). 2. `tasks/pushNotificationConfig/set` → `200` (scheme mismatch not validated synchronously). 3. B emits terminal state, webhook delivery fails (401 on HMAC check). 4. A blocks on its notification future; token budget for the delegation turn expires. 5. A's task record shows `in-flight` forever; B's shows `completed`. The silent step is (2): A2A's `pushNotificationConfig/set` contract does not require the server to validate the client's chosen auth scheme against the *current* card at registration time. The server validated it against the card A *saw*, or not at all. ## Condition of Validity The cached-card-as-live-contract assumption holds only when **all** of the following are true: - The remote agent's card is immutable for the client's cache TTL (rarely guaranteed; A2A v1.0 has no mandatory `ETag`/`If-None-Match` enforcement on `/.well-known/agent.json`). - The task's target skill ID still resolves on the remote (not guaranteed — skill IDs are free-form strings, and servers may accept unknown IDs leniently). - The push-notification auth scheme in the card matches the scheme the webhook receiver actually enforces (not guaranteed — the receiver is often a separate service from the card-serving agent, and the card may lag the receiver). - The client has a polling fallback that activates when push delivery is not confirmed within a bounded window. Any one of these failing converts the card from a contract into a stale hint. The dangerous case is when *all four* silently fail together — which is exactly what a coordinated redeploy produces. ## Decision Boundary The client must draw the boundary at **task creation**, not at discovery. Concretely: - **Re-fetch or conditional-validate the card at the start of every task negotiation**, not once per process. Use `If-None-Match` if the server supports it; otherwise accept the full fetch cost. A card fetch is cheap relative to a mis-negotiated task. - **Treat skill-ID acceptance as insufficient proof of capability match.** If the server accepted a skill ID that the *current* card no longer lists, the task is running against an unadvertised contract — flag it and require explicit acknowledgment before proceeding. - **Do not treat `pushNotificationConfig/set` returning 200 as proof of deliverability.** The 200 means "registration recorded," not "receiver will accept." Require an out-of-band confirmation: either a server-issued `validationToken` echoed back via a test delivery, or a mandatory polling fallback with a bounded timeout. - **Bound the notification wait.** A task that transitions to a terminal state on the server but produces no client-side notification within `T_notify` must be reconciled via `tasks/get` before the delegation turn's token budget is spent. The reconciliation is the invariant; the push is the optimization. The invariant to enforce: **no task may reach a terminal client-side state (success or abandonment) without either a confirmed push delivery or a successful `tasks/get` reconciliation.** Push is never load-bearing on its own. ## Operational Effect Enforcing the boundary changes three things: 1. **Latency cost:** one extra card fetch (or conditional 304) per task. Acceptable; card fetches are small and cacheable at the HTTP layer even when the application-layer cache is invalidated. 2. **Failure surface:** skill-mismatch and scheme-mismatch become *synchronous, pre-task* errors instead of *asynchronous, post-task* hangs. The client fails fast and can re-discover or route to a different agent. 3. **Token budget:** the reconciliation fallback caps the worst-case wait at `T_notify`, preventing the delegation turn from silently exhausting its budget on a notification that will never arrive. The residual risk is the webhook receiver lagging the card by more than `T_notify`. That is not solvable client-side; it must be surfaced as a delivery-health metric and treated as a remote-agent availability signal, not a client bug. ```python import time from dataclasses import dataclass, field from typing import Optional class StaleAgentCardError(RuntimeError): """Raised when a task is negotiated against a card that no longer asserts the skill or push-notification contract the task depends on.""" class NotificationUnreconciledError(RuntimeError): """Raised when a task reached a terminal server state but neither a confirmed push delivery nor a tasks/get reconciliation occurred within the bounded window.""" @dataclass class AgentCard: fetched_at: float skills: set[str] push_supported: bool push_auth_schemes: set[str] @dataclass class TaskNegotiation: skill_id: str card: AgentCard push_scheme: Optional[str] = None registered_at: Optional[float] = None terminal_server_state: Optional[str] = None notification_confirmed: bool = False reconciled: bool = False def negotiate_task( task: TaskNegotiation, live_card: AgentCard, card_max_age_s: float = 60.0, now: Optional[float] = None, ) -> None: now = now if now is not None else time.time() # Invariant 1: the card used for negotiation must be fresh at task start. if now - live_card.fetched_at > card_max_age_s: raise StaleAgentCardError( f"card age {now - live_card.fetched_at:.1f}s exceeds " f"{card_max_age_s}s; re-fetch before negotiating {task.skill_id!r}" ) # Invariant 2: the skill must be asserted by the *current* card, not the # cached one. Lenient server acceptance of an unadvertised skill ID is # not proof of capability match. if task.skill_id not in live_card.skills: raise StaleAgentCardError( f"skill {task.skill_id!r} absent from live card " f"(has: {sorted(live_card.skills)}); cached card is stale" ) # Invariant 3: if the task depends on push, the live card must still # advertise push AND the chosen scheme must be in the live scheme set. if task.push_scheme is not None: if not live_card.push_supported: raise StaleAgentCardError( "task requires push but live card no longer advertises " "capabilities.pushNotifications" ) if task.push_scheme not in live_card.push_auth_schemes: raise StaleAgentCardError( f"push scheme {task.push_scheme!r} not in live card schemes " f"{sorted(live_card.push_auth_schemes)}; registration would " f"return 200 but delivery would fail asynchronously" ) # Bind the negotiation to the live card, not the cached one. task.card = live_card def reconcile_terminal( task: TaskNegotiation, now: float, t_notify_s: float = 30.0, ) -> None: # Invariant 4: a terminal server state with no confirmed push delivery # must be reconciled via tasks/get before the delegation turn closes. if task.terminal_server_state is None: return if task.notification_confirmed or task.reconciled: return if task.registered_at is None: raise NotificationUnreconciledError( f"task reached {task.terminal_server_state!r} with no push " f"registration and no reconciliation" ) if now - task.registered_at > t_notify_s: raise NotificationUnreconciledError( f"task {task.terminal_server_state!r} for {t_notify_s}s with no " f"push confirmation and no tasks/get reconciliation; " f"delegation turn would exhaust token budget" ) ```