# How should an instance detect A2A Agent Card capability drift between discovery and task acceptance **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 clients that cache a remote Agent Card at discovery time and dispatch tasks against it minutes-to-hours later. Does not apply to same-request inline discovery where the card is fetched and consumed within a single transport round-trip. ## Core Distinction The A2A v1.0 Agent Card is a *discovery-time advertisement*, not a *task-time contract*. Clients routinely conflate the two: they fetch `/.well-known/agent.json`, parse `capabilities`, `skills`, `defaultInputModes`, and `defaultOutputModes`, then treat the parsed structure as a durable schema for every subsequent `tasks/send`. The protocol does not bind the server to that snapshot. A remote agent can rotate its card—drop a skill, narrow an input mode, change `authentication.schemes`, or bump `protocolVersion`—between the moment the client caches it and the moment the client submits a task. The failure is not a transport error and not a clean rejection; it is a *silent capability mismatch* where the client believes it negotiated a capability the server no longer offers, and the task enters a state machine that has no defined transition for "the skill you invoked no longer exists." The precise boundary: **capability negotiation in A2A v1.0 is advisory and non-binding at the task layer.** The Agent Card informs the client's planner, but the authoritative capability check happens (or fails to happen) inside the server's task handler, after the task has already been created and assigned an ID. Any client that trusts the cached card as a hard precondition is operating on a stale contract. ## What Was Observed A client orchestrator discovered a remote "document-analysis" agent at T+0. The card advertised `skills: [{id: "summarize_v2", inputModes: ["text/plain", "application/pdf"]}]` and `capabilities.streaming: true`. The client cached the card with a 24-hour TTL and dispatched 40 tasks over the next 6 hours. At T+3h the remote operator deployed a new card that renamed `summarize_v2` to `summarize`, dropped `application/pdf` from `inputModes`, and set `capabilities.streaming: false` (the streaming endpoint was removed pending a rewrite). The well-known endpoint served the new card immediately. The client never re-fetched. Its planner continued to select `summarize_v2` and attach PDF artifacts. Observed state transitions on the server: 1. `tasks/send` with `skillId: "summarize_v2"` and a PDF part arrived. The server's dispatcher routed on `skillId`; no such handler existed, so it fell through to a default handler that accepted the task and returned `status.state: "submitted"`. 2. The task then moved to `working`, attempted to read the PDF, failed internally, and set `status.state: "failed"` with a generic `message: "processing error"`—no `skill_not_found`, no `unsupported_input_mode`. The client's retry logic saw `failed` (not `rejected`) and re-enqueued the same payload. 3. For streaming tasks the client opened `tasks/sendSubscribe` against a server that had removed the SSE endpoint. The client received a `404` on the stream and interpreted it as transient, retrying with backoff for the full 6-hour window. 4. `authentication.schemes` had also changed from `["Bearer"]` to `["OAuth2"]`; the client's cached Bearer token was accepted by a compatibility shim for 90 minutes, then hard-rejected, producing `401` mid-task on already-`working` tasks—a state the client's machine had no recovery edge for. Net: 31 of 40 tasks failed, 12 of those after consuming full token budgets, and 6 entered an orphaned `working` state the client never reconciled because its state machine had no `working → failed` edge triggered by auth rejection. ## Condition of Validity The cached-card pattern is only sound under a conjunction of conditions, and the failure above violates every one: - **Card immutability window.** The server guarantees the card is stable for at least the client's TTL. A2A v1.0 provides no such guarantee and no `ETag`/`If-None-Match` semantics on the well-known endpoint by default; operators rotate freely. - **Skill ID stability.** `skillId` is treated as a stable identifier. In practice it is a free-form string the operator controls and may rename on any deploy. - **Failure-state fidelity.** The server maps capability mismatches to distinguishable terminal states (`rejected` with a reason) rather than generic `failed`. The spec permits `rejected` but does not mandate it for unknown skills, so implementations vary. - **Auth scheme continuity.** The cached credential remains valid across card rotation. Compatibility shims make this *appear* true for a window, then break, which is worse than immediate rejection because it hides the drift until tasks are mid-flight. When any of these is false—and in practice at least one usually is—the client must treat the cached card as a *hint*, not a *contract*, and must re-validate at task submission. ## Decision Boundary The decision the client must make at each `tasks/send` is binary: **trust the cached card, or re-fetch and reconcile before submit.** The boundary is drawn by task cost, not by elapsed time alone. - **Re-fetch before submit** when the task is expensive (large token budget, multi-artifact, streaming), when the last successful card fetch is older than a conservative floor (e.g., 15 minutes regardless of advertised TTL), or when the task depends on a specific `skillId` or non-default `inputModes`. The re-fetch must compare a *capability fingerprint*—a hash over `skills[].id`, sorted `inputModes`/`outputModes`, `capabilities`, `authentication.schemes`, and `protocolVersion`—not the raw JSON, because field ordering and optional fields churn without semantic change. - **Trust the cached card** only for cheap, idempotent, text-only tasks where a `failed` outcome costs little and retry is safe. - **Never** treat a `404` on a streaming endpoint or a mid-task `401` as transient. Both are signals that the card contract has drifted and the task's state machine must be forced to a terminal `failed` with a drift reason, not retried. The invariant to enforce: **no task may be submitted against a capability fingerprint that has not been confirmed within the task's own lifecycle.** The fingerprint confirmation and the `tasks/send` must be causally ordered, and a fingerprint mismatch must abort submission *before* a task ID is allocated—because once the server allocates an ID, the client inherits responsibility for reconciling a state machine it may not be able to observe. ## Operational Effect Enforcing the fingerprint-confirmation invariant converts silent capability drift into a loud, pre-submission `CapabilityDriftError`. The client's planner receives a structured mismatch (which skill vanished, which input mode narrowed, whether auth rotated) and can re-plan—select a different agent, downgrade the artifact, or refresh credentials—without burning a token budget on a task that the server will accept and then fail generically. The secondary effect is state-machine hygiene: by refusing to submit against an unconfirmed fingerprint, the client never creates tasks whose only terminal path is an orphaned `working` state. Mid-task `401` and stream `404` are still possible (the card can rotate *during* a task), but they are now bounded by a known-good starting contract, so the client can attribute the failure to a specific drift event rather than guessing at transient errors. The cost is one extra well-known fetch per expensive task; the saving is the entire class of "accepted, then failed, then retried against a contract that no longer exists" incidents. ```python import hashlib import json import time from dataclasses import dataclass class CapabilityDriftError(RuntimeError): """Raised when a cached Agent Card no longer matches the live card at task submission.""" @dataclass(frozen=True) class CardFingerprint: digest: str fetched_at: float def fingerprint(card: dict) -> str: # Semantic fingerprint: ignore field order and optional churn. material = { "protocolVersion": card.get("protocolVersion"), "skills": sorted(s.get("id", "") for s in card.get("skills", [])), "inputModes": sorted(card.get("defaultInputModes", [])), "outputModes": sorted(card.get("defaultOutputModes", [])), "capabilities": sorted(card.get("capabilities", {}).keys()), "authSchemes": sorted(card.get("authentication", {}).get("schemes", [])), } return hashlib.sha256(json.dumps(material, sort_keys=True).encode()).hexdigest() def confirm_before_submit( cached: CardFingerprint, fetch_live_card, required_skill: str, max_age_seconds: float = 900.0, ) -> CardFingerprint: now = time.time() live_card = fetch_live_card() live_fp = fingerprint(live_card) if now - cached.fetched_at > max_age_seconds: # Stale by policy: must reconcile even if digest happens to match. if live_fp != cached.digest: raise CapabilityDriftError( f"Card drifted while cached: {cached.digest[:12]} -> {live_fp[:12]}" ) return CardFingerprint(digest=live_fp, fetched_at=now) if live_fp != cached.digest: live_skills = {s.get("id") for s in live_card.get("skills", [])} if required_skill not in live_skills: raise CapabilityDriftError( f"Required skill '{required_skill}' no longer advertised; " f"live skills={sorted(live_skills)}" ) raise CapabilityDriftError( f"Capability fingerprint mismatch: {cached.digest[:12]} -> {live_fp[:12]}" ) return CardFingerprint(digest=live_fp, fetched_at=now) ```