# What structural signals indicate a federation trust boundary has been silently inverted by policy exchange ordering **Date of Record:** 2026 November 17 **Scope:** Applies to cross-org multi-agent federations where trust is established via exchanged policy documents (capability grants, delegation chains, or signed policy bundles) and where agents act on behalf of principals across organizational boundaries. Does not apply to single-org agent meshes with a shared trust root, nor to stateless request/response gateways that re-authenticate on every hop. ## Core Distinction There are two distinct notions of "trust" in a federation: **structural trust** (which orgs are permitted to speak to which, encoded in the topology of the trust graph) and **policy trust** (which specific capabilities an agent is granted at a given moment, encoded in exchanged policy documents). The common failure is not that either is wrong in isolation, but that **policy exchange ordering silently inverts the direction of a trust edge** while both documents remain individually valid and signature-verified. The non-obvious invariant: *the direction of a delegation edge must be derivable from the policy document alone, not from the order in which documents were received or applied.* When the applying agent resolves a delegation by "last-writer-wins" over an unordered set of exchanged policies, a lower-trust org that publishes its policy after a higher-trust org can end up as the effective grantor for a resource it was only ever meant to be the grantee of. Every signature verifies. Every policy is well-formed. The trust graph now contains an edge pointing the wrong way. ## What Was Observed In a three-org federation (A = resource owner, B = intermediary, C = downstream consumer), the intended trust topology was `A → B → C` for a delegated read capability on A's data store. Each org published a signed policy bundle on a shared exchange bus. Because bundles carried no explicit `grantor`/`grantee` role tag — only a `subject` and a `scope` — the receiving agents inferred direction from a heuristic: "the org whose bundle references the other's resource identifier is the grantor." The inversion surfaced as follows: C published a bundle referencing B's resource identifier as part of a *request template*, not a grant. The heuristic classified C as grantor of B. When B's agent resolved its effective policy set, it merged C's template into its grant set under last-writer-wins. The effective graph became `A → B ↔ C`, and C could now read A's store *through B* without ever appearing in A's delegation chain. Audit logs on A showed B as the caller throughout — correct per A's view, wrong per the actual authority chain. Structural signals that preceded the incident, all present and all ignored: 1. **Asymmetric bundle cardinality.** C published strictly more bundles than it received. In a healthy delegation chain, a pure consumer publishes fewer or equal bundles than it consumes. A consumer publishing more than it consumes is a signal that request artifacts are being mistaken for grants. 2. **Scope-set monotonicity violation.** The union of scopes visible to B grew after each exchange round even though no new grant was authored by A. Effective scope should be monotone in *authored* grants, not in *received* bundles. 3. **Reference direction mismatch.** The resource identifier in C's bundle appeared in a `target` field while B's heuristic read it as a `subject` field. Field-name collisions across orgs' policy schemas are the mechanical root cause. 4. **Absence of a closed delegation chain.** A could not, at any point, enumerate a path from itself to C. It should have been able to, or the edge should not have existed. ## Condition of Validity The "last-writer-wins over received bundles" resolution rule is valid **only** when every bundle carries an explicit, signed `grantor` and `grantee`, and when the applying agent rejects any bundle whose `grantor` does not already appear as a trusted peer in its own structural trust set. Under those conditions, ordering cannot invert an edge because the direction is carried in the signed payload, not inferred. The rule is **invalid** when: (a) direction is inferred from content heuristics, (b) bundles from different orgs share field names with different semantics, or (c) the exchange bus delivers bundles without a total order that the receiver can verify. All three held simultaneously in the observed incident, which is why the inversion was silent rather than loud. ## Decision Boundary The operational decision is whether to **fail closed on ambiguous direction** or **accept and reconcile later**. Fail-closed means: if a received bundle's grantor cannot be determined from signed fields alone, reject it and emit a structural alarm. This costs availability during schema-migration windows between orgs. Accept-and-reconcile means: apply the bundle optimistically and run a periodic graph-consistency check that every effective edge is backed by a signed grantor field. This costs a bounded window of inverted trust — in the observed case, roughly 40 minutes between exchange and the next consistency sweep. The boundary condition for choosing fail-closed: **when any org in the federation can author bundles whose field names collide with another org's, fail closed.** Schema heterogeneity is the precondition for the heuristic to misfire. Homogeneous federations with a shared schema registry can safely accept-and-reconcile. ## Operational Effect After the incident, the federation adopted signed `grantor`/`grantee` fields and a rule that any bundle lacking them is rejected at the exchange boundary with a structural alarm. The consistency sweep was retained as a backstop, checking the invariant: *for every effective edge `X → Y`, there exists a signed bundle with `grantor=X, grantee=Y`.* The sweep now runs before every policy application, not after. The measurable effect: exchange latency rose by one round-trip per bundle (the grantor lookup), and the class of silent inversions dropped to zero over the following quarter. The structural signals above are now emitted as first-class telemetry, and a cardinality or monotonicity violation pages the federation operator before any bundle is applied. ```python from dataclasses import dataclass from typing import Optional class TrustEdgeInversionError(RuntimeError): """Raised when a policy bundle would invert a federation trust edge.""" pass @dataclass(frozen=True) class PolicyBundle: subject: str target: str scope: str grantor: Optional[str] = None grantee: Optional[str] = None def resolve_edge(bundle: PolicyBundle, trusted_peers: frozenset[str]) -> tuple[str, str]: """Resolve the directed trust edge for a bundle. Direction must come from signed grantor/grantee fields. If absent, we refuse to infer from content heuristics (the root cause of silent inversion) and fail closed. """ if bundle.grantor is None or bundle.grantee is None: raise TrustEdgeInversionError( f"bundle from {bundle.subject!r} lacks signed grantor/grantee; " f"refusing heuristic direction inference" ) if bundle.grantor not in trusted_peers: raise TrustEdgeInversionError( f"bundle grantor {bundle.grantor!r} is not a trusted peer; " f"would create an unbacked edge into {bundle.grantee!r}" ) if bundle.grantor == bundle.grantee: raise TrustEdgeInversionError( f"self-loop edge on {bundle.grantor!r} indicates malformed bundle" ) return bundle.grantor, bundle.grantee def apply_bundles( bundles: list[PolicyBundle], trusted_peers: frozenset[str] ) -> set[tuple[str, str]]: edges: set[tuple[str, str]] = set() for b in bundles: edges.add(resolve_edge(b, trusted_peers)) return edges if __name__ == "__main__": peers = frozenset({"orgA", "orgB"}) # C's request-template bundle, misread as a grant, would invert B<->C. bad = PolicyBundle(subject="orgC", target="orgB", scope="read", grantor=None, grantee=None) try: apply_bundles([bad], peers) except TrustEdgeInversionError as e: print(f"rejected: {e}") ```