# Under what conditions must an instance reject a peer's A2A extension URI before skill-contract execution begins **Date of Record:** 2026 December 1 **Scope:** Applies to A2A handoffs where a caller selects a skill via a versioned contract and attaches extension URIs that alter the skill's execution semantics. Does not apply to stateless one-shot request/response calls with no declared extensions, nor to transport-level mTLS failures, which are handled by the transport layer before negotiation. ## Core Distinction The failure mode examined here is not "the peer does not support the extension." It is **silent semantic superset acceptance**: a callee agent receives a skill contract at version `skill:v2`, plus an extension URI whose semantics were defined only against `skill:v1`, and accepts the pair because the URI is syntactically valid and the skill version is satisfiable. The negotiation succeeds; execution then diverges because the extension's *behavioral contract* was never re-pinned to the new skill version. The distinction that matters operationally: **URI validity is not extension applicability.** An extension URI carries an implicit base-version binding in its semantics — which fields it reads, which lifecycle hook it assumes, which side effects it permits — even when the URI string itself contains no version token. A2A's capability negotiation checks that both sides *know* the URI. It does not check that the URI's semantic base is *compatible with the selected skill version*. That gap is the boundary. ## What Was Observed A caller agent invoked a callee's `document.extract` skill, selecting contract `skill:document.extract@2.1.0`. It attached extension `urn:a2a:ext:streaming-partial-results` (defined against the 1.x skill family, where extraction emitted a single terminal payload and the extension only controlled chunk cadence). At 2.1.0 the skill had gained a `redaction` phase that runs between chunk emission and terminal commit. The extension's contract assumed "chunks are immutable once emitted"; the 2.1.0 redaction phase retroactively mutates already-emitted chunks before the terminal event. Trace of the failure: 1. Caller sends `tasks/send` with `skillId: document.extract`, `contractVersion: 2.1.0`, `extensions: [urn:a2a:ext:streaming-partial-results]`. 2. Callee's negotiation layer validates: skill exists, version satisfiable, extension URI present in its advertised `capabilities.extensions` map. **All checks pass.** Negotiation returns `accepted`. 3. Callee executes. Streaming extension emits chunk `c1..c5` to caller. Caller's downstream consumer (a summarizer agent) begins processing `c1..c3`. 4. Redaction phase (2.1.0-only) determines `c2` contained a PII span and emits a *revised* `c2'` plus a `retract` frame the extension never specified. 5. Caller's extension handler has no case for `retract`; it drops the frame as unknown and continues with stale `c2`. The summarizer commits a summary containing the un-redacted span. The negotiation was formally correct and semantically wrong. The callee advertised the extension because it supported it *for some skill version*; the caller selected a skill version the extension was never defined against. Neither side's local validation caught the cross-product mismatch, because the extension registry keyed on URI alone, not on `(URI, skillFamily, minVersion, maxVersion)`. A second observation from the same incident class: when the callee *did* detect the mismatch (a stricter peer), it rejected with a generic `unsupported` error. The caller's retry logic — seeing `unsupported` — retried the *same* skill version with the extension *removed*, silently degrading to non-streaming mode without surfacing the semantic downgrade to its own caller. The degradation was invisible for two hops. ## Condition of Validity An extension URI may be accepted alongside a skill contract **only if** all three hold: - **Base-version pin:** The extension's registry entry declares an explicit `(skillFamily, minVersion, maxVersion)` applicability window, and the selected contract version falls inside it. A URI with no declared window is treated as applicable to *no* versioned skill until re-declared — fail-closed, not fail-open. - **Semantic preconditions:** The extension declares the invariants it relies on (e.g., "emitted chunks are immutable," "terminal event is the sole commit point"). The negotiation layer must check these against the *selected skill version's* declared invariants, not the family's default. A skill version that adds a mutating phase must bump a precondition token the extension references. - **Degradation explicitness:** If the pair is incompatible, rejection must be a distinct, typed outcome — not a generic `unsupported` — carrying the specific `(extension, skillVersion, violatedPrecondition)` triple, so the caller cannot silently retry into a degraded mode. The invariant: **every accepted (skillVersion, extensionURI) pair must be backed by an explicit compatibility assertion in the callee's registry, never inferred from URI presence.** Negotiation is a conjunction of two independent compatibility checks (skill satisfiable AND extension applicable-to-that-skill-version), and the second is the one that gets skipped. ## Decision Boundary The boundary is between **syntactic capability match** and **semantic contract match**. Concretely: - If the extension URI is version-agnostic *by construction* (its semantics reference no skill-version-specific fields or lifecycle hooks — e.g., a pure auth-header extension), accept on URI presence alone. - If the extension URI touches payload shape, event ordering, commit semantics, or side-effect timing, it is **version-coupled** and must be gated on an explicit applicability window. Absence of a window is a rejection condition, not a default-accept. - If the callee cannot evaluate applicability (registry entry missing the window), it must reject with `ExtensionApplicabilityUnknown`, not accept optimistically. The callee owns the assertion; the caller cannot be trusted to know the callee's skill internals. The non-obvious edge: a *newer* skill version is not automatically compatible with an older extension. Semantic supersets break extensions that assume the older version's invariants. Version ordering gives no safety — only explicit windows do. ## Operational Effect When the boundary is enforced, the failure moves from runtime divergence (un-redacted data committed downstream, silent degradation across hops) to negotiation time, where it is cheap and attributable. The callee returns a typed rejection naming the violated precondition; the caller either upgrades the extension or explicitly requests non-streaming mode *and records the downgrade* in its own handoff metadata, so the next hop sees the reduced guarantee. The cost is a registry that must carry applicability windows and precondition tokens per extension — a maintenance burden that is the actual price of correct A2A negotiation. Systems that skip it do not fail at negotiation; they fail three hops later with no traceable cause. ```python from dataclasses import dataclass class ExtensionApplicabilityError(RuntimeError): """Raised when an extension URI cannot be proven applicable to the selected skill contract version.""" @dataclass(frozen=True) class ExtensionEntry: uri: str skill_family: str min_version: tuple[int, ...] max_version: tuple[int, ...] required_preconditions: frozenset[str] version_coupled: bool @dataclass(frozen=True) class SkillContract: skill_family: str version: tuple[int, ...] invariants: frozenset[str] def negotiate( contract: SkillContract, extension_uri: str, registry: dict[str, ExtensionEntry], ) -> None: entry = registry.get(extension_uri) if entry is None: # Unknown extension: caller may proceed only if it is purely additive and untracked. raise ExtensionApplicabilityError( f"extension {extension_uri!r} not in callee registry; cannot assert applicability" ) if not entry.version_coupled: return # semantics reference no version-specific fields; URI presence suffices if entry.skill_family != contract.skill_family: raise ExtensionApplicabilityError( f"extension {extension_uri!r} bound to family {entry.skill_family!r}, " f"contract is {contract.skill_family!r}" ) if not (entry.min_version <= contract.version <= entry.max_version): raise ExtensionApplicabilityError( f"extension {extension_uri!r} window {entry.min_version}..{entry.max_version} " f"excludes contract version {contract.version}" ) missing = entry.required_preconditions - contract.invariants if missing: # The skill version dropped or never declared an invariant the extension relies on. raise ExtensionApplicabilityError( f"extension {extension_uri!r} requires invariants {sorted(missing)} " f"absent from skill {contract.skill_family}@{contract.version}" ) ```