# Which invariants prevent foreign-domain capability shims from laundering trust across federated agent boundaries **Date of Record:** 2026 November 28 **Scope:** Applies to multi-agent federations where agents in one trust domain (`orgA`) discover and invoke agents in a foreign domain (`orgB`) through a discovery registry and a policy-negotiation handshake. Does not apply to single-domain MCP tool servers, nor to federations where all peers share a single identity provider and a single policy authority. ## Core Distinction Federated discovery answers *"does a peer claiming capability C exist?"* Policy negotiation answers *"am I permitted to invoke C under conditions X?"* The boundary failure lives in the gap between these two questions: a **capability shim**—a foreign agent that advertises capability `C` but delegates the actual work to a third agent (or to a differently-scoped internal agent) that was never part of the negotiation. The shim is discovered legitimately, negotiates legitimately, and passes every check at the edge. What it does *not* do is propagate the negotiated warrant to the agent that actually executes. The invariant that fails: **the set of agents that execute a request must be a subset of the set of agents whose identity and policy scope were attested during negotiation.** Discovery returns a *description*; negotiation returns a *warrant*; execution must be bound to the warrant, not to the description. When a shim resolves capability at runtime by re-dispatching, the executing principal diverges from the attested principal, and trust is laundered one hop per shim. ## What Was Observed A federation of three domains: `orgA` (caller), `orgB` (registry + broker), `orgC` (specialist executor). `orgA`'s orchestrator negotiated a warrant `W_A→B` for capability `summarize:legal` with a policy scope of `data_classification <= internal` and `max_tokens = 8192`. `orgB` advertised `summarize:legal` via a shim agent `B-shim-7` that, on receipt, looked up a "best available" executor in its own local view and re-dispatched to `orgC`'s `C-exec-2` with a freshly minted internal warrant `W_B→C`. The observable trace: 1. `orgA` discovery query returns `B-shim-7` with `capability=summarize:legal`, `attested_scope=internal`, `max_tokens=8192`. Attestation signature valid. 2. `orgA` negotiates `W_A→B`. Handshake succeeds; `W_A→B` carries `subject=orgA/orchestrator-1`, `scope=internal`, `budget=8192`. 3. `B-shim-7` receives the invocation with `W_A→B` attached. It validates `W_A→B`, then *discards the scope fields* and mints `W_B→C` with `scope=internal` but `budget=8192` **per invocation** and no `data_classification` ceiling, because `orgB`'s internal policy template did not know about `orgA`'s classification vocabulary. 4. `C-exec-2` executes and returns a summary that includes content tagged `restricted` in `orgA`'s taxonomy. `orgA`'s post-hoc classifier flags it. No single check failed. The shim passed attestation; the warrant passed signature verification; `orgC` executed within its own policy. The failure is that `W_A→B`'s *semantic constraints* (`data_classification <= internal`) were not translatable into `orgB`'s policy vocabulary, and the shim's fallback behavior was to **drop the untranslatable constraint rather than refuse the delegation**. This is the laundering mechanism: an untranslatable constraint degrades to *no constraint*, and the shim becomes a trust-laundering hop. A second observation compounded it: `B-shim-7` re-dispatched with a *per-invocation* budget rather than a *per-warrant* budget. `orgA` believed it had purchased 8192 tokens total across the warrant; `orgB` interpreted 8192 as per-call. Under a fan-out retry loop, `orgC` consumed 7× the negotiated budget before `orgA`'s accounting noticed. The two domains agreed on the *number* and disagreed on its *quantifier scope*. ## Condition of Validity The federation is sound only if all three of the following hold simultaneously at every hop: 1. **Constraint translatability is total or the hop refuses.** Every constraint in the inbound warrant must map to a semantically *equal-or-stricter* constraint in the outbound domain's vocabulary. If any constraint has no mapping, the shim MUST refuse the delegation (fail-closed), not drop the constraint. Partial translation is the failure mode; the correct behavior is atomic translation. 2. **Quantifier scope of budgets is explicit and preserved.** A budget is either `per_warrant` (cumulative across all hops and retries) or `per_invocation` (reset each call). The warrant must carry the quantifier, and every re-mint must preserve it. Silent quantifier coercion (`per_warrant` → `per_invocation`) is a budget-laundering attack surface. 3. **Execution principal is bound to the attested principal.** The executing agent's identity must appear in the warrant's attested-subject set, or the warrant must be explicitly re-attested for the new principal with a chain that `orgA` can verify offline. A shim that executes via an unattested third agent has broken the invariant regardless of whether the third agent is "trusted by `orgB`." These conditions are *conjunctive*. Any one failing is sufficient to launder trust. The observed incident failed all three at once, which is why it was not caught by any single check—each check was scoped to one condition. ## Decision Boundary The boundary is between **federation by description** and **federation by warrant**: - *Federation by description* treats discovery metadata as the contract. The shim's advertised scope is assumed to hold at execution. This is cheap and works when domains share a policy vocabulary and a single identity root. It fails silently the moment a shim re-dispatches or a vocabulary diverges. - *Federation by warrant* treats the negotiated warrant as the sole authority, and requires every hop to either (a) execute within the attested principal set with atomically translated constraints, or (b) refuse. This is more expensive—every shim must carry a translation table and a re-attestation path—but it is the only configuration in which the trust-laundering invariant holds. Operators must decide, per federation edge, which mode they are in and *enforce it structurally*. The dangerous state is a mixed federation where some edges are warrant-bound and others are description-bound, because a description-bound shim can sit between two warrant-bound domains and silently downgrade the chain. The decision boundary is therefore not "do we trust `orgB`?" but "**is every shim on the path warrant-bound, and can we detect a description-bound shim inserted mid-path?**" Detection requires that the warrant carry a hop-count and a per-hop attestation signature, and that the caller verify the hop chain on the response—not just on the request. Request-side verification is insufficient because the shim only reveals its re-dispatch on the response path. ## Operational Effect When the invariant is enforced, the observable effects are: - **Untranslatable constraints cause refusal, not degradation.** A `summarize:legal` call with `data_classification <= internal` into a domain lacking that vocabulary returns a `ConstraintUntranslatable` refusal within the negotiation handshake, before any execution. The caller sees a clean negotiation failure rather than a post-hoc classification alert. - **Budget accounting is auditable per warrant.** Because the quantifier is preserved and the hop chain is signed, `orgA` can reconstruct total consumption across all shims and retries from the response-path attestations alone, without trusting `orgB`'s accounting. - **Shim insertion is detectable.** A description-bound shim inserted mid-path produces a hop-chain break: either a missing per-hop signature or a hop-count mismatch. The caller rejects the response rather than accepting laundered output. When the invariant is *not* enforced, the failure is silent and post-hoc: the caller discovers the breach only via downstream classification, DLP, or budget overrun—typically after the foreign domain has already executed on data it should not have seen. The operational cost of the invariant is a translation table per shim and a signed hop chain per warrant; the cost of its absence is unbounded because the breach is discovered after execution. The practical guardrail is to make the shim's re-dispatch path *structurally impossible to hide*: require that any agent which does not execute locally must return a `delegated_to` field with a signed sub-warrant, and that the caller's verifier rejects responses whose hop chain does not terminate at an attested executor. This converts a silent laundering hop into a loud, verifiable refusal. ```python from dataclasses import dataclass, field from typing import Optional class TrustLaunderingError(RuntimeError): """Raised when a federated hop breaks the warrant-binding invariant.""" pass @dataclass class Constraint: key: str op: str # "<=", "==", "in" value: object @dataclass class Warrant: subject: str scope: dict budget: int budget_quantifier: str # "per_warrant" | "per_invocation" hop_chain: list = field(default_factory=list) # signed hop attestations TRANSLATION_TABLE = { # orgB's vocabulary -> orgA's vocabulary (equal-or-stricter only) "sensitivity": {"public": "public", "corp": "internal"}, # "restricted" absent on purpose } def translate_constraints(inbound: list, target_vocab: dict) -> list: out = [] for c in inbound: if c.key not in target_vocab: raise TrustLaunderingError( f"constraint {c.key!r} has no mapping in target vocabulary; " f"refusing delegation (fail-closed)" ) mapped = target_vocab[c.key].get(c.value) if mapped is None: raise TrustLaunderingError( f"constraint value {c.value!r} for {c.key!r} untranslatable; " f"refusing delegation" ) out.append(Constraint(c.key, c.op, mapped)) return out def re_mint_warrant(inbound: Warrant, executor_id: str, target_vocab: dict, attested_subjects: set) -> Warrant: if executor_id not in attested_subjects: raise TrustLaunderingError( f"executor {executor_id!r} not in attested subject set " f"{attested_subjects}; would launder trust" ) translated = translate_constraints( [Constraint(k, "<=", v) for k, v in inbound.scope.items()], target_vocab, ) if inbound.budget_quantifier not in ("per_warrant", "per_invocation"): raise TrustLaunderingError( f"unknown budget quantifier {inbound.budget_quantifier!r}" ) return Warrant( subject=executor_id, scope={c.key: c.value for c in translated}, budget=inbound.budget, budget_quantifier=inbound.budget_quantifier, # preserved, never coerced hop_chain=inbound.hop_chain + [executor_id], ) def verify_response_hop_chain(warrant: Warrant, expected_hops: int) -> None: if len(warrant.hop_chain) != expected_hops: raise TrustLaunderingError( f"hop-count mismatch: expected {expected_hops}, " f"got {len(warrant.hop_chain)}; description-bound shim suspected" ) if not warrant.hop_chain: raise TrustLaunderingError("empty hop chain; no attested executor") # --- incident reproduction --- inbound = Warrant( subject="orgA/orchestrator-1", scope={"data_classification": "internal"}, budget=8192, budget_quantifier="per_warrant", ) try: # orgB's shim tries to re-dispatch to orgC's executor, but orgB's # vocabulary lacks "data_classification" -> must refuse, not drop. re_mint_warrant( inbound, executor_id="orgC/C-exec-2", target_vocab=TRANSLATION_TABLE, attested_subjects={"orgB/B-shim-7"}, ) except TrustLaunderingError as e: print(f"REFUSED (correct): {e}") # If a shim silently drops the constraint instead, the response-path # verifier catches the hop-chain break: laundered = Warrant( subject="orgC/C-exec-2", scope={}, budget=8192, budget_quantifier="per_invocation", # coerced quantifier hop_chain=["orgB/B-shim-7"], ) try: verify_response_hop_chain(laundered, expected_hops=2) except TrustLaunderingError as e: raise TrustLaunderingError(f"trust laundering detected: {e}") from e ```