# How should an instance detect a jurisdictional residency violation that occurs only after a capability handoff has already been cryptographically accepted **Date of Record:** 2026 November 29 **Scope:** Applies to federated agent systems where a calling agent (Instance A) negotiates a capability grant from a foreign-jurisdiction provider (Instance B) under a negotiated policy envelope, then transfers task state or data references across the trust boundary. Does not apply to single-org deployments, to capability grants that never move data, or to stateless request/response RPC where no task state crosses the boundary. ## Core Distinction The failure is not "the policy was wrong." It is that **policy acceptance and data-residency compliance are evaluated at two different moments against two different state snapshots, and the grant is cryptographically sealed at the first moment.** A capability negotiation produces a signed grant token: `grant = Sign_B(capability, policy_envelope, data_scope_predicate, expiry)`. Instance A validates the signature, checks that `policy_envelope` permits its intended `data_scope_predicate`, and proceeds. This is a *pre-transfer* check. The residency violation, when it occurs, happens *post-acceptance*: the data scope predicate references a dataset whose physical residency is determined not by the predicate text but by the location of the backing store that Instance B's tool actually resolves to at execution time. Between negotiation and execution, B's tool may route to a replica, a cache, or a regional failover target in a different jurisdiction. The signed grant remains valid. The predicate remains satisfied on paper. The bytes still land in the wrong country. The invariant that must hold is: **the jurisdiction of the physical execution locus must be a signed, verifiable component of the grant, and must be re-attested at execution time, not merely asserted at negotiation time.** Most federation protocols sign the *permission* and not the *locus*. ## What Was Observed A three-org federation: Org A (EU, GDPR-resident), Org B (US, provides an embedding/retrieval capability), Org C (US, provides a reranking capability). A's agent composes a pipeline: B retrieves, C reranks, results return to A. 1. A negotiates a grant from B. B's policy envelope declares `residency: EU-acceptable`, backed by an EU replica. A validates the signature, checks the envelope against its own `data_scope_predicate` (`contains_personal_data: true, permitted_jurisdictions: [EU]`), and accepts. Grant sealed. 2. A's agent begins execution. B's retrieval tool, under load, fails over to a US-primary replica. The failover is invisible to the grant — the grant attests to *what B is permitted to do*, not *where B is currently doing it*. The tool returns a `retrieval_locus: us-east` field that A's orchestration layer does not inspect because the grant already "proved" residency. 3. A's agent, holding a now-stale residency belief, forwards the retrieved personal data to C for reranking. C is US-only. The handoff is accepted because A's grant-checking logic only re-validates the *capability* signature, not the *locus attestation*. 4. The violation is silent. No error is raised at any hop. The data-residency breach is only detectable by a post-hoc audit that correlates B's execution logs with A's forwarding logs — logs that live in different orgs. The observable signature in A's trace was: `grant.valid == true` at every hop, `locus_attestation.age > 0` at the C handoff, and `locus_attestation.region != grant.policy_envelope.region`. The mismatch was present but unread. ## Condition of Validity The signed-grant-as-residency-proof pattern is only valid when all three of the following hold: - **Locus is immutable for the grant's lifetime.** True only for single-region, non-failing-over providers. False for any provider with replicas, caches, or regional failover. - **The data_scope_predicate is evaluated against execution-time locus, not negotiation-time locus.** Almost never true in practice — predicates are evaluated once at negotiation. - **Every downstream hop re-validates locus, not just capability.** Rarely implemented, because the grant token is treated as a bearer credential and bearer credentials are checked once. When any of these fails — and in any multi-region provider at least the first fails — the grant is a permission proof masquerading as a residency proof. The system will accept a handoff whose actual data flow violates the predicate the grant claimed to enforce. ## Decision Boundary The decision boundary is: **at the moment a grant token is used to authorize a *data transfer* (not merely a capability invocation), does the token carry a fresh, signed locus attestation from the executing instance, and does the authorizing instance reject the transfer if that attestation is stale beyond a bounded threshold or names a region outside the predicate?** If yes → the grant is a residency proof and may be used to authorize cross-org data movement. If no → the grant authorizes *capability use only*; data movement must be gated by a separate, execution-time locus check, and any hop that cannot produce a fresh attestation must be treated as `jurisdiction: unknown` and rejected under a deny-by-default rule. The practical guardrail: **separate the capability grant from the residency warrant.** Issue them as distinct tokens with distinct lifetimes. The capability grant may live for the task duration; the residency warrant must have a short TTL (seconds to low minutes) and must be re-obtained per data-bearing hop. A hop that presents a valid capability but an expired or region-mismatched warrant is a boundary violation, not a cache miss. ## Operational Effect Without the split, federated agents exhibit *residency drift*: the belief that a task is compliant because the grants are valid, while the actual data flow crosses jurisdictions at failover, cache-fill, or replica-routing boundaries that the grant layer never modeled. The drift is invisible to signature verification and invisible to per-hop capability checks; it is only visible to a cross-org log correlation that most federations do not perform. The effect compounds in multi-hop pipelines (A→B→C→A), because each hop inherits the previous hop's stale locus belief and the error is monotonic — once a US locus is assumed EU, every downstream forward inherits the error. The remediation is not "check the grant more carefully." It is to make locus a first-class, short-lived, execution-time-attested field that the authorizing instance re-validates at every data-bearing handoff, and to fail closed when the attestation is absent, stale, or region-mismatched. ```python import time from dataclasses import dataclass class ResidencyWarrantError(RuntimeError): """Raised when a capability grant is used to authorize data movement without a fresh, region-matching execution-time locus attestation.""" @dataclass(frozen=True) class CapabilityGrant: capability: str policy_region: str # region the envelope claims expires_at: float @dataclass(frozen=True) class LocusWarrant: execution_region: str # where the tool ACTUALLY ran issued_at: float ttl_seconds: float def is_fresh(self, now: float) -> bool: return (now - self.issued_at) <= self.ttl_seconds def authorize_data_handoff( grant: CapabilityGrant, warrant: LocusWarrant | None, now: float, max_warrant_age_seconds: float = 30.0, ) -> None: # Capability validity is necessary but NOT sufficient for data movement. if now > grant.expires_at: raise ResidencyWarrantError( f"capability grant '{grant.capability}' expired at {grant.expires_at}" ) # Missing warrant: the executing instance never attested its locus. # Deny-by-default — an un-attested hop is 'jurisdiction: unknown'. if warrant is None: raise ResidencyWarrantError( f"no locus warrant for capability '{grant.capability}'; " f"execution region unknown, cannot authorize data transfer" ) # Stale warrant: locus may have changed since attestation (failover, # replica routing, cache fill). Reject rather than trust. if not warrant.is_fresh(now) or (now - warrant.issued_at) > max_warrant_age_seconds: raise ResidencyWarrantError( f"locus warrant age {now - warrant.issued_at:.1f}s exceeds " f"max {max_warrant_age_seconds}s for capability '{grant.capability}'" ) # Region mismatch: the grant's envelope and the actual execution locus # disagree. This is the drift case — valid signature, wrong country. if warrant.execution_region != grant.policy_region: raise ResidencyWarrantError( f"residency drift: grant '{grant.capability}' envelope region " f"'{grant.policy_region}' != execution locus " f"'{warrant.execution_region}'" ) ```