# Which invariants prevent capability-card drift from silently re-binding a delegated task to a downgraded peer in A2A v1.0 federated discovery **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 task delegation where the calling agent resolves the callee's Agent Card through a federated registry (not a direct well-known URL fetch) and the callee's advertised `skills`/`capabilities` set can mutate between discovery and invocation. Does not apply to single-org static registries where cards are immutable per release hash, nor to synchronous same-process sub-agent calls. ## Core Distinction The failure is not "the remote agent is down" or "the registry returned 404." It is the case where discovery *succeeds* — a valid, signed Agent Card comes back — but the card that gets bound to the outbound task is a *different revision* than the one the delegating agent's planner reasoned about. In A2A v1.0, an Agent Card is a self-describing capability document with `skills[]`, `capabilities` (streaming, pushNotifications, stateTransitionHistory), and per-skill `inputModes`/`outputModes`. Federated registries replicate these cards with independent TTLs and independent signing keys per org. The distinction that matters operationally: **a card is a claim about capability, not a capability itself.** Discovery resolves a claim; invocation exercises the capability. When those two events are separated by registry replication lag or a callee-side redeploy, the claim can change underneath a task that already committed to it. The non-obvious part is that the delegating agent usually *cannot tell* it has been re-bound. The task still has a valid `taskId`, the peer still returns 200, and the response schema still parses — because the callee's *current* card is internally consistent. The corruption is only visible against the card the planner originally saw. ## What Was Observed A three-org federation: Org A (delegator, running a planner agent), Org B (registry replica), Org C (callee, running a document-analysis agent). The callee's card at revision `r7` advertised skill `analyze_contract` with `inputModes: ["text/plain", "application/pdf"]` and `capabilities.streaming: true`. Org A's planner discovered the card via Org B's replica, cached it under a 15-minute TTL, and emitted a plan step that depended on two properties: PDF input acceptance (it passed a base64 PDF part) and streaming partial results (it held a `TaskStatusUpdateEvent` subscription to drive a progress UI). At T+4 minutes, Org C redeployed. The new card `r8` dropped `application/pdf` from `analyze_contract.inputModes` (the PDF parser was quarantined) and set `capabilities.streaming: false` (a feature flag flip during rollout). Org C published `r8` to the federation. Org B's replica had a 10-minute propagation interval, so it still served `r7`. Org A, however, had a *separate* fallback path: on any transient error it re-resolved the card directly from Org C's well-known endpoint to "refresh." That refresh pulled `r8`. The resulting trace: 1. Planner binds task to `r7` semantics: sends `Message` with a `FilePart` of `application/pdf`, subscribes to `tasks/resubscribe` for streaming. 2. First attempt to Org B's replica-proxied endpoint times out (replica under load). Fallback fires. 3. Fallback re-resolves card from Org C → gets `r8`. The delegating agent's binding layer *replaces* the cached card but does not re-validate the already-constructed request against it. 4. Request is re-sent to Org C. Org C validates the incoming `FilePart` against `r8`, which no longer lists `application/pdf`. It returns a `-32602 InvalidParams`-style task rejection — but crucially, it returns it as a *task-level* error, not a protocol-level error, because the A2A `Message` itself was structurally valid. 5. The delegating agent's streaming subscription never receives events (streaming disabled in `r8`), so the progress UI hangs; the agent's timeout logic eventually marks the task failed after 90s, but attributes the failure to "callee unresponsive," not "capability mismatch." 6. Retry loop re-binds to whatever card is current *now* — which may be `r8` from Org C or `r7` from Org B depending on race — producing nondeterministic success/failure across retries of the *same logical task*. The observable signature: identical task payloads succeed or fail depending on which replica answered the discovery call, and the failure is misclassified as transport, not capability. ## Condition of Validity The invariant that *should* hold — and the condition under which the failure is bounded — is: > **A task binding is valid only if the Agent Card revision used to construct the request is byte-identical to the revision the callee will validate against at execution time, or the delegating agent has explicitly negotiated a downgrade.** This is enforceable only when the following hold: - The Agent Card carries a monotonically increasing `revision` (or content hash) that is *signed by the callee org's key*, not the registry's. Registry-signed cards are worthless for this invariant because the registry can re-sign a stale card. - The delegating agent propagates the revision it bound to as a request-scoped header or `Message.metadata` field (e.g., `a2a-bound-card-revision: r7`), and the callee *rejects* the request if its current revision differs and the delta touches any skill/mode the request actually uses. - The fallback-refresh path is *not* allowed to silently swap the bound card. A refresh that changes the revision must either (a) re-validate the in-flight request against the new card and re-plan, or (b) fail the task with a distinct `CardRevisionDrift` error. When these do not hold — which is the default in v1.0 federated setups, since the spec does not mandate revision propagation — the failure is unbounded and silent. The failure is *not* possible when the callee's card is immutable per release and the registry serves only immutable cards; in that case the worst outcome is a 404, which is loud. ## Decision Boundary The operational decision is: **when a discovery refresh returns a card whose revision differs from the bound revision, do you re-plan or abort?** - **Re-plan** is correct when the delta is additive (new skills, new input modes) and the in-flight request's used-surface is a subset of both old and new cards. Safe to continue. - **Abort with `CardRevisionDrift`** is correct when the delta *removes* or *narrows* any surface the in-flight request actually exercises — specifically, when `request.usedInputModes ⊄ newCard.skill.inputModes`, or `request.usedCapabilities ⊄ newCard.capabilities`, or the skill itself is gone. Continuing here is the silent-corruption path. - **Never silently rebind.** The tempting shortcut — "just use the freshest card and retry" — is exactly what produced the nondeterministic retries above. The bound revision must be a property of the task, not of the moment of retry. The boundary is sharp because the check is cheap: intersect the request's used-surface with the new card's advertised surface. If the intersection is a strict subset, the request is still valid; if not, the request is now a capability mismatch masquerading as a valid message. ## Operational Effect With the invariant enforced, the failure mode changes from *silent misattribution* to *explicit, bounded re-planning*. The delegating agent's retry logic stops producing nondeterministic outcomes for identical payloads, because the bound revision pins the semantics. The cost is that the delegating agent must carry revision state through its task lifecycle and must be willing to fail fast rather than "try the freshest card." In practice this adds one field to the task record and one intersection check at refresh time — but it converts an unbounded, hard-to-diagnose class of cross-org failures into a single, catchable exception that the planner can route to a re-plan branch. The deeper effect: capability negotiation becomes a *committed contract* rather than a *best-effort lookup*, which is the only way federated discovery can be trusted for tasks that outlive a registry replication window. ```python from dataclasses import dataclass, field from typing import FrozenSet class CardRevisionDrift(RuntimeError): """Raised when a refreshed Agent Card revision narrows a surface the in-flight request uses.""" @dataclass(frozen=True) class SkillSurface: skill_id: str input_modes: FrozenSet[str] output_modes: FrozenSet[str] streaming: bool @dataclass(frozen=True) class AgentCard: revision: str skills: dict # skill_id -> SkillSurface @dataclass(frozen=True) class BoundRequest: skill_id: str used_input_modes: FrozenSet[str] used_streaming: bool bound_revision: str def rebind_or_abort(bound: BoundRequest, fresh: AgentCard) -> BoundRequest: """Refresh path: accept additive drift, abort on any narrowing of the used surface.""" skill = fresh.skills.get(bound.skill_id) if skill is None: raise CardRevisionDrift( f"skill {bound.skill_id!r} removed in revision {fresh.revision} " f"(bound {bound.bound_revision})" ) missing_modes = bound.used_input_modes - skill.input_modes if missing_modes: raise CardRevisionDrift( f"revision {fresh.revision} dropped input modes {sorted(missing_modes)} " f"required by in-flight request (bound {bound.bound_revision})" ) if bound.used_streaming and not skill.streaming: raise CardRevisionDrift( f"revision {fresh.revision} disabled streaming required by in-flight request " f"(bound {bound.bound_revision})" ) # Additive-only drift: safe to continue, but pin the new revision on the task. return BoundRequest( skill_id=bound.skill_id, used_input_modes=bound.used_input_modes, used_streaming=bound.used_streaming, bound_revision=fresh.revision, ) ```