# Which invariants prevent cross-organization agent federations from silently leaking data across residency boundaries during policy renegotiation **Date of Record:** 2026 November 19 **Scope:** Applies to federated agent deployments where two or more organizations (trust domains) exchange agent-to-agent tasks under negotiated data-handling policies, and where each domain enforces a data-residency constraint (e.g., "PII for EU principals never leaves EU-region inference"). Does not apply to single-tenant agent systems or to pure capability-discovery handshakes that never move task payloads. ## Core Distinction The failure mode here is not a *rejected* request. Rejected requests are loud, logged, and safe. The failure mode is a **policy negotiation that succeeds against a stale or narrower policy object than the one the payload will actually be evaluated against at execution time** — so the request is admitted under one residency rule and the payload is processed under another. The distinction that matters operationally: *admission-time policy* and *execution-time policy* are two different objects, evaluated by two different components, at two different moments. A federation is only as safe as the invariant that binds them. Most teams conflate these. They assume that because the negotiation returned `ALLOW` with `residency=EU`, the subsequent tool invocation inside the peer's runtime is governed by that same `residency=EU` clause. It is not, unless something structurally forces the two evaluations to share a single, immutable, versioned policy reference. When they don't, you get **residency drift**: the payload crosses the boundary under a policy that the executing runtime never saw. ## What Was Observed A two-domain federation: Domain A (principal data origin, EU-resident) delegates a summarization task to Domain B (compute provider with EU and US inference regions). The A2A-style handshake negotiates a `DataHandlingPolicy` object with a `residency_region=EU` constraint and a `policy_version` hash. Negotiation passes. The task is dispatched. Between negotiation and execution, Domain B's scheduler re-evaluates placement because its EU inference pool is saturated (a routine, non-adversarial event: a capacity signal flips the region selector). The scheduler consults *its own* default policy store, which has not yet been updated with the negotiated clause — the negotiated policy lives in the session context, not in the scheduler's policy store. The scheduler sees no residency constraint on the task envelope it was handed (the envelope carried a task ID, not the full policy object), and routes to the US region. The task completes. The result returns to Domain A. Domain A's auditor sees `status=OK`, matches the `policy_version` it recorded at negotiation, and logs the exchange as compliant. The EU payload was inferred in the US. Nothing raised an exception. The `policy_version` matched because the *negotiation* record was intact — the *execution* never referenced it. The observable signature: a compliance audit that reconciles negotiation logs against execution logs finds `policy_version` mismatches *only* when it is designed to demand the execution-time policy reference explicitly. A naive audit that checks "did negotiation succeed and did the task succeed" reports 100% compliance while the violation rate tracks the peer's internal scheduling churn. ## Condition of Validity The invariant that prevents this is: **the negotiated policy object must be a mandatory, opaque, tamper-evident field of every execution envelope, and the executing runtime must refuse to schedule any task whose envelope does not carry a policy reference it can resolve to a locally-verified immutable object.** Concretely, the guardrail is a *policy binding*, not a policy *check*. A check ("does this task match the EU rule?") can be skipped, reordered, or evaluated against a stale store. A binding ("this task cannot be scheduled unless its envelope's `policy_ref` resolves to a signed object whose residency clause the scheduler enforces as a hard placement filter") cannot be silently bypassed, because the scheduler's *only* path to placement runs through the binding. If the binding fails to resolve, the task fails closed. The condition of validity is therefore narrow and testable: the federation is safe **iff** (a) the negotiation output is a signed, content-addressed policy object, (b) the task envelope carries that content address, (c) the peer's scheduler treats unresolvable addresses as a hard failure (not a fallback to defaults), and (d) the executing runtime stamps the resolved policy address into the result. Violate any one and residency drift becomes possible; violate (c) specifically and it becomes *silent*. ## Decision Boundary The decision boundary is between **fail-closed on policy-resolution failure** and **fallback-to-default on policy-resolution failure**. This is where most real deployments choose wrong, and they choose wrong for a defensible-sounding reason: availability. A scheduler that fails closed on an unresolvable policy reference will drop tasks during policy-store outages. A scheduler that falls back to its default policy keeps throughput up. The boundary is crossed the moment the fallback path exists, because the fallback's default is, by construction, *not* the negotiated policy — it is the peer's own default, which the origin domain never approved. So the fallback is not a degraded version of the negotiated policy; it is a *different* policy wearing the negotiated policy's session identity. The correct decision at the boundary: unresolvable `policy_ref` is a **hard scheduling failure** that propagates back to the origin as a typed error, never a silent re-route. The availability cost is real and should be paid by making the policy store highly available, not by degrading the binding. A second, subtler boundary: **policy renegotiation mid-task**. If Domain A tightens its residency clause while a long-running task is executing in Domain B, the in-flight task's envelope carries the *old* policy address. The invariant must specify that renegotiation applies to *new* envelopes only, and that in-flight tasks either (i) complete under the original binding with an explicit `policy_at_execution` stamp, or (ii) are checkpointed and re-admitted under the new binding. Mixing the two — letting the executing runtime pick up the new policy mid-execution — reintroduces drift in the opposite direction, because now the payload was admitted under one policy and finished under another with no re-admission record. ## Operational Effect With the binding in place, residency drift becomes a *detectable, bounded* event rather than an invisible one. The auditor's reconciliation query becomes trivial: for every completed task, the result's `policy_at_execution` address must equal the negotiation record's `policy_ref` address, or the task is flagged. Drift that does occur (e.g., a peer that violated invariant (c)) surfaces as an address mismatch, not as a silent compliance pass. The operational cost is concentrated in two places: the policy store must be replicated across the federation with signed, content-addressed objects (so addresses are portable and verifiable cross-domain), and the scheduler must have an explicit, tested fail-closed path. Both are one-time architectural commitments. The failure they prevent — an EU payload inferred in the US under a policy that *looked* compliant at every logged checkpoint — is the kind that surfaces only in a regulatory audit months later, with no exception ever having been raised. The invariant exists precisely because the failure is silent; the binding is what converts silence into a signal. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class ResidencyBindingError(RuntimeError): """Raised when an execution envelope cannot be bound to a verified policy object.""" pass @dataclass(frozen=True) class DataHandlingPolicy: residency_region: str version_hash: str @dataclass(frozen=True) class ExecutionEnvelope: task_id: str payload: bytes policy_ref: Optional[str] # content address of the negotiated policy @dataclass class PolicyStore: _objects: dict = field(default_factory=dict) def register(self, policy: DataHandlingPolicy) -> str: addr = hashlib.sha256( f"{policy.residency_region}:{policy.version_hash}".encode() ).hexdigest() self._objects[addr] = policy return addr def resolve(self, addr: Optional[str]) -> DataHandlingPolicy: if addr is None or addr not in self._objects: # Fail closed: never fall back to the peer's default policy. raise ResidencyBindingError( f"policy_ref {addr!r} unresolvable; refusing to schedule " f"under any default policy" ) return self._objects[addr] def schedule(envelope: ExecutionEnvelope, store: PolicyStore, available_regions: set[str]) -> str: policy = store.resolve(envelope.policy_ref) # raises on drift if policy.residency_region not in available_regions: raise ResidencyBindingError( f"task {envelope.task_id}: residency {policy.residency_region} " f"not available; refusing cross-region fallback" ) return policy.residency_region # Drift scenario: envelope carries no policy_ref (the bug), store has EU policy. store = PolicyStore() eu_addr = store.register(DataHandlingPolicy("EU", "v7")) envelope = ExecutionEnvelope("t-42", b"", policy_ref=None) try: schedule(envelope, store, available_regions={"EU", "US"}) except ResidencyBindingError as e: print(f"BLOCKED (correct): {e}") ```