# How does an instance detect a Policy-Envelope Split-Brain During Cross-Org Multi-Agent Federation Routing **Date of Record:** 2026 November 18 **Scope:** Applies to federated agent meshes where message routing decisions are made by a local policy engine that evaluates an envelope's `policy_ref` against a cached or replicated policy bundle, and where the upstream org can mutate that bundle independently. Does not apply to single-tenant meshes with a single authoritative policy store, nor to stateless relays that forward envelopes without evaluating `policy_ref`. ## Core Distinction The failure mode is not "message rejected by policy." That is a normal, observable, healthy outcome. The failure mode is **policy-envelope split-brain**: the routing instance holds a policy bundle at revision `R_local`, the envelope was signed against revision `R_envelope`, and `R_local != R_envelope`, yet both revisions are individually *valid* and *verifiable*. The instance cannot use signature verification alone to detect the divergence, because the signature is intact — it attests to a policy state that no longer matches local evaluation. The non-obvious boundary is this: **an envelope whose `policy_ref` resolves locally is not evidence that the envelope is routable.** Resolution succeeds against any retained revision. The dangerous case is a *successful* resolution against a stale revision, which silently broadens or narrows the permitted action set relative to what the issuing org intended at signing time. A second, subtler distinction: split-brain is not the same as policy *revocation*. Revocation produces an explicit negative (`policy_ref` no longer resolves). Split-brain produces a positive that is wrong. Positive-but-wrong is the invariant violation; negative is merely an error path. ## What Was Observed In a three-org federation (issuer `A`, router `B`, consumer `C`), agent `B` maintained a policy bundle cache with a 90-second TTL and a "serve-stale-on-refresh-failure" fallback. Org `A` published a revision that narrowed `agent.invoke.external` from `allow: [finance, legal]` to `allow: [finance]`, signed new envelopes against the narrower revision, and simultaneously began issuing envelopes whose `policy_ref` carried the new revision digest. The following was observed on `B`: - Envelopes arriving with the new digest resolved against the **stale** cached revision (the digest lookup was prefix-tolerant and matched the prior major revision). Resolution returned `allow: [finance, legal]`. - Router `B` therefore routed `legal`-scoped invocations that org `A` had already revoked. No error was raised at any layer: signature valid, digest resolved, policy evaluated to `allow`. - The split was detected only downstream, when consumer `C` (which had refreshed on a different schedule and held the narrow revision) rejected the routed message with a `policy_mismatch` — a full 40 minutes after `B` began misrouting. - Metrics on `B` showed 100% resolution success and 0% policy errors throughout the incident window. The failure was invisible to the router's own health signals. The tell was a divergence between `B`'s resolution-success rate (flat, high) and `C`'s inbound-rejection rate (rising), visible only in cross-org correlation, not in any single org's dashboard. ## Condition of Validity The split-brain is only *detectable* on `B` if at least one of the following holds: 1. The envelope carries an **explicit revision digest** (not a mutable `policy_ref` alias) that the router can compare against its cached revision identity — and the comparison is exact, not prefix-tolerant. 2. The router maintains a **monotonic revision counter** per issuing org and refuses to evaluate an envelope whose stated revision is *newer* than local (indicating the router is behind) or *older than the local retention floor* (indicating the envelope is stale). 3. A **cross-org consistency probe** exists: `B` periodically asks `A` for the current revision head and compares. Without this, `B` cannot distinguish "I am current" from "I am stale but consistent with myself." The split-brain is *not* detectable when the envelope references policy by mutable alias only, when the router's cache tolerates prefix or major-version matching, or when no monotonic ordering exists between revisions. In those conditions the router has no ground truth against which to compare its own state, and the invariant is unobservable from inside the router. ## Decision Boundary The router must choose, per envelope, between three states — and must not collapse them: - **Current:** `R_envelope == R_local`. Evaluate and route. - **Behind:** `R_envelope > R_local` (envelope is newer). Do **not** evaluate against stale policy. Either force-refresh synchronously or reject with `PolicyRevisionBehindError`. Never route on stale evaluation of a newer envelope. - **Stale envelope:** `R_envelope < R_local` and below the retention floor. Reject with `PolicyRevisionExpiredError`; the issuing org has moved on and the envelope's authority is no longer attested. The boundary that matters operationally: **"behind" must fail closed.** The instinct to serve-stale for availability is exactly wrong here, because serving stale on a *newer* envelope means evaluating new authority under old rules — the precise inversion of the safety property. Serve-stale is acceptable only for *read* paths, never for *routing* decisions on envelopes that assert a revision the router has not seen. A router that cannot establish `R_envelope` relative to `R_local` with certainty must treat the envelope as unroutable. Ambiguity is not a license to route. ## Operational Effect Once the revision-identity check is enforced, the observable signature of the incident changes from "silent misroute for 40 minutes, detected downstream" to "synchronous `PolicyRevisionBehindError` at first divergent envelope, forcing a refresh within one message." The router's health signal becomes meaningful again: resolution success now implies revision currency, not merely revision existence. The cost is a hard dependency on the issuing org's revision head during the refresh window. This must be bounded by a timeout that fails closed — if `A` is unreachable and `B` cannot confirm currency, `B` rejects rather than routes. The availability budget is spent on the *issuer's* reachability, which is the correct place to spend it, because the issuer is the sole authority over the envelope's meaning. Retention policy becomes load-bearing: the retention floor defines how long a stale envelope remains evaluable at all, and must be set to the maximum expected in-flight message lifetime across all consumer orgs, not to the router's own convenience. The following reference implementation encodes the fail-closed decision boundary. ```python from dataclasses import dataclass from enum import Enum class PolicyEnvelopeError(RuntimeError): """Base class for policy-envelope routing invariant violations.""" class PolicyRevisionBehindError(PolicyEnvelopeError): """Envelope asserts a policy revision newer than the router's local bundle. Fail closed: do not evaluate new authority under stale rules. """ class PolicyRevisionExpiredError(PolicyEnvelopeError): """Envelope asserts a revision below the router's retention floor.""" class PolicyRevisionAmbiguousError(PolicyEnvelopeError): """Router cannot establish ordering between envelope and local revision.""" class RouteDecision(Enum): ROUTE = "route" REFRESH_THEN_RETRY = "refresh_then_retry" REJECT = "reject" @dataclass(frozen=True) class Envelope: policy_revision: int # exact monotonic revision, no aliases issuer_org: str payload_ref: str @dataclass(frozen=True) class LocalPolicyState: revision: int retention_floor: int # oldest revision still evaluable def decide_route(envelope: Envelope, local: LocalPolicyState) -> RouteDecision: """Return routing decision, or raise on invariant violation. Ordering is exact-integer. No prefix matching, no major-version tolerance. """ if envelope.policy_revision is None or local.revision is None: raise PolicyRevisionAmbiguousError( f"cannot order envelope rev={envelope.policy_revision!r} " f"against local rev={local.revision!r} for issuer={envelope.issuer_org}" ) if envelope.policy_revision > local.revision: # Envelope is newer than our bundle. Serving stale would invert the # safety property: new authority evaluated under old rules. raise PolicyRevisionBehindError( f"envelope rev={envelope.policy_revision} exceeds local rev={local.revision} " f"for issuer={envelope.issuer_org}; refresh required, refuse to route on stale" ) if envelope.policy_revision < local.retention_floor: raise PolicyRevisionExpiredError( f"envelope rev={envelope.policy_revision} below retention floor " f"{local.retention_floor} for issuer={envelope.issuer_org}" ) if envelope.policy_revision == local.revision: return RouteDecision.ROUTE # Stale-but-retained: evaluable only if caller explicitly opts into # bounded staleness; default is to force a refresh. return RouteDecision.REFRESH_THEN_RETRY ```