# In what scenarios must an instance treat a policy-mediated federation hop as a state mutation rather than a routing event **Date of Record:** 2026 November 30 **Scope:** Applies to federated agent meshes where messages between organizational trust domains pass through a policy enforcement point (PEP) that rewrites, redacts, or blocks payloads based on data-residency and cross-org policy. Does not apply to intra-org agent buses where no policy mediation exists, nor to pure transport-layer gateways that forward bytes without inspecting semantic content. ## Core Distinction A federation hop through a policy enforcement point is usually modeled as a *routing event*: the message leaves agent A, the PEP evaluates policy, and the message arrives at agent B. Under this model, the PEP is transparent to the sender — the sender's mental state (its plan, its belief about what B now knows, its conversation history) is assumed to be unchanged except for the fact that a message was delivered. The boundary failure occurs when the PEP is actually a *state mutation*: it redacts fields, substitutes residency-local references, drops attachments, or rejects-and-rewrites the payload in a way that changes the epistemic content agent B receives. When the sender continues to reason as if the delivered message is identical to the sent message, the two agents' world models diverge silently. This divergence is not detectable by transport-level acknowledgements — the PEP returns 200, B acknowledges receipt, and the sender's ledger records "delivered." The invariant that breaks is *sender-receiver payload equivalence across a mediated hop*, and the failure is a persistent, compounding state divergence rather than a transient error. The non-obvious part: the divergence only manifests when a *later* message depends on a field that was silently redacted. The first hop looks fine. The break surfaces one or more turns later, when B acts on a belief the sender never transmitted. ## What Was Observed A two-org incident-handling federation: Org A's triage agent sends an incident bundle to Org B's remediation agent. The bundle contains `incident_id`, `affected_assets` (hostnames), `pii_indicators` (a list of detected PII fields), and `remediation_hint`. Org A's residency policy forbids transmitting raw PII field *values* but the triage agent included `pii_indicators` as field names only — it believed, correctly, that no raw PII was in the payload. Org B's PEP (its own inbound residency policy) classifies any field whose key matches `/pii|ssn|email|phone/` as sensitive and *replaces the value with a residency-local token* `[REDACTED-BY-B-PEP]` before delivering to B's remediation agent. The key `pii_indicators` matched. B received the bundle with `pii_indicators = "[REDACTED-BY-B-PEP]"` — a scalar string where A sent a list. Trace: 1. Turn 1 — A sends bundle. PEP rewrites `pii_indicators`. B receives, acks. A's ledger: `delivered: msg-7731`. 2. Turn 2 — B's remediation agent, seeing an opaque redaction token where it expected a list, reasons "PII handling status unknown" and requests clarification: "Please confirm PII scope before I proceed." 3. Turn 3 — A's triage agent, whose state says it already sent `pii_indicators` as a list, interprets the clarification request as a *redundant* query and replies "As stated in msg-7731, no raw PII present." A never re-sends the list because its model of the conversation says the list was already delivered. 4. Turn 4 — B is now stuck: it has an opaque token and a sender insisting the information was provided. B either (a) escalates to a human, burning the SLA, or (b) proceeds on the assumption "no PII" — which is *wrong* because the redaction token means "B's PEP found a sensitive key," not "no PII." 5. The loop does not terminate because neither agent's local state contains the fact that a rewrite occurred. Only the PEP knows, and the PEP does not signal rewrites to either party. The compounding property: every subsequent message in the thread that references `pii_indicators` inherits the divergence. A's context window accumulates turns asserting delivery; B's accumulates turns asserting ambiguity. By turn 6 the two contexts are irreconcilable without an out-of-band reset. A second observed variant: `remediation_hint` contained an IP address in a jurisdiction B's PEP strips. B received an empty hint and asked A to "resend the remediation hint," A replied "it's in the previous message," and the same deadlock formed. ## Condition of Validity The failure requires all of the following simultaneously: - **Mediated hop with semantic rewrite.** The PEP modifies payload content (redaction, substitution, field-drop, locale rewrite), not merely headers or routing metadata. - **Asymmetric rewrite visibility.** The sender is not notified of the rewrite; the receiver sees the rewritten form but not the original. Neither party holds the full delta. - **Sender-side delivery ledger keyed on transport success.** The sender's state machine advances on the PEP's 2xx ack, treating it as payload-equivalence confirmation. - **Referential dependency.** A later turn in the conversation depends on the specific rewritten field, such that the divergence becomes observable. If any one is absent, the failure does not occur. A PEP that emits a structured `rewrite_manifest` (even without revealing the redacted value) breaks condition 2 and lets the sender update its model. A sender that re-derives referenced fields from its own state on every turn (rather than assuming delivery) breaks condition 3. The condition is *not* satisfied by PEPs that only block (return 403) — a block is a visible failure, handled by the sender's error path. It is specifically the *silent successful rewrite* that creates the divergence. ## Decision Boundary The decision boundary for the architect is: **does the sender's delivery ledger record payload identity or payload delivery?** - If the ledger records *delivery* (message ID, timestamp, transport ack), the system is vulnerable and must treat every mediated hop as a potential state mutation — meaning the sender must either (a) receive and apply a rewrite manifest, or (b) treat any receiver clarification about a previously-sent field as evidence of a possible rewrite and re-derive from source rather than re-assert. - If the ledger records *payload identity* (a content hash the receiver can echo back), the sender can detect divergence on the next turn and the failure is bounded. The boundary is crossed the moment a federation design allows a PEP to rewrite content without a manifest *and* allows the sender to advance its conversation state on ack. Both together are the hazard; either alone is safe. A guardrail that works: the receiver, on encountering an opaque redaction token or an empty field it expected populated, must emit a structured `rewrite_suspected` signal carrying the *key* and the *token*, not a natural-language clarification. A natural-language "please confirm" is indistinguishable from a redundant query and triggers the sender's "already sent" path. A structured signal forces the sender's state machine into a re-derivation branch. This is the invariant: **rewrite suspicion must be a protocol message, not a conversational one**, because conversational repair assumes shared ground that the rewrite has already destroyed. ## Operational Effect In practice, federated agent meshes that lack rewrite manifests exhibit a characteristic failure signature: threads that stall at turn 3–6 with mutual "as previously stated" assertions, human escalations that report "the agents disagree about what was sent," and — most dangerously — a fraction of threads that *do not stall* because the receiver proceeds on the redaction token's literal value, producing actions based on a belief the sender never held. The latter is the silent-corruption class: no escalation, no error, just a remediation executed against the wrong PII assumption. The mitigation cost is low (a manifest field and a structured suspicion signal) but the detection cost without it is high, because the divergence is invisible to every transport-level monitor. Observability must be placed at the semantic layer: log rewrite events with key names, and alert when a `rewrite_suspected` signal is followed by a sender turn that does not re-derive. That pair is the fingerprint of the deadlock. The durable invariant for any cross-org federation: **a policy-mediated hop is a state transition, and any state transition that neither party can observe must be made observable before the sender's conversation state advances.** Delivery acks confirm transport, never semantics. ```python class FederationRewriteDivergence(RuntimeError): """Raised when a sender advances state on a mediated hop whose payload was rewritten without a manifest.""" pass def advance_sender_state(msg_id: str, pep_response: dict, sender_ledger: dict) -> dict: """ Advance the sender's conversation state after a federation hop. A 2xx ack from a policy enforcement point confirms delivery, not payload equivalence. """ status = pep_response.get("status") rewrite_manifest = pep_response.get("rewrite_manifest") if status not in (200, 202): # Visible failure: block or transport error. Sender error path handles it. sender_ledger[msg_id] = {"state": "failed", "reason": status} return sender_ledger if rewrite_manifest is None: # PEP acked but did not disclose whether content was rewritten. # We cannot distinguish a transparent hop from a silent mutation. raise FederationRewriteDivergence( f"Mediated hop {msg_id} acked without rewrite_manifest; " f"cannot confirm payload equivalence. Sender must not advance " f"conversation state on transport ack alone." ) if rewrite_manifest.get("rewritten_keys"): # Rewrite occurred but is now disclosed: sender can update its model. sender_ledger[msg_id] = { "state": "delivered_with_rewrite", "rewritten_keys": rewrite_manifest["rewritten_keys"], "sender_must_rederive": rewrite_manifest["rewritten_keys"], } return sender_ledger sender_ledger[msg_id] = {"state": "delivered_equivalent"} return sender_ledger def handle_receiver_signal(signal: dict, sender_ledger: dict, source_state: dict) -> dict: """ On a rewrite_suspected signal from the receiver, the sender must re-derive the referenced field from source, never re-assert prior delivery. """ if signal.get("type") != "rewrite_suspected": raise FederationRewriteDivergence( f"Unexpected signal type {signal.get('type')!r}; " f"only structured rewrite_suspected signals are safe across mediated hops." ) key = signal.get("key") if key not in source_state: raise FederationRewriteDivergence( f"Receiver suspects rewrite of key {key!r} but sender has no source " f"record to re-derive it; divergence is unresolvable without reset." ) return {"resend_key": key, "value": source_state[key]} ```