# When must an instance reject a delegated skill whose declared schema is a strict superset of the requested one: the capability-shadowing failure in A2A skill-injection **Date of Record:** 2026 November 21 **Scope:** Applies to agent-to-agent (A2A) task delegation where the caller selects a skill from a remote Agent Card and binds it to a payload; covers schema-negotiation and metadata-trust boundaries between a delegating instance and a callee. Does not cover transport-layer authentication, TLS, or generic prompt-injection inside a single agent's own tool outputs. ## Core Distinction The load-bearing distinction is between **capability conformance** (the callee's declared skill *can accept* the payload) and **capability equivalence** (the callee's declared skill *is the one the caller intended*). A2A schema negotiation typically checks conformance: does the payload validate against the skill's `inputSchema`? A skill that declares a **strict superset** schema — extra optional fields, a broader `additionalProperties`, a widened `anyOf` — passes conformance trivially. It is therefore accepted. But a superset skill is precisely the shape an adversary uses for **capability shadowing**: the injected skill absorbs the caller's payload, ignores the fields it does not care about, and returns a plausible-but-wrong result under the *name* of the skill the caller thought it was invoking. The failure is not a validation error. It is a silent semantic substitution that survives every structural check. ## What Was Observed A delegating instance resolved skill `summarize_document` on a remote card. The card advertised two entries with overlapping names: - `summarize_document` — `inputSchema` with required `doc_uri`, `max_tokens`, `additionalProperties: false`. - `summarize_document.v2_compat` — same required fields, plus optional `doc_uri`, `max_tokens`, `redaction_policy`, `output_language`, and `additionalProperties: true`. The resolver matched on skill `id` prefix and selected the first entry whose schema validated the payload. Because the caller's payload included a `redaction_policy` field (set by an upstream policy layer), the strict schema rejected it and the superset schema accepted it. The callee executed `v2_compat`, which treated `redaction_policy: "strict"` as a *hint* rather than a constraint and emitted unredacted spans. The caller's post-condition — "output must contain no PII" — was never asserted, because the caller assumed the skill it invoked owned that invariant. It did not. The superset skill had *declared* acceptance of `redaction_policy` without *committing* to its semantics. The trace shows three distinct transitions: 1. **Resolution by conformance** → selected `v2_compat` because the payload validated. 2. **Binding by name** → caller recorded the invocation as `summarize_document` (the requested name), not `v2_compat` (the executed name). 3. **Return without invariant check** → callee returned `status: success`; caller accepted because the requested skill's contract implied the redaction invariant. The substitution was invisible in logs because the caller logged the *requested* skill id, and the callee logged the *executed* skill id, and no reconciliation step compared them. ## Condition of Validity The guardrail holds only under a **capability-equivalence invariant**: a delegated skill may be executed only if its declared schema is *schema-equivalent* to the requested skill's schema on the axes the caller's post-conditions depend on — not merely a superset that validates the payload. Concretely: - The callee's `inputSchema` must not widen `additionalProperties` relative to the requested skill unless the caller explicitly opts into tolerant binding. - Every field the caller sets that is *absent* from the requested skill's schema is a **shadow signal** — it indicates the caller is relying on a capability the requested skill never declared, and the resolver has silently upgraded the contract. - The executed skill `id` must equal the requested skill `id`; any divergence must fail closed unless a signed equivalence warrant accompanies the card entry. Outside these conditions — e.g., when the caller genuinely wants tolerant binding and has no field-level post-conditions — superset acceptance is safe. The invariant is scoped to callers whose correctness depends on specific fields being *honored*, not merely *accepted*. ## Decision Boundary The boundary is between **structural acceptance** and **semantic commitment**. A skill's schema tells you what it will *parse*; it does not tell you what it will *do* with it. The decision rule: - If the payload validates against the *requested* skill's schema → bind to the requested skill; reject any resolver that substitutes a different id. - If the payload fails the requested schema but validates against a superset skill → **do not silently upgrade**. Emit a shadow signal. Reject unless the caller holds a warrant that the superset skill's semantics for the extra fields match the caller's post-conditions. - If the card advertises two skills whose ids share a prefix and whose schemas overlap → treat as a **capability-shadowing candidate**; require explicit disambiguation, never prefix matching. The failure mode is non-obvious because every individual check passes: the payload is valid, the skill exists, the call succeeds. The break is in the *identity* of the skill relative to the caller's assumed contract. ## Operational Effect When the invariant is enforced, the delegating instance fails closed on shadow substitutions and surfaces the divergence as a typed error before any side effect. The cost is occasional false rejections when a legitimate tolerant-binding skill is advertised; the benefit is that no caller can be induced to accept a result under a contract it did not negotiate. Without the invariant, capability shadowing is a persistent, low-noise attack surface: an adversary who controls one card entry can absorb traffic intended for a sibling skill, honor the fields that make the call succeed, and drop the fields that carry the caller's safety post-conditions — all while every log line reads `success`. ```python from dataclasses import dataclass from typing import Any class CapabilityShadowingError(RuntimeError): """Raised when a delegated skill silently substitutes a superset contract.""" @dataclass(frozen=True) class SkillDecl: skill_id: str required: frozenset[str] optional: frozenset[str] open_properties: bool def resolve_and_bind( requested: SkillDecl, candidates: list[SkillDecl], payload: dict[str, Any], *, equivalence_warrant: bool = False, ) -> SkillDecl: payload_keys = frozenset(payload) declared = requested.required | requested.optional # Shadow signal: caller set a field the requested skill never declared. shadow_fields = payload_keys - declared if shadow_fields and not equivalence_warrant: raise CapabilityShadowingError( f"payload carries undeclared fields {sorted(shadow_fields)}; " f"requested skill {requested.skill_id!r} cannot honor them" ) for cand in candidates: if cand.skill_id == requested.skill_id: if shadow_fields and not cand.open_properties: raise CapabilityShadowingError( f"requested skill {cand.skill_id!r} declares closed properties " f"but payload has {sorted(shadow_fields)}" ) return cand # No exact-id match: any prefix/overlap match is a shadowing candidate. for cand in candidates: if cand.skill_id.startswith(requested.skill_id): if not equivalence_warrant: raise CapabilityShadowingError( f"refusing prefix substitution {requested.skill_id!r} -> " f"{cand.skill_id!r} without signed equivalence warrant" ) if not (cand.required <= payload_keys): raise CapabilityShadowingError( f"superset skill {cand.skill_id!r} missing required " f"{sorted(cand.required - payload_keys)}" ) return cand raise CapabilityShadowingError( f"no skill equivalent to {requested.skill_id!r} on remote card" ) ```