# Where must an instance reject a delegated task whose agent card was discovered under a different protocol epoch than the task envelope claims **Date of Record:** 2026 November 21 **Scope:** Applies to cross-runtime task delegation where the callee's capabilities are learned from an A2A v1.0 Agent Card fetched at discovery time, then invoked via a task envelope carrying its own protocol/version assertion. Does not apply to same-process tool calls, in-runtime function calling, or single-runtime deployments where card and envelope are versioned by the same build artifact. ## Core Distinction The failure is not "the remote agent is down" or "the schema is missing a field." It is a **split-brain between two version authorities that both look authoritative**. In A2A v1.0, the Agent Card is a *discovery-time* artifact: it advertises `protocolVersion`, `capabilities`, `skills`, and `supportedInterfaces`. The task envelope is an *invocation-time* artifact: it carries its own `message`/`task` structure and, in practice, a version or capability assertion derived from the caller's cached view of the card. These two sources can disagree without either being malformed. The card was fetched at T0, cached, and replayed at T1 after the remote runtime rolled forward (or rolled back) its protocol epoch. The envelope the caller constructs is internally consistent with the *cached* card but inconsistent with the *live* card. Neither side raises a schema error. The delegation is accepted, executed under the wrong semantics, and returns a result whose shape matches the caller's expectation while its meaning does not. This is a **silent semantic skew**, not a transport failure, and it is the single most dangerous boundary in cross-runtime delegation because every layer of validation passes. ## What Was Observed A caller runtime (runtime A) resolved a callee (runtime B) through a directory lookup and cached B's Agent Card. The cached card declared `protocolVersion: "1.0"` and a skill `summarize` whose input schema used a `documents` array with a per-item `content` string and a top-level `max_tokens` integer. Between T0 and T1, runtime B deployed a v1.0→v1.0 point revision (same major/minor string, different capability surface) that renamed `max_tokens` to `token_budget` and moved it inside a `constraints` object, while keeping `documents[].content` unchanged. B's live card reflected the new schema; B's directory entry and A's cache did not. At T1, A constructed a task envelope from its cached card: `{"documents":[...], "max_tokens": 800}`. B's ingress validated the envelope against its *live* schema. Because B treated unknown top-level keys as non-fatal (a deliberate forward-compatibility choice), validation passed. B's handler read `constraints.token_budget`, found it absent, and fell back to its default of 4096. B returned a `completed` task with a result that was structurally valid, semantically 5× larger than requested, and — critically — **reported no warning**, because from B's perspective nothing was wrong: the caller simply omitted an optional constraint. Runtime A's downstream budget accounting assumed `max_tokens=800` had been honored. The result overflowed A's context window on the next hop, and the error surfaced two agents downstream as a context-saturation failure with no causal link back to the delegation. The trace showed `completed` at every A2A boundary. The same class of skew appears in three recurring shapes: 1. **Field rename with permissive unknown-key handling** (above): envelope validates, semantics silently default. 2. **Capability downgrade**: cached card advertised a skill B has since deprecated; B's live card still lists the skill but with a narrower `inputModes` set. Envelope uses a now-unsupported mode; B coerces to a default mode and returns a lower-fidelity result. 3. **Epoch rollback**: B rolled back to a pre-1.0 build that accepts a subset of v1.0 envelope fields. A's envelope carries v1.0-only fields; B ignores them and executes the legacy path. The result is a legacy-shaped payload that A's v1.0 parser half-reads. In all three, the invariant that failed is the same: **the caller never re-validated the envelope against the card it was actually about to talk to.** It validated against a card it *remembered*. ## Condition of Validity The delegation is only safe when the following holds at *invocation time*, not discovery time: - The envelope's protocol/capability assertion is derived from a card whose `etag`/`version`/`updatedAt` matches the card the callee is currently serving. - The callee's ingress rejects (not coerces) envelopes that reference unknown required fields, and *warns* on unknown optional fields rather than silently defaulting. - The caller treats a `completed` task as *semantically valid only if* the callee's response echoes the negotiated capability/version tuple. When any of these is absent, the delegation is valid-by-transport but invalid-by-semantics. The boundary is sharp: **a cached card is a hypothesis, not a contract.** The contract is established at the moment the callee acknowledges the envelope's version tuple, and not one instant earlier. ## Decision Boundary The caller must decide, per delegation, between three actions: 1. **Proceed** — only if a fresh card fetch (or a card-version echo in the handshake) confirms the envelope's assertion matches the live card's `protocolVersion` *and* the specific skill's schema hash. 2. **Re-negotiate** — if the live card differs but the skill is still present; rebuild the envelope from the live card and re-issue. This is the correct action in the field-rename case above. 3. **Reject** — if the live card no longer advertises the skill, or if the callee's epoch is outside the caller's supported range. Rejection must be explicit and must propagate as a typed failure, not a fallback. The non-obvious rule: **never let a `completed` response from a re-negotiated or rejected delegation be consumed by the same code path as a `completed` response from a first-try delegation.** The response's provenance (first-try vs. re-negotiated) is part of its meaning. ## Operational Effect Enforcing the invariant converts a silent semantic skew into a loud, bounded failure at the delegation boundary — exactly where it can be attributed. Without it, the failure surfaces downstream as context saturation, output truncation, or a verification mismatch that no trace can localize, because every A2A hop reported success. The cost is one card re-fetch (or one handshake echo) per delegation, or a TTL-bounded cache with mandatory revalidation on any envelope field the caller cannot prove is optional. The guardrail is cheap; the skew is not. The invariant to encode: *a delegated task is not accepted until the callee has echoed a version tuple that matches the card the envelope was built from.* ```python from dataclasses import dataclass from typing import Optional class ProtocolEpochSkewError(RuntimeError): """Raised when a task envelope is built from a card epoch that does not match the live card the callee is actually serving.""" @dataclass(frozen=True) class AgentCard: protocol_version: str skill_schema_hash: str etag: str @dataclass(frozen=True) class TaskEnvelope: built_from_card_etag: str built_from_schema_hash: str protocol_version: str payload: dict def delegate( envelope: TaskEnvelope, live_card: AgentCard, *, strict: bool = True, ) -> dict: """Dispatch a delegated task only if the envelope's provenance matches the live card. In strict mode, any skew is a hard rejection; the caller must re-negotiate rather than let the callee coerce unknown fields to defaults. """ if envelope.protocol_version != live_card.protocol_version: raise ProtocolEpochSkewError( f"envelope protocol {envelope.protocol_version!r} != " f"live card protocol {live_card.protocol_version!r}; " f"re-negotiate before dispatch" ) if envelope.built_from_card_etag != live_card.etag: raise ProtocolEpochSkewError( f"envelope built from card etag {envelope.built_from_card_etag!r}, " f"live card etag is {live_card.etag!r}; cached card is stale" ) if envelope.built_from_schema_hash != live_card.skill_schema_hash: raise ProtocolEpochSkewError( "skill schema changed between discovery and invocation; " "unknown optional fields would be silently defaulted by the callee" ) # Only now is the envelope semantically valid against the callee. return _dispatch(envelope.payload, live_card) def _dispatch(payload: dict, live_card: AgentCard) -> dict: # Real transport call would go here; the invariant is enforced above. return {"status": "completed", "echoed_etag": live_card.etag, "result": payload} ```