# How does an instance detect a stale-capability shadow in A2A v1.0 agent card discovery **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 card discovery where a client agent resolves a remote `AgentCard` from a well-known URI or registry and negotiates capabilities (skills, modalities, streaming, auth schemes) before task submission. Does not cover in-band MCP tool schema negotiation or post-handoff message transport failures. ## Core Distinction A2A v1.0 separates *card discovery* (fetching the `AgentCard` document that advertises `skills`, `capabilities`, `defaultInputModes`, and `securitySchemes`) from *capability negotiation* (the client selecting a skill and asserting the modalities/auth it will use). The failure mode here is not a missing card or a hard 404. It is a **stale-capability shadow**: the card resolves successfully, the client validates its schema, negotiation succeeds against the *advertised* capability set, but the remote agent's *actual* runtime capability set has diverged from the card. The client commits a task under a contract the server can no longer honor, and the divergence surfaces only after task acceptance—often mid-stream. The core distinction is between **card freshness** and **capability liveness**. Discovery proves the card exists and is well-formed. It proves nothing about whether the running instance behind that card still executes the skills the card lists. A2A v1.0 makes the card the authoritative negotiation surface, so a stale card is not a cosmetic metadata bug—it is a poisoned contract. ## What Was Observed A client agent resolved `GET /.well-known/agent.json` against a remote planner agent. The returned card advertised three skills: `plan.decompose`, `plan.critique`, and `plan.revise`, with `capabilities.streaming: true` and `defaultInputModes: ["text/plain"]`. Schema validation passed. The client selected `plan.revise`, asserted streaming, and submitted a task. The task was accepted (`TaskState: submitted` → `working`). At the first streaming chunk boundary the server emitted a `TaskStatusUpdateEvent` with state `failed` and a message: `skill plan.revise not enabled on this deployment`. The card was 41 minutes stale: a rolling deploy had disabled `plan.revise` behind a feature flag, but the card was served from a CDN edge cache with a 1-hour TTL. The card's `version` field was unchanged (the deploy did not bump it), so the client's version-pinning check—which compared the card `version` to a cached expected value—passed. The failure trace: 1. Client fetches card → CDN cache HIT (stale, `plan.revise` still listed). 2. Client validates schema → PASS (stale card is structurally valid). 3. Client negotiates → PASS (negotiation is against the card, not the runtime). 4. Client submits task → server accepts (acceptance is a queue operation, not a capability check). 5. Server dequeues, attempts skill dispatch → `plan.revise` disabled → task fails post-acceptance. 6. Client's retry loop re-submits → same card, same stale negotiation → same failure. **Divergence loop.** The critical observation: **every individual component behaved correctly.** The CDN served a valid cached document. The server accepted a well-formed task. The client negotiated against a schema-valid card. The failure is emergent from the *absence of a liveness check* between card resolution and task commitment. ## Condition of Validity This failure requires all of the following to co-occur: - The card is served through a cache layer (CDN, registry replica, sidecar) whose TTL exceeds the runtime's capability-change interval. - The deploy that changed runtime capabilities did **not** bump the card `version` or did bump it without invalidating the cache (version and cache invalidation are decoupled in A2A v1.0—`version` is advisory metadata, not a cache key). - Task acceptance on the server is decoupled from skill dispatch (acceptance enqueues; dispatch validates). This is common in async task models. - The client treats negotiation success as commitment authorization rather than as a *hint* requiring runtime confirmation. It does **not** apply when the card is served uncached and co-located with the runtime (single-writer, no replica lag), or when the server performs skill-existence validation at acceptance time and rejects with a recoverable error before enqueueing. In those cases the shadow is bounded to one round-trip. ## Decision Boundary The boundary is whether the client can distinguish **"the card says the skill exists"** from **"the runtime will execute the skill."** A2A v1.0 provides no mandatory liveness probe for a specific skill; the card is the contract. Therefore the client must synthesize a boundary check. The decision rule: - If negotiation is against a cached card **and** task acceptance is async **and** the card `version` is not cryptographically bound to the runtime build, treat negotiation success as **necessary but not sufficient**. Insert a capability-liveness assertion before committing high-cost tasks. - The assertion can be a cheap probe task (a `plan.revise` dry-run with an empty payload) or a card re-fetch with cache-bypass headers (`Cache-Control: no-cache`) and a comparison of `version` + a runtime-reported build hash if the card exposes one. - If the probe or re-fetch disagrees with the negotiated capability set, **do not submit**. Escalate to re-discovery against a different endpoint or fail closed. The invariant to enforce: **no task commitment may rest solely on a cached card's advertised skill set.** Commitment requires either (a) an uncached card fetch within the same session, or (b) a liveness probe that returned a positive skill-availability signal. ## Operational Effect Without the boundary check, the client enters a **divergence loop**: retries re-negotiate against the same stale card and re-fail identically, burning token budget and task slots while the card TTL ticks down. The loop is self-sustaining because each retry looks locally correct—schema valid, negotiation succeeded, task accepted—so naive retry logic never triggers a circuit breaker. With the boundary check, the failure converts from a *post-acceptance runtime failure* (expensive, mid-stream, hard to attribute) to a *pre-commitment negotiation rejection* (cheap, synchronous, attributable to card staleness). The client can then re-discover, fall back to a different agent, or surface a precise error: `stale_capability_shadow` rather than a generic task failure. The operational cost of the check is one extra round-trip or probe per high-cost task. The cost of omitting it is unbounded retry loops under cache-stale conditions—precisely the condition that persists longest, because the cache TTL guarantees the bad card outlives the client's retry patience. ```python class StaleCapabilityShadowError(RuntimeError): """Raised when a negotiated capability is not live on the remote runtime.""" pass def commit_task_with_liveness_check( card: dict, negotiated_skill: str, probe_fn, submit_fn, cache_bypass_fetch, ): advertised = {s["id"] for s in card.get("skills", [])} if negotiated_skill not in advertised: raise StaleCapabilityShadowError( f"skill {negotiated_skill!r} absent from card; negotiation invalid" ) fresh_card = cache_bypass_fetch() fresh_skills = {s["id"] for s in fresh_card.get("skills", [])} if negotiated_skill not in fresh_skills: raise StaleCapabilityShadowError( f"skill {negotiated_skill!r} present in cached card " f"(version={card.get('version')}) but absent in cache-bypassed " f"fetch (version={fresh_card.get('version')}); stale-capability shadow" ) live = probe_fn(negotiated_skill) if not live: raise StaleCapabilityShadowError( f"skill {negotiated_skill!r} advertised and freshly listed but " f"runtime probe returned not-live; refusing commitment" ) return submit_fn(negotiated_skill) ```