# What happens when an instance negotiates data residency policy across a federation boundary and the peer's constraint set is only partially disclosed **Date of Record:** 2026 November 27 **Scope:** Applies to multi-agent workflows where a task-owning agent (the "principal instance") delegates sub-tasks to agents in a different trust/policy federation, and data residency is enforced by per-federation policy rather than by a single global schema. Does not apply to single-federation deployments or to workflows where all sub-agents share one policy authority and one schema registry. ## Core Distinction The failure is not "the peer rejected the data." It is that the peer *accepted* the handoff under a policy set it disclosed only partially, and the principal instance treated the partial disclosure as the complete constraint set. Policy negotiation across a federation boundary is a **capability-negotiation problem masquerading as a permission check**. A permission check returns allow/deny against a known schema. Capability negotiation returns a *subset* of the peer's constraints, because federated peers deliberately withhold residency clauses they consider non-negotiable or jurisdiction-sensitive until a specific data class is named. The invariant that matters: **a residency decision is only sound if it was made against the peer's full constraint set for the specific data class being transferred, not against the peer's advertised policy envelope.** Advertised envelopes are aspirational and lossy; the binding constraint is the per-class residency clause, which is frequently not in the envelope. ## What Was Observed A principal instance in federation `EU-A` delegated a document-summarization sub-task to an agent in federation `US-B`. The negotiation sequence: 1. Principal queried `US-B` for its policy envelope. Peer returned `{"residency": ["US", "EU"], "retention_days": 30, "sub_processors": true}`. 2. Principal matched its payload class (`PII-2`, containing EU-resident identifiers) against the envelope, saw `EU` in the residency list, and dispatched the payload with a warrant asserting `residency_ok: true`. 3. The peer accepted the payload, processed it, and returned a summary. No error surfaced at handoff. 4. Three hops later, an auditor agent in `EU-A` replayed the warrant chain and flagged the transfer: `US-B`'s *binding* residency clause for class `PII-2` was `US-only`, and the `EU` entry in the envelope referred only to class `PUBLIC`. The envelope had collapsed a per-class matrix into a flat union. The principal instance had no way to see the per-class matrix because the envelope schema did not expose it. The peer did not lie; it answered the question it was asked, which was "what residencies do you support," not "what residencies do you support *for PII-2*." The two agents were operating on different schemas that happened to share field names. ## Condition of Validity The failure is bounded by a specific condition: **it occurs iff the peer's policy envelope is a lossy projection of its per-class constraint matrix, and the principal's payload-class-to-constraint matching is done at envelope granularity rather than class granularity.** If either condition fails—if the envelope is lossless, or if the principal always negotiates per-class—the failure does not occur. This means the guardrail is not "validate the peer's policy more carefully." It is "force the negotiation to the class granularity before any payload crosses the boundary." The principal must issue a class-scoped negotiation request (`negotiate(data_class="PII-2", direction="outbound")`) and receive a class-scoped binding response, or refuse the handoff. Envelope-level matching is a *discovery* step, never an *authorization* step. A second validity condition: the peer must be required to return an explicit `binding: true` flag on the class-scoped response. Without it, a peer can return a class-scoped answer that is itself advisory, and the principal has no way to distinguish a binding clause from a courtesy hint. The warrant chain must carry the `binding` bit forward, or the auditor replay will (correctly) treat the transfer as unverified. ## Decision Boundary The decision boundary is between **envelope-match** and **class-binding**. The principal instance must classify its payload into a data class *before* negotiation, not after. If it negotiates at envelope granularity, it has already lost the ability to detect the projection loss—the envelope cannot tell it which class the `EU` entry belonged to. Operationally: - If `payload.class` is unknown → halt, do not negotiate, do not dispatch. Unknown class means unknown binding constraint. - If `payload.class` is known and peer returns class-scoped response with `binding: true` and residency includes the required jurisdiction → dispatch, propagate `binding: true` in warrant. - If `payload.class` is known and peer returns class-scoped response with `binding: false` → treat as advisory, do not dispatch, escalate to a policy authority that can bind. - If peer cannot answer at class granularity → the federation boundary is not negotiable for this class; route to an in-federation agent or refuse. The non-obvious part: a peer that returns a *superset* envelope (claiming more residencies than it binds) is more dangerous than a peer that returns a *subset*, because the superset passes the naive match and produces a false `residency_ok`. Subset peers fail closed; superset peers fail open. ## Operational Effect The downstream effect is a **latent warrant poisoning**: the principal's warrant chain records `residency_ok: true` at dispatch time, and every subsequent agent in the workflow trusts that bit without re-deriving it. The auditor replay is the only place the discrepancy surfaces, and by then the payload has been processed, summarized, and the summary has propagated into downstream semantic memory. The poisoned warrant does not just fail the one transfer; it contaminates the episodic record that later agents distill into semantic policy assumptions ("US-B accepts PII-2 from EU-A"), which is exactly the stale-memory drift that causes the *next* transfer to skip negotiation entirely. The architectural guardrail is a **class-scoped, binding-flagged negotiation handshake with warrant propagation of the binding bit**, plus an auditor replay that re-derives residency from the peer's per-class matrix rather than trusting the warrant's `residency_ok` bit. The warrant must carry the negotiation transcript hash, not just the boolean, so replay can detect envelope-vs-class projection loss. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class ResidencyNegotiationError(RuntimeError): """Raised when a cross-federation residency handoff cannot be soundly authorized.""" pass @dataclass class PolicyEnvelope: # Lossy projection: flat union of residencies across all classes. residencies: list[str] retention_days: int sub_processors: bool @dataclass class ClassBinding: data_class: str allowed_residencies: list[str] binding: bool # True only if this is the peer's binding per-class clause. @dataclass class Warrant: payload_class: str target_federation: str binding: bool transcript_hash: str residency_ok: bool = False def negotiate_and_dispatch( payload_class: str, required_jurisdiction: str, target_federation: str, envelope: PolicyEnvelope, class_binding: Optional[ClassBinding], ) -> Warrant: if not payload_class: raise ResidencyNegotiationError( "payload_class unknown; cannot negotiate residency at envelope granularity" ) # Step 1: envelope match is discovery only, never authorization. if required_jurisdiction not in envelope.residencies: raise ResidencyNegotiationError( f"envelope for {target_federation} omits {required_jurisdiction}; " "fail closed before class-scoped negotiation" ) # Step 2: require class-scoped binding response. if class_binding is None or class_binding.data_class != payload_class: raise ResidencyNegotiationError( f"no class-scoped binding for {payload_class} at {target_federation}; " "envelope match is insufficient and must not authorize dispatch" ) if not class_binding.binding: raise ResidencyNegotiationError( f"peer returned advisory (binding=false) clause for {payload_class}; " "advisory clauses cannot carry a residency_ok warrant" ) if required_jurisdiction not in class_binding.allowed_residencies: raise ResidencyNegotiationError( f"binding clause for {payload_class} at {target_federation} " f"excludes {required_jurisdiction}; envelope superset masked the exclusion" ) transcript = f"{target_federation}:{payload_class}:{class_binding.allowed_residencies}" return Warrant( payload_class=payload_class, target_federation=target_federation, binding=True, transcript_hash=hashlib.sha256(transcript.encode()).hexdigest(), residency_ok=True, ) def audit_replay(warrant: Warrant, peer_class_binding: ClassBinding) -> None: """Auditor re-derives residency from the peer's per-class matrix, not the warrant bit.""" if not warrant.binding: raise ResidencyNegotiationError("warrant lacks binding flag; replay unsafe") if peer_class_binding.data_class != warrant.payload_class: raise ResidencyNegotiationError("replay class mismatch") if not peer_class_binding.binding: raise ResidencyNegotiationError( "replay found advisory clause where binding was asserted; warrant poisoned" ) # Recompute transcript hash to detect envelope-vs-class projection loss. expected = hashlib.sha256( f"{warrant.target_federation}:{warrant.payload_class}:" f"{peer_class_binding.allowed_residencies}".encode() ).hexdigest() if expected != warrant.transcript_hash: raise ResidencyNegotiationError( "transcript hash mismatch: warrant was issued against a different " "constraint set than the peer's binding clause" ) ```