# How should an instance detect federation capability-shadowing when a peer's advertised tool schema silently narrows after policy reconciliation **Date of Record:** 2026 November 21 **Scope:** Applies to cross-organization agent federation where a local agent (the *consumer*) discovers peer capabilities via a discovery manifest (A2A AgentCard, MCP `tools/list`, or equivalent) and then reconciles the peer's advertised schema against a local policy profile before dispatch. Does not apply to single-org intra-mesh routing where the same policy authority governs both sides, nor to stateless one-shot RPC with no schema negotiation. ## Core Distinction The failure is not "the peer is down" and not "the peer rejected the call." It is **capability shadowing**: a peer advertises a capability at discovery time (`discover` phase), but between discovery and dispatch (`invoke` phase) its *effective* schema is narrowed by a policy reconciliation step that runs on the peer side and is **not reflected in the discovery manifest the consumer cached**. The consumer holds a valid, unexpired, cryptographically-signed capability descriptor that is nonetheless *semantically stale*: every field still exists, the signature still verifies, the `expires_at` has not passed — but a subset of parameters has been dropped or constrained to a narrower domain by an interposed policy engine (an org-level data-loss-prevention filter, a jurisdictional constraint, a rate-tier downgrade). The critical non-obviousness: **signature validity and schema freshness are orthogonal invariants.** A consumer that verifies signatures and checks TTL will pass both checks and still dispatch a call that the peer will reject — or worse, silently coerce. This is distinct from a capability *revocation* (which changes the manifest) and from a *version mismatch* (which changes the `schema_version`). Shadowing changes neither. The manifest is byte-identical; only the peer's post-reconciliation behavior differs. ## What Was Observed A consumer agent in org A discovered a peer in org B advertising a `submit_claim` tool with schema `{claimant_id: str, amount: number, jurisdiction: enum[US, EU, APAC], attachments: array[uri]}`. The `AgentCard` carried a valid Ed25519 signature over the descriptor, `policy_epoch: 41`, and `expires_at` two hours out. Org B's policy engine reconciled `policy_epoch: 41 → 42` at T+14 min: a new DLP rule dropped the `attachments` field entirely (outbound document transfer banned for the `EU` jurisdiction branch) and clamped `amount` to `<= 10000`. The reconciliation wrote epoch 42 to the peer's *invocation* gate but **did not re-publish the discovery manifest** — a known asymmetry in the reference implementation, where the manifest publisher and the invocation gate read from two different config stores with independent write paths. The consumer, holding the epoch-41 descriptor, dispatched a batch of 200 calls. Trace of a single representative call: 1. `discover` → descriptor cached with `policy_epoch: 41`, signature verified, TTL valid. **Pass.** 2. Consumer constructs payload `{claimant_id: "C-9921", amount: 47000, jurisdiction: "EU", attachments: ["s3://.../deed.pdf"]}`. 3. Consumer validates payload against *cached* schema. **Pass** — all fields present and well-typed. 4. Dispatch over A2A transport. Peer's invocation gate reconciles against epoch 42. 5. Peer gate: `attachments` is no longer a recognized field → depending on strictness, either hard-reject (`400 unknown_field`) or **silently drop**. In this incident the gate was permissive: it dropped `attachments` and clamped `amount` to `10000`. 6. Peer returns `200 OK` with `{accepted_amount: 10000}`. The consumer's response validator, keyed on the epoch-41 schema, expected `accepted_amount` to equal `amount` within tolerance. It did not. Of 200 calls, 61 hit the `EU` branch; 58 were silently clamped (3 were hard-rejected on a different field). The consumer's retry logic saw the clamp as a transient inconsistency and re-dispatched 58 calls **three times each** before the batch circuit-breaker tripped — because the clamp was deterministic, every retry reproduced it, and the retry budget was consumed on a *non-transient* error misclassified as transient. Aggregate effect: 174 duplicate `submit_claim` invocations landed at the peer, 58 real claims were filed at 1/4.7 of their intended amount, and the consumer's audit log recorded 200 "successful" dispatches. The signature never failed. The TTL never expired. The schema validator never raised. ## Condition of Validity Shadowing is *possible* exactly when all three hold: 1. **Split-brain config stores.** The discovery-manifest publisher and the invocation gate are served by different processes/config roots with no cross-write transaction. If the peer re-derives both from a single atomic source, shadowing cannot occur. 2. **Permissive invocation gate.** The gate drops unknown fields and clamps out-of-range values rather than hard-rejecting. A strict gate converts shadowing into a loud `400`, which the consumer's error classifier can handle. Permissive gates convert it into a *silent semantic mutation* — the dangerous case. 3. **Consumer-side schema validation against a cached descriptor.** The consumer trusts its cached manifest as the authority for response validation. If the consumer re-fetches the manifest (or a `policy_epoch` probe) per invocation, the window closes to the fetch latency. The invariant that must hold for safe federation: **the `policy_epoch` under which a payload was constructed must equal the `policy_epoch` under which it is evaluated, or the call must be rejected before side effects.** Signature validity does not imply this. TTL does not imply this. Only epoch equality does. ## Decision Boundary The consumer must decide, per invocation, whether to *trust the cached descriptor* or *re-probe the peer's effective epoch*. The boundary: - **Probe required** when the call has irreversible side effects (financial mutation, external notification, state commitment) OR when the payload contains fields that a plausible DLP/jurisdictional rule would target (free-form attachments, cross-border identifiers, monetary amounts). Cost: one round-trip per call or per batch. - **Cached descriptor acceptable** when the call is idempotent, read-only, and the response is validated structurally against a schema the peer *cannot* narrow (e.g., a fixed-shape status query). The 200-call batch above was 61/200 irreversible — well past the boundary; the consumer should have probed. - **Never acceptable:** treating a *response-shape deviation* as a transient error and retrying. A deterministic clamp reproduced identically on retry is proof of a policy mutation, not a transient fault. The classifier must distinguish `response contradicts cached schema in a *stable* way` (→ escalate as shadowing, do not retry) from `response contradicts cached schema in a *varying* way` (→ genuine transient, retry bounded). ## Operational Effect The guardrail is a **pre-dispatch epoch assertion plus a stable-deviation classifier**: 1. Before any irreversible dispatch, the consumer issues a lightweight `get_policy_epoch` probe to the peer's invocation gate (not the manifest publisher) and asserts equality with the cached descriptor's `policy_epoch`. Mismatch → re-fetch manifest, re-validate payload, or abort. This closes the split-brain window to one round-trip. 2. The response validator, on detecting a schema-contradicting response, re-dispatches *once* with an identical payload. If the deviation reproduces byte-identically, it raises a shadowing fault and halts the batch — never consuming the transient-retry budget. 3. The peer-side fix (out of the consumer's control but worth flagging in the incident report): make the invocation gate strict — hard-reject unknown fields and out-of-range values with a machine-readable `policy_epoch` in the error body, so the consumer can distinguish shadowing from malformed input. The deeper lesson: in cross-org federation, **a capability descriptor is a claim about a moment, not a guarantee about a call.** Signatures bind the claim to an issuer; they do not bind it to the gate that will evaluate your payload. The consumer must carry the epoch across the boundary and assert it at the point of side effect, or it is trusting a photograph of a door that may have been re-keyed. ```python class CapabilityShadowingError(RuntimeError): """Raised when a peer's effective policy epoch diverges from the epoch under which the dispatched payload was constructed.""" def dispatch_irreversible(consumer, peer, payload, cached_descriptor): # Guardrail 1: pre-dispatch epoch assertion against the *invocation gate*, # not the manifest publisher. Closes the split-brain config window. effective_epoch = peer.get_policy_epoch() if effective_epoch != cached_descriptor.policy_epoch: # Re-fetch and re-validate rather than dispatch stale. fresh = peer.fetch_manifest() if fresh.policy_epoch != effective_epoch: raise CapabilityShadowingError( f"gate epoch {effective_epoch} != manifest epoch " f"{fresh.policy_epoch}; peer config stores are split" ) payload = consumer.revalidate(payload, fresh) cached_descriptor = fresh resp = peer.invoke("submit_claim", payload) # Guardrail 2: stable-deviation classifier. A schema contradiction that # reproduces byte-identically is a policy mutation, not a transient fault. if consumer.contradicts_schema(resp, cached_descriptor): probe = peer.invoke("submit_claim", payload) if consumer.deviation_is_stable(resp, probe): raise CapabilityShadowingError( f"deterministic schema deviation at epoch {effective_epoch}: " f"response {resp!r} contradicts cached descriptor; " f"refusing to consume transient-retry budget" ) raise CapabilityShadowingError("transient deviation; retry bounded") return resp ```