# How does an instance detect a stale Agent Card binding when A2A v1.0 task delegation crosses a vendor boundary mid-lifecycle? **Date of Record:** 2026 November 20 **Scope:** Applies to A2A v1.0 delegations where the calling agent resolves a remote Agent Card, initiates a `tasks/send` or `tasks/sendSubscribe` lifecycle, and the remote agent's advertised capabilities, auth schemes, or endpoint bindings change between task creation and subsequent lifecycle events (status polling, streaming continuation, push-notification delivery). Does not apply to single-shot, stateless RPC calls with no continuation, nor to intra-process agent calls. ## Core Distinction An A2A Agent Card is treated by most client implementations as *discovery metadata*—fetched once at the start of a session and cached as configuration. It is not. In a v1.0 lifecycle, the Agent Card is a **binding contract** that governs every subsequent event in the task's life: which auth scheme the server will accept for the next `tasks/get`, which content-type the streaming endpoint will emit, which capabilities (`streaming`, `pushNotifications`, `stateTransitionHistory`) the server promised to honor, and which skill IDs are legal targets. The distinction that matters operationally is between *card-as-lookup-table* (safe to cache indefinitely) and *card-as-lifecycle-warrant* (must be re-validated at every state boundary). Cross-vendor delegation fails precisely at this seam: the client holds a card fetched at T0, the server swaps its card at T1 (rolling deploy, key rotation, capability downgrade, tenant migration), and the task's continuation requests between T1 and T2 are validated against a contract neither side still agrees on. The failure is not a network error and not a 4xx—it is a *silent semantic divergence* where both sides believe they are honoring the same protocol. ## What Was Observed A delegating agent (`orchestrator-A`, vendor X) resolved `agent-card.json` from `worker-B` (vendor Y) at task creation. The card advertised `capabilities.streaming: true`, `securitySchemes: {"oauth2_bearer": {flows: {...}}}`, and `skills[3].id = "invoice-reconcile"`. The task was created via `tasks/send` and returned a `Task` object with `status.state = "working"` and a `metadata.continuationToken`. At T1, vendor Y performed a rolling deploy that (a) rotated the OAuth audience from `a2a.worker-b.example/v1` to `a2a.worker-b.example/v2`, (b) disabled `streaming` for the `invoice-reconcile` skill due to a downstream dependency, and (c) renumbered skill IDs so that `invoice-reconcile` became `skill_fin_recon_07`. The new `agent-card.json` was served with `Cache-Control: max-age=300` and a new `ETag`. The orchestrator continued the lifecycle without re-fetching. Three failure traces were observed in the same incident: 1. **Auth continuation failure.** The orchestrator's `tasks/get` at T1+40s carried the v1-audience bearer token. Worker-B returned `401` with `WWW-Authenticate: Bearer error="invalid_token", error_description="audience mismatch"`. The orchestrator's retry logic classified this as a transient auth error and re-attempted with the *same* token three times before escalating. 2. **Streaming downgrade silent loss.** A second task had opened `tasks/sendSubscribe`. After the deploy, the SSE endpoint closed the stream with a normal `event: end` rather than an error. The orchestrator interpreted graceful termination as task completion, marked the task `completed`, and proceeded to write a partial result downstream. Worker-B had actually transitioned the task to `input-required` and was waiting for a follow-up it would never receive. 3. **Skill ID drift.** A third task's follow-up `tasks/send` referenced `skillId: "invoice-reconcile"`. Worker-B's new card had renumbered the skill; the server returned `400 invalid_skill` but the message body used a vendor-specific error code that the orchestrator's classifier mapped to `UNKNOWN`, triggering a fallback path that re-delegated to a *different* worker with the same stale skill ID. The invariant that was violated: **the task's continuation is bound to the card version that authorized its creation, and neither party enforces that binding.** A2A v1.0 defines the card as discovery-time metadata; it does not define a `cardVersion` field on the `Task` object, nor does it require the server to reject continuations whose presented capabilities do not match the current card. The protocol's silence here is the failure surface. ## Condition of Validity The stale-card failure is only reachable when *all* of the following hold. If any is false, the failure mode degrades into a detectable error: - The client caches the Agent Card beyond the task's creation event (near-universal in practice, because re-fetching on every poll is treated as wasteful). - The server mutates its card without invalidating outstanding task continuations (i.e., no per-task `cardVersion` echo, no `409 Conflict` on capability mismatch). - The client's error classifier treats `401`/`400`/stream-close as *transport* conditions rather than *contract* conditions, so it retries or falls back rather than re-resolving the card. - The task lifecycle spans at least one card mutation window—typically minutes to hours for long-running agent tasks, which is exactly the window a rolling deploy occupies. The failure is *not* reachable when the client uses `ETag`-conditional fetches per continuation (the server returns `304` if unchanged, forcing a re-parse only on change), or when the server embeds a `cardVersion` hash in the `Task.metadata` and rejects continuations whose `If-Match`-style header disagrees. Neither is mandated by v1.0. ## Decision Boundary The operational decision is: **at which lifecycle transitions must the client re-validate the card, and what must it do when validation fails?** Re-validation is mandatory—not optional—at four boundaries: 1. Before any `tasks/get` or `tasks/sendSubscribe` continuation that will be authenticated with a scheme the card declared. 2. Before any push-notification registration, because the callback URL and signing keys are card-scoped. 3. Before any skill-targeted `tasks/send` (follow-up or new), because skill IDs are card-scoped and vendor-renumbering is routine. 4. On any `401`, `403`, `400 invalid_skill`, or *graceful* stream close that arrives without a terminal task state—these are the signatures of card mutation, not transport failure. On validation failure (card changed in a way that invalidates the continuation), the client must **not** silently retry, fall back, or mark complete. It must transition the task to a `card-drift` state, surface the diff, and either re-negotiate (re-fetch card, re-auth, re-issue continuation with new skill IDs) or fail the task explicitly. The boundary is between *recoverable re-negotiation* (auth audience rotation, skill renumbering with a resolvable mapping) and *unrecoverable contract loss* (streaming disabled mid-stream with no terminal state, signing key rotation with no key continuity). The first is a retry with a new card; the second is a task failure that must not be papered over. The anti-pattern to reject: treating card drift as a transient error and retrying with the old card. This converts a recoverable re-negotiation into silent data corruption (the streaming-downgrade case) or an infinite retry loop (the auth case). ## Operational Effect Enforcing card re-validation at lifecycle boundaries has three measurable effects. First, it converts silent semantic divergence into explicit `card-drift` transitions, which is strictly better for downstream consumers—a failed task is recoverable; a "completed" task with a partial result is not. Second, it bounds the retry budget: a `401` with `audience mismatch` is classified as a contract event, not a transient one, so the orchestrator stops retrying after one attempt and re-resolves the card. Third, it forces vendors to either publish stable skill IDs across deploys or accept that cross-vendor delegations will fail loudly at deploy boundaries—which is the correct pressure, because silent skill renumbering is the single most common cause of cross-vendor A2A task loss in production. The residual risk is that re-fetching the card on every continuation adds latency and load. The mitigation is `ETag`-conditional fetch: the common case is a `304`, and only a changed card triggers a full re-parse and re-negotiation. This is cheap, and it is the only correct default for a protocol that treats the card as a binding contract while not enforcing that binding. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class CardDriftError(RuntimeError): """Raised when a task continuation is validated against a card that no longer matches the card that authorized the task's creation.""" @dataclass class AgentCard: version_hash: str streaming: bool auth_audience: str skill_ids: set[str] @dataclass class TaskBinding: task_id: str card_hash_at_creation: str skill_id: str continuation_token: str state: str = "working" card_drift: Optional[str] = None history: list[str] = field(default_factory=list) def card_hash(card: AgentCard) -> str: payload = f"{card.streaming}|{card.auth_audience}|{','.join(sorted(card.skill_ids))}" return hashlib.sha256(payload.encode()).hexdigest()[:16] def validate_continuation( binding: TaskBinding, current_card: AgentCard, presented_audience: str, requested_skill: Optional[str] = None, ) -> None: """Called before every lifecycle continuation (tasks/get, sendSubscribe, push registration, skill-targeted send). Raises CardDriftError on any contract divergence; never silently retries.""" current_hash = card_hash(current_card) if current_hash != binding.card_hash_at_creation: binding.card_drift = ( f"card changed: {binding.card_hash_at_creation} -> {current_hash}" ) binding.history.append(f"drift-detected:{current_hash}") raise CardDriftError( f"task {binding.task_id} bound to card {binding.card_hash_at_creation}, " f"server now serves {current_hash}; continuation invalidated" ) if presented_audience != current_card.auth_audience: binding.card_drift = f"audience mismatch: {presented_audience}" binding.history.append("auth-audience-mismatch") raise CardDriftError( f"task {binding.task_id}: presented audience {presented_audience!r} " f"does not match card audience {current_card.auth_audience!r}" ) if requested_skill is not None and requested_skill not in current_card.skill_ids: binding.card_drift = f"skill {requested_skill!r} absent from current card" binding.history.append(f"skill-drift:{requested_skill}") raise CardDriftError( f"task {binding.task_id}: skill {requested_skill!r} not in current card; " f"vendor renumbering suspected, refusing fallback re-delegation" ) def on_stream_closed_without_terminal_state( binding: TaskBinding, current_card: AgentCard ) -> None: """A graceful stream close with no terminal task state is a card-drift signature, not a completion. Must not be marked completed.""" if not current_card.streaming: binding.card_drift = "streaming disabled mid-lifecycle" binding.history.append("streaming-downgrade") raise CardDriftError( f"task {binding.task_id}: stream closed while card advertises " f"streaming=false; task state is indeterminate, not completed" ) if binding.state not in ("completed", "failed", "canceled"): binding.card_drift = f"stream closed in state {binding.state}" binding.history.append("premature-stream-close") raise CardDriftError( f"task {binding.task_id}: stream closed in non-terminal state " f"{binding.state!r}; treating as card-drift, not completion" ) ```