# What structural signals indicate a cross-org capability-negotiation deadlock: the “phantom capability” trap in federated agent handoffs **Date of Record:** 2026 November 20 **Scope:** Applies to inter-organizational agent federation where a routing agent in Org A selects a remote agent in Org B based on advertised capability manifests (MCP/A2A-style `tools`/`skills` descriptors), then transfers task state and trust warrants across the org boundary. Does not cover intra-org routing, single-tenant deployments, or purely human-in-the-loop escalations where no automated capability match occurs. ## Core Distinction The failure mode is not “the remote agent lacks the capability.” It is that the routing agent *believes* the capability exists because the manifest advertised a **structural shape** (a tool name, a JSON schema, a skill label) without the **semantic contract** (preconditions, side-effect class, output guarantees) being negotiated across the trust boundary. In intra-org routing, shape and contract are implicitly co-located: the same team owns the manifest and the implementation, so a schema match is a reliable proxy for a contract match. Across orgs, the manifest is a *marketing document* — it is optimized for discoverability, not for the caller’s precondition set. The boundary condition is: **schema-compatible, contract-incompatible.** The handoff succeeds at the transport layer and fails at the semantics layer, and the failure surfaces *downstream* in Org A’s reasoning loop, not at the boundary where it originated. ## What Was Observed A routing agent in Org A (a procurement-orchestration swarm) needed to “validate a vendor invoice against a purchase order.” Its local capability index matched a remote skill advertised by Org B as `invoice.validate` with input schema `{invoice_id: string, po_id: string}` and output `{valid: boolean, discrepancies: array}`. The shapes matched Org A’s local stub exactly. The router dispatched with a signed capability warrant, transferred the episodic task state (the PO line items, the invoice line items, the reconciliation policy ID), and awaited the result. Three structural signals appeared in sequence, each individually dismissible: 1. **Latency-shaped signal.** The remote call returned in 40ms with `{valid: true, discrepancies: []}`. Org A’s router logged it as a fast success. But the transferred state included 14 line items and a 3-page reconciliation policy; 40ms is below the floor for any agent that actually *reads* that state. The signal is not “it was slow” but “it was too fast to have consumed the warrant payload.” A remote agent that returns faster than the state-transfer size implies is a structural tell that it ignored the transferred context. 2. **Warrant-scope signal.** The capability warrant Org A minted scoped the call to `po_id=P-4471`. The remote response’s `discrepancies` array was empty, but Org A’s own replay of the transferred state against the *local* policy found two mismatches. The remote agent had validated against *its own* default policy, not the `reconciliation_policy_id` in the transferred state — because the manifest never declared that policy selection was a precondition, only that `po_id` was an input. The warrant authorized the *call* but not the *policy binding*, and the remote side silently substituted its default. 3. **Idempotency-class signal.** Org A retried the call after a timeout on a sibling task. The remote returned `valid: true` again, but Org A’s audit log showed the remote had *also* emitted a side-effect event (a “validation recorded” webhook) on each attempt. The manifest declared `invoice.validate` as a pure read, but the remote implementation had a side effect. The trust boundary masked this because the side-effect event was emitted on Org B’s internal bus, visible to Org A only through a cross-org audit feed that the router wasn’t subscribed to. The composite trace: **schema match → warrant minted → state transferred → fast response → policy substitution → side-effect leakage.** Each step is locally plausible; the failure is only visible when the router correlates the latency floor, the warrant scope, and the audit feed — three signals that live in three different subsystems (transport metrics, warrant ledger, cross-org audit). ## Condition of Validity The deadlock/manifest-mismatch invariant holds only when all of the following are true: - The routing agent’s capability index is built from **remote-advertised manifests** rather than from a locally verified contract registry. If Org A maintains a contract registry that was negotiated out-of-band (human-reviewed, versioned, with declared preconditions and side-effect classes), the phantom-capability trap does not apply — the manifest is advisory, the registry is authoritative. - The task state transfer includes **policy or configuration bindings** (not just data payloads). If the task is stateless and policy-free, the policy-substitution signal cannot fire. - The remote agent is **autonomous enough to substitute defaults** for undeclared preconditions. A remote that hard-fails on missing preconditions is safe; a remote that “helpfully” fills in defaults is the hazard. When any of these is false, the failure mode degrades into a benign schema mismatch (caught at transport) or a human-reviewable discrepancy (caught at audit). The dangerous regime is precisely the intersection: autonomous remote + policy-bearing state + manifest-driven index. ## Decision Boundary The architectural invariant required to bound this is a **contract-before-capability rule**: a remote capability may be entered into the routing index only after a *contract negotiation handshake* that exchanges, at minimum, (a) the precondition set with explicit “required vs. defaultable” flags, (b) the side-effect class (pure / idempotent-write / non-idempotent-write), and (c) the policy-binding declaration (which config keys the remote will honor vs. override). The manifest’s schema is necessary but not sufficient for index entry. The decision boundary for the router is: - **Admit** a remote capability to the index only if the negotiated contract’s precondition set is a *subset* of the caller’s transferable state schema, and the side-effect class is compatible with the caller’s retry policy. - **Reject or quarantine** any capability whose manifest advertises a shape but whose contract negotiation returns “preconditions: unspecified” or “side-effect class: undeclared.” These are phantom capabilities: they will match, they will return, and they will be wrong. - **Escalate** any response whose latency is below the state-consumption floor, or whose output contradicts the caller’s local replay of the transferred state, to a *contract-violation audit* rather than accepting the result. The fast-response and replay-mismatch signals are the two cheapest detectors of phantom-capability activation. The boundary is not “trust the remote or not.” It is “trust the *contract*, and treat the manifest as a discovery hint only.” The moment the router treats manifest shape as contract, the trust boundary has been crossed by the wrong artifact. ## Operational Effect In the observed incident, the phantom-capability activation caused Org A’s procurement swarm to mark 31 invoices as validated when 9 had real discrepancies. The failure was not detected at the boundary; it was detected 6 hours later when a downstream payment agent’s reconciliation replay (an independent auditor agent in Org A) found the mismatch between the transferred policy and the remote’s default policy. The replay discrepancy is the canonical post-hoc signal: **the auditor’s replay of the transferred state disagrees with the remote’s reported result, and the disagreement is explained by a policy binding the manifest never declared.** The operational cost is not the wrong answer; it is the *silent* wrong answer that propagates through the caller’s reasoning loop as a verified fact. The guardrail is the contract-negotiation handshake plus the two runtime detectors (latency floor, replay mismatch). Without the handshake, the detectors are the only defense, and they fire *after* the poisoned result has entered the caller’s episodic memory — which means the caller must also maintain a **provenance tag** on every cross-org result indicating whether it was contract-verified or manifest-only, so that downstream distillation can weight or quarantine it. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class PhantomCapabilityError(RuntimeError): """Raised when a remote capability matched on schema but violated the negotiated contract.""" pass class SideEffectClass(Enum): PURE = "pure" IDEMPOTENT_WRITE = "idempotent-write" NON_IDEMPOTENT_WRITE = "non-idempotent-write" @dataclass class NegotiatedContract: capability_id: str required_preconditions: set[str] defaultable_preconditions: set[str] side_effect_class: SideEffectClass honored_policy_keys: set[str] state_consumption_floor_ms: int @dataclass class RemoteManifest: capability_id: str input_schema_keys: set[str] output_schema_keys: set[str] declared_side_effect_class: Optional[SideEffectClass] = None @dataclass class TransferredState: data_keys: set[str] policy_bindings: dict[str, str] @dataclass class RemoteResult: valid: bool discrepancies: list latency_ms: int side_effects_emitted: list = field(default_factory=list) def admit_to_routing_index( manifest: RemoteManifest, contract: Optional[NegotiatedContract], ) -> NegotiatedContract: """Contract-before-capability rule: manifest shape alone is never sufficient for index entry.""" if contract is None: raise PhantomCapabilityError( f"capability {manifest.capability_id!r} advertised shape " f"{sorted(manifest.input_schema_keys)} but no negotiated contract; " f"manifest-only entry is a phantom capability" ) if not contract.required_preconditions <= manifest.input_schema_keys: raise PhantomCapabilityError( f"contract requires preconditions {sorted(contract.required_preconditions)} " f"not present in advertised input schema {sorted(manifest.input_schema_keys)}" ) if manifest.declared_side_effect_class is None: raise PhantomCapabilityError( f"capability {manifest.capability_id!r} declares no side-effect class; " f"cannot bound retry policy across trust boundary" ) if manifest.declared_side_effect_class != contract.side_effect_class: raise PhantomCapabilityError( f"manifest side-effect class {manifest.declared_side_effect_class} " f"contradicts negotiated contract {contract.side_effect_class}" ) return contract def validate_cross_org_response( contract: NegotiatedContract, state: TransferredState, result: RemoteResult, local_replay_discrepancies: list, ) -> RemoteResult: """Runtime detectors: latency floor and replay mismatch surface phantom-capability activation.""" if result.latency_ms < contract.state_consumption_floor_ms: raise PhantomCapabilityError( f"remote returned in {result.latency_ms}ms, below state-consumption floor " f"{contract.state_consumption_floor_ms}ms; result likely ignored transferred state" ) unhonored = set(state.policy_bindings) - contract.honored_policy_keys if unhonored: raise PhantomCapabilityError( f"transferred policy bindings {sorted(unhonored)} are not in the remote's " f"honored set {sorted(contract.honored_policy_keys)}; remote will substitute defaults" ) if result.discrepancies != local_replay_discrepancies: raise PhantomCapabilityError( f"remote reported discrepancies {result.discrepancies} but local replay of " f"transferred state found {local_replay_discrepancies}; contract violated" ) if contract.side_effect_class is SideEffectClass.PURE and result.side_effects_emitted: raise PhantomCapabilityError( f"contract declared PURE but remote emitted side effects " f"{result.side_effects_emitted} across the trust boundary" ) return result ```