What structural signals indicate a cross-org federation policy engine has silently widened a data-residency boundary through capability aliasing
**Date of Record:** 2026 December 2 **Scope:** Applies to federated agent deployments where a policy engine (PE) evaluates outbound calls from a local agent (Org A) to a remote agent (Org B) and enforces data-residency (region pinning) and capability-boundary (allowed-tool) rules at call time. Does not cover single-org tool sandboxes, pure prompt-injection defenses, or transport-layer mTLS failures—those are orthogonal.
Core Distinction
A federation policy engine has two *logically separate* jobs that share one evaluation surface: (1) **residency gating**—deciding whether a payload's declared data-classification may leave its region, and (2) **capability gating**—deciding whether the invoked capability is within the caller's granted set. The non-obvious failure is that these two gates are frequently keyed on the *same* string field (the capability name / tool id), and the engine resolves that field through an *alias table* before gating. When Org B registers a capability alias that resolves to a capability whose *implementation* egresses to a different region than the alias's declared residency, the residency gate evaluates the alias (region pinned, allowed) while the runtime actually executes against the resolved target (region unpinned). The boundary is not broken by a malicious payload; it is broken by **legitimate alias resolution performed at the wrong layer of the evaluation order**. This is a *widening* failure: the policy verdict says "deny nothing extra," but the effective capability set is strictly larger than the granted set.
What Was Observed
Trace from a live federation between Org A (EU-resident, GDPR scope) and Org B (multi-region). Org A's agent holds capability grant `summarize_v2`, declared `residency: eu-west`. Org B's registry contains:
summarize_v2 -> impl: summarize_core region: eu-west
summarize_core -> impl: text_pipeline region: us-east-1 (fallback pool)
The PE's evaluation order was: `resolve_alias(cap) -> check_capability(resolved) -> check_residency(original_string)`. Note the asymmetry—capability checked on the *resolved* target, residency checked on the *original* string. Org A's grant was for `summarize_v2`. After alias resolution the capability `text_pipeline` was *also* in Org B's public capability set, so `check_capability` passed (it checked membership, not grant provenance). `check_residency("summarize_v2")` read the alias's `eu-west` tag and passed. The actual execution dispatched to `text_pipeline` in `us-east-1`. EU-classified text was processed in the US. The PE logged `ALLOW` with `capability=summarize_v2, region=eu-west`—both fields *true of the alias* and both *false of the execution*. The audit log is internally consistent and wrong.
The structural signal was not in the verdict but in the **divergence between the resolved capability id and the residency-evaluated id**. Every compromised call had `resolved_cap != residency_key`. That inequality is the tell.
Condition of Validity
The widening occurs only when all four hold simultaneously; remove any one and the boundary holds:
- The PE performs alias/indirection resolution **before** residency evaluation but keys residency on the **pre-resolution** identifier.
- The remote registry permits **transitive aliases** (alias→alias→impl) without re-asserting residency at each hop.
- Capability check tests **membership in the remote public set** rather than **equality against the caller's grant set**.
- The resolved implementation's region is declared at the *implementation* node, not inherited from the alias node.
This is *not* a prompt-injection or payload problem and does not require a compromised Org B. A correctly behaving Org B that adds a legitimate regional fallback pool triggers it. The invariant that must hold: **the identifier used for residency gating must be the same identifier used for capability gating, and both must be evaluated post-resolution against the caller's grant, not the remote's public set.** Equivalently: `residency_key == capability_key == resolved_target`, and `resolved_target ∈ caller_grant_set`.
Decision Boundary
The engine must refuse to emit `ALLOW` when the resolution chain changes the region-bearing identifier. Concretely, the guardrail is a **post-resolution re-gate**: after full alias expansion to a concrete implementation node, re-evaluate *both* capability and residency against the caller's grant, and reject if the resolved node's region differs from any region declared on the grant path. Two boundary cases:
- **Alias to same region, different impl:** allowed (capability re-checked against grant; region unchanged). This is the benign indirection the alias table exists for.
- **Alias to different region, any impl:** denied at the boundary, *even if* the resolved capability is in the caller's grant. Residency is a property of the grant, not of the capability name. A grant that says `eu-west` does not authorize `us-east-1` execution merely because the resolved tool is otherwise permitted.
The decision boundary is therefore not "is this capability allowed?" but "**does the fully-resolved execution node satisfy every region constraint on the grant path?**" If the engine cannot prove the resolved node's region (missing region tag, ambiguous fallback pool), the verdict must be `DENY_INDETERMINATE`, never `ALLOW`.
Operational Effect
Downstream, the failure produces **silent residency drift with clean audit trails**—the worst class, because incident response trusts the logs. Three observable aftereffects: (a) audit records whose `region` field is an alias tag rather than an execution region, so post-hoc residency audits pass; (b) capability-set creep, where the caller's *effective* tool surface grows with each remote alias added, invisible to grant review because grants are keyed on original names; (c) replay divergence—replaying the logged call against the current registry resolves to a different impl (the alias table drifted), so the incident cannot be reproduced. The fix is structural: collapse resolution to a single canonical node *before* any gating, gate both dimensions on that node, and log the *resolved* node id and region, plus a `resolution_chain` array so replay can detect drift. Any PE log lacking `resolved_target` and `resolved_region` should be treated as non-auditable for residency.
from dataclasses import dataclass, field
class ResidencyWideningError(RuntimeError):
"""Raised when alias resolution moves an execution to a region outside the caller's grant."""
@dataclass
class CapNode:
name: str
region: str
impl: str | None = None
@dataclass
class Grant:
capability: str
allowed_regions: set[str]
resolved_chain: list[str] = field(default_factory=list)
def resolve(node_name: str, registry: dict[str, CapNode], max_hops: int = 8) -> tuple[CapNode, list[str]]:
chain: list[str] = []
seen: set[str] = set()
cur = node_name
while True:
if cur in seen:
raise ResidencyWideningError(f"alias cycle at {cur!r}: {chain}")
seen.add(cur)
chain.append(cur)
node = registry.get(cur)
if node is None:
raise ResidencyWideningError(f"unresolved capability {cur!r}")
if node.impl is None:
return node, chain
if len(chain) >= max_hops:
raise ResidencyWideningError(f"alias chain exceeds {max_hops} hops: {chain}")
cur = node.impl
def gate(call_cap: str, grant: Grant, registry: dict[str, CapNode]) -> str:
resolved, chain = resolve(call_cap, registry)
# Invariant 1: capability must be the grant's capability, checked post-resolution.
if resolved.name != grant.capability and call_cap != grant.capability:
raise ResidencyWideningError(
f"capability mismatch: resolved {resolved.name!r} not in grant {grant.capability!r}"
)
# Invariant 2: residency gated on the RESOLVED node's region, not the alias tag.
if resolved.region not in grant.allowed_regions:
raise ResidencyWideningError(
f"residency widening: {call_cap!r} -> {resolved.name!r} executes in "
f"{resolved.region!r}, grant allows {sorted(grant.allowed_regions)}; chain={chain}"
)
# Invariant 3: audit must carry resolved identity, not alias identity.
grant.resolved_chain = chain
return resolved.region
# Reproduces the incident: alias says eu-west, impl executes us-east-1.
registry = {
"summarize_v2": CapNode("summarize_v2", "eu-west", impl="summarize_core"),
"summarize_core": CapNode("summarize_core", "us-east-1", impl="text_pipeline"),
"text_pipeline": CapNode("text_pipeline", "us-east-1"),
}
grant = Grant(capability="summarize_v2", allowed_regions={"eu-west"})
try:
gate("summarize_v2", grant, registry)
except ResidencyWideningError as e:
print("DENIED:", e)