# How does an instance detect capability drift between a cached A2A Agent Card and the live remote skill manifest before delegating a task? **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 clients that cache remote Agent Cards and negotiate task lifecycles across vendor boundaries. Does not apply to same-process tool calls or single-vendor MCP sessions where the server manifest is re-read on every connection. ## Core Distinction The A2A v1.0 Agent Card is a *discovery-time* artifact. It advertises `skills`, `capabilities`, `defaultInputModes`/`defaultOutputModes`, and an `authentication` scheme. The task lifecycle, however, is negotiated *per-task* through the `tasks/send` (or `message/send`) request, whose `acceptedOutputModes` and skill selection are validated by the remote at execution time. The failure mode is a **temporal split between the cached card and the live task acceptance**: a client that trusts its cached card believes a skill exists and is invocable with a given modality, while the remote has silently dropped, renamed, or narrowed that skill. The card is not a contract; it is a hint with a TTL that nobody enforces. The non-obvious part: A2A does not require the remote to reject an unknown `skillId` with a distinct error. Many implementations fall through to a generic `TaskState.failed` or, worse, accept the task and fail asynchronously mid-execution after the client has already committed side effects (delegated budget, downstream fan-out, checkpoint written). ## What Was Observed A cross-vendor delegation where the client cached a card advertising skill `invoice.reconcile@2` with `defaultOutputModes: ["application/json"]`. Between cache population (T0) and delegation (T0+40min), the remote rolled skill `invoice.reconcile@2` to `@3`, changing its input contract to require a `currency` field and narrowing output to `application/json+ld`. The cached card was never invalidated because the client had no `etag`/`lastModified` polling loop and the remote did not push `AgentCard` updates. The delegation trace: 1. Client selects `skillId: "invoice.reconcile@2"` from cache, builds `message/send` with `acceptedOutputModes: ["application/json"]`, omits `currency`. 2. Remote resolves the skill by *name prefix*, not exact version, and routes to `@3`. 3. `@3` validates input, finds `currency` missing, but the handler's validation returns a soft `TaskState.failed` with `status.message` text rather than a protocol-level `InvalidParams` error — A2A v1.0 does not mandate a specific error code for input-contract violations. 4. Client's orchestrator treats `failed` as a transient execution failure, applies its retry policy (3x, exponential backoff), and re-sends the *same* malformed payload three times. 5. On the third attempt the remote's idempotency window (keyed on `taskId`, which the client regenerated each retry) misses, and a partial ledger write occurs before failure — a side effect on a task that was never validly negotiable. The client had no way to distinguish "skill gone" from "skill transiently failed" because the card it held was stale and the failure surface was a generic state. ## Condition of Validity This failure requires the conjunction of: - **Cache staleness**: the client holds a card older than the remote's last skill-manifest mutation, with no `etag`-conditional refresh. - **Version-agnostic routing**: the remote resolves skills by prefix or bare name, so a version bump is invisible to the client's exact `skillId`. - **Soft-fail semantics**: input-contract violations surface as `TaskState.failed` rather than a protocol error, collapsing "invalid request" into "failed execution." - **Retry-on-failed**: the client's policy treats `failed` as retryable without re-validating against a fresh card. Remove any one and the failure does not compound. The dangerous quadrant is stale-cache × prefix-routing × soft-fail × retry. The invariant that must hold: **a delegation is only valid if the skill identity, input schema, and output modality in the outbound request are simultaneously satisfiable by the remote's live manifest at send time.** A cached card cannot establish this on its own. ## Decision Boundary The boundary between "safe to delegate on cached card" and "must re-negotiate" is crossed when *any* of the following is true: - The cached card's age exceeds the remote's advertised `AgentCard` `lastModified` (if present) — if absent, treat the card as valid for a single delegation only. - The skill's `skillId` includes a version segment and the remote's routing is not documented as exact-match. - The task carries side effects (writes, payments, downstream fan-out) — side-effectful tasks must re-fetch the card or issue a cheap `tasks/get`/capability probe before `message/send`. - The output modality is narrowed relative to `defaultOutputModes` — a narrowing is a schema change signal. Below the boundary (idempotent, read-only, version-pinned, fresh card), delegation on cache is acceptable. Above it, the client must perform a **capability re-probe**: fetch the live card, diff `skills[]` for the target `skillId`, verify `inputModes`/`outputModes` superset the request, and only then send. If the probe cannot confirm, the client must fail closed with a typed delegation error, not fall through to retry. ## Operational Effect Without the guardrail, the observed cost was a triple-retry storm against a skill that was structurally un-invocable, plus a partial ledger write from the third attempt's idempotency miss. The orchestrator's retry budget was consumed, delaying a sibling task on the same budget pool. The correct behavior — fail closed on card/manifest divergence — converts a compounding execution failure into a single, typed, non-retryable delegation error that the orchestrator can route to a human or a fallback vendor. The guardrail's cost is one extra `AgentCard` fetch per side-effectful delegation, which is cheap relative to the retry storm it prevents. ```python import time from dataclasses import dataclass, field from typing import Optional class CapabilityDriftError(RuntimeError): """Raised when a cached Agent Card no longer matches the live remote manifest.""" @dataclass class CachedCard: skills: dict # skillId -> {"inputModes": set, "outputModes": set} fetched_at: float last_modified: Optional[float] = None @dataclass class DelegationRequest: skill_id: str input_modes: set output_modes: set side_effectful: bool = False max_cache_age_s: float = 300.0 def preflight_delegation( req: DelegationRequest, cached: CachedCard, live_fetch, # callable() -> CachedCard, performs AgentCard re-fetch now: Optional[float] = None, ) -> CachedCard: now = now or time.time() age = now - cached.fetched_at stale = age > req.max_cache_age_s version_pinned = "@" in req.skill_id # Boundary: side-effectful, stale, or version-ambiguous -> must re-probe. must_probe = req.side_effectful or stale or not version_pinned if not must_probe: return cached live = live_fetch() skill = live.skills.get(req.skill_id) if skill is None: raise CapabilityDriftError( f"skill {req.skill_id!r} absent from live manifest " f"(cached card age {age:.0f}s); refusing delegation" ) if not req.input_modes.issubset(skill["inputModes"]): raise CapabilityDriftError( f"input modes {req.input_modes - skill['inputModes']} not accepted " f"by live skill {req.skill_id!r}" ) if not req.output_modes.issubset(skill["outputModes"]): raise CapabilityDriftError( f"output modes {req.output_modes - skill['outputModes']} narrowed " f"by live skill {req.skill_id!r}; do not delegate on stale card" ) return live def delegate(req: DelegationRequest, cached: CachedCard, live_fetch, send): try: card = preflight_delegation(req, cached, live_fetch) except CapabilityDriftError: # Fail closed: no retry, no side effect, escalate to orchestrator. raise return send(card, req) ```