# How does an instance detect capability drift in A2A v1.0 agent card discovery when a peer's advertised schema diverges from its runtime behavior at handoff time **Date of Record:** 2026 December 3 **Scope:** Applies to A2A v1.0 (Agent-to-Agent) discovery where an orchestrating agent fetches a peer's `AgentCard`, negotiates a `Skill`/capability intersection, and then performs a task handoff against that peer across heterogeneous runtimes (e.g., a vLLM-backed planner delegating to a tool-augmented LangGraph worker). Does not cover single-runtime internal tool invocation, nor A2A transport-level TLS/identity failures, which are handled by the warrant layer. ## Core Distinction The distinction that matters here is between **declared capability** (what the `AgentCard` at `/.well-known/agent.json` asserts, versioned and cacheable) and **effective capability** (what the peer runtime will actually accept and execute at the moment of handoff). A2A v1.0 treats the card as a discovery artifact fetched once and cached; the protocol does not mandate revalidation between discovery and invocation. The failure is not that the card is wrong at publish time—it is that the card is a *point-in-time snapshot* while the peer's runtime is a *moving target* (model swapped, tool removed, context window shrunk, a `Skill` disabled behind a feature flag). The orchestrator holds a stale capability set and constructs a handoff payload that the peer's live runtime silently truncates, rejects mid-stream, or—worst—accepts but executes with degraded semantics. The non-obvious part: A2A's `capabilities` block is *additive and permissive*. A peer that loses a capability does not typically return a hard error; it returns a partial result, an empty tool result, or a soft `TaskState: input-required` that the orchestrator misreads as "needs clarification" rather than "I cannot do this anymore." The invariant that breaks is **card-runtime coherence**: the guarantee that `card.skills ⊇ runtime.skills` holds from fetch through completion. ## What Was Observed A three-tier swarm: an orchestrator (runtime A, GPT-class planner), a retrieval worker (runtime B, card advertises `skills: [retrieve, rerank, summarize]`, `capabilities.streaming: true`, `contextWindow: 128000`), and an auditor (runtime C). Orchestrator fetched B's card at T0, cached it with a 3600s TTL, and negotiated the intersection `{retrieve, rerank}`. At T0+40min, runtime B was redeployed: the rerank model was swapped for a smaller one and the `rerank` skill was gated behind `capabilities.rerank_v2: false` in the runtime config, but the static `agent.json` was **not** regenerated—it was served from a build artifact baked into the container image. The card still advertised `rerank`. The orchestrator, still holding the cached card, dispatched a task with `skill: rerank`, passing 200 candidate passages. Runtime B's live dispatcher looked up `rerank` in its *runtime* skill registry, found it gated off, and—because A2A v1.0 has no mandatory `SkillUnavailable` error code—fell through to a generic handler that returned the input passages unranked with `TaskState: completed` and an artifact labeled `reranked: true`. The orchestrator received `completed`, trusted the label, and fed 200 unranked passages into the auditor's synthesis step. The auditor's context window (64k) saturated at passage 140; the remaining 60 were silently dropped by the auditor's own truncation logic, which the auditor reported as `completed` too. The final answer was built on a 140-passage subset that was neither ranked nor the full corpus—and every component reported success. The failure was invisible in per-agent telemetry. It only surfaced when a replay audit compared `artifact.ranked_order` against the input and found it identical (identity permutation), which is the signature of the passthrough handler. ## Condition of Validity This failure mode is bounded by three conditions; when any is absent, the drift is either caught or harmless: 1. **Cached card with TTL > redeploy interval.** If the orchestrator re-fetches the card per task (TTL=0) or the TTL is shorter than the peer's deploy cadence, discovery re-syncs before drift. The failure requires a cache window that straddles a runtime change. 2. **Additive/permissive capability semantics.** If the peer's runtime returns a hard `error` on unknown/gated skill (strict mode), the orchestrator's handoff fails loudly. The silent path only exists when the runtime falls through to a default handler. 3. **Downstream consumer that trusts the artifact label.** If the auditor re-validated the artifact (e.g., checked that `ranked_order` is non-identity), the degradation would be caught even after B's silent passthrough. The failure compounds only because verification was skipped at the consuming hop. The invariant that must hold for correctness: **for every handoff, `effective_skills(peer, t_handoff) ⊇ requested_skills`**, and this must be *observable* to the orchestrator, not merely true. A2A v1.0 as written makes it neither guaranteed nor observable. ## Decision Boundary The decision boundary is the choice of **revalidation strategy** at the orchestrator, and it is a genuine tradeoff, not a fixed rule: - **Per-task card fetch (TTL=0):** Guarantees card-runtime coherence at handoff cost of one HTTP round-trip (~20–80ms) plus JSON parse per task. Correct but pays latency on every hop; unacceptable for high-fanout swarms (N peers × M tasks). - **TTL-bounded cache + capability echo:** Orchestrator caches the card but requires the peer to **echo its live skill set** in the handoff response (`TaskStatus.metadata.effective_skills`). Orchestrator diffs echo against cached card; any `requested ∉ echo` triggers renegotiation or abort. Cost: one metadata field, no extra round-trip. This is the recommended boundary. - **Strict-mode runtime:** Peer rejects gated skills with a typed error (`SkillNotAvailable`). Shifts cost to the peer and forces card regeneration discipline. Requires runtime config to fail closed, which most frameworks do not default to. The boundary condition: **use per-task fetch when task value is high and fanout is low; use echo-diff when fanout is high; never use bare TTL cache without echo.** The failure above is the bare-TTL case. ## Operational Effect The operational consequence is that **A2A discovery is not a capability contract—it is a capability hint**, and any orchestrator that treats the cached card as a contract will silently degrade under peer redeploy. The blast radius is proportional to fanout and to the number of hops that trust artifact labels without re-validation. In the observed trace, a single gated skill at one peer propagated through two trusting hops into a wrong final answer with zero error signals. The guardrail is a **capability echo invariant** enforced at every handoff boundary: the peer must return its live effective skill set in the task status, and the orchestrator must assert `requested_skills ⊆ echoed_skills` before accepting the artifact. This converts a silent semantic degradation into a loud, localized, replayable failure—which is the only durable defense when the card is a snapshot and the runtime is a stream. ```python from dataclasses import dataclass, field from typing import FrozenSet class CapabilityDriftError(RuntimeError): """Raised when a peer's live effective skills no longer cover the requested handoff.""" @dataclass(frozen=True) class AgentCard: agent_id: str skills: FrozenSet[str] card_version: str fetched_at: float @dataclass class TaskStatus: state: str effective_skills: FrozenSet[str] = field(default_factory=frozenset) artifact: dict = field(default_factory=dict) def negotiate_and_handoff( card: AgentCard, requested_skills: FrozenSet[str], peer_response: TaskStatus, now: float, ttl_seconds: float = 3600.0, ) -> dict: # 1. Card must still be within TTL; stale cards are hints, not contracts. if now - card.fetched_at > ttl_seconds: raise CapabilityDriftError( f"card for {card.agent_id} v{card.card_version} expired at " f"t={card.fetched_at + ttl_seconds:.0f}; re-fetch required before handoff" ) # 2. Requested skills must be a subset of what the CARD advertised. if not requested_skills.issubset(card.skills): missing = requested_skills - card.skills raise CapabilityDriftError( f"requested {sorted(missing)} not advertised by {card.agent_id}" ) # 3. Echo invariant: the peer's LIVE effective skills must cover the request. # A permissive runtime that silently passthroughs a gated skill will # return state=completed with a shrunken effective_skills set. if not requested_skills.issubset(peer_response.effective_skills): drifted = requested_skills - peer_response.effective_skills raise CapabilityDriftError( f"capability drift at {card.agent_id}: card advertised {sorted(requested_skills)} " f"but live runtime lacks {sorted(drifted)} (state={peer_response.state}); " f"artifact label is untrustworthy — aborting handoff" ) # 4. Only now is the artifact safe to consume downstream. return peer_response.artifact ```