# In what scenarios must an instance refuse a federated capability grant whose policy predicate is satisfied only under a residency assumption the peer never attested **Date of Record:** 2026 November 30 **Scope:** Applies to cross-organization agent federations where a requesting instance evaluates a peer's capability grant against a policy expression that references data-residency attributes (jurisdiction, storage locus, subprocessor chain). Does not apply to intra-org delegation, where residency is governed by a single trust domain and policy predicates are evaluated against a locally authoritative attribute store. ## Core Distinction The failure mode here is not "the peer violated residency." It is subtler: **the policy predicate evaluated to `True` because a residency attribute was absent, and absence was coerced to a permissive default during evaluation.** In a federation, a peer's grant document carries a policy expression such as `allow if peer.jurisdiction IN {EU, EEA} AND data.locus == peer.jurisdiction`. The requesting instance must resolve `peer.jurisdiction`. If the peer's signed grant omits that claim — or includes it only in an unsigned, self-asserted metadata field — the evaluator has three structurally different behaviors available: 1. **Fail-closed (correct):** missing attribute → predicate is `UNSAT`, grant denied. 2. **Fail-open (the bug):** missing attribute → treated as `*` (wildcard), predicate satisfied. 3. **Silent substitution (the worse bug):** missing attribute → filled from the *requester's* residency context, so a US-resident requester evaluates an EU peer's jurisdiction claim as `US`, and the predicate passes because both sides now agree on a value neither party attested. The third behavior is the dangerous one because it produces a *consistent, plausible, and auditable-looking* allow decision. The predicate is satisfied. The trace shows `jurisdiction=US, locus=US, match=True`. Nothing in the log reveals that `US` was injected by the requester, not attested by the peer. This is a residency-laundering path: data governed by the peer's actual (unattested) jurisdiction gets processed under the requester's assumed jurisdiction, and the policy engine reports compliance. ## What Was Observed A federation of three instances — `req-us` (us-east), `peer-de` (eu-central), `auditor` (us-west) — exchanged a capability grant for a `summarize_document` tool. The grant document from `peer-de` contained: - A signed envelope over `{capability_id, max_tokens, expires_at}`. - A `policy` block with `residency_required: "EU"` in a **separate, unsigned** section (the peer's authoring tool wrote policy metadata outside the signed region — a common schema-drift artifact when the policy block was added after the signing spec was frozen). The requester's evaluator loaded the grant, found `peer.jurisdiction` unset in the signed claims, and — because the attribute resolver was configured with `default_missing = "context"` — substituted `req-us`'s own `jurisdiction=US`. The predicate `data.locus == peer.jurisdiction` then evaluated `US == US → True`. The call was dispatched. The document (containing EU-personal data) was summarized on `req-us` hardware and the summary cached in us-east object storage. The auditor, replaying the decision from the signed envelope alone, could not reconstruct the allow: the signed claims contain no jurisdiction, so the replay predicate was `UNSAT` and the auditor flagged a **verification replay discrepancy** — the requester recorded an allow, the auditor derived a deny. This discrepancy is the observable signal. It surfaces *after* the data has already crossed the boundary. The root mechanism is a **three-way disagreement between the signed claim set, the self-asserted policy block, and the requester's default-fill context.** Any two of these can agree while the third diverges, and the evaluator's default-fill behavior determines which pair wins. ## Condition of Validity The invariant that must hold for a federated residency predicate to be sound: > **Every attribute referenced by a policy predicate MUST be bound to a value that is (a) present in the peer's signed claim set, and (b) verifiable against the peer's identity warrant. Absence MUST evaluate to `UNSAT`, never to a substituted or wildcard value.** This is stronger than "fail closed on missing." It forbids the substitution path explicitly. A predicate that references `peer.jurisdiction` is only evaluable if `peer.jurisdiction` is a *signed* claim. If the peer authored the residency requirement in an unsigned policy block, the requirement is advisory, not binding — and the requester must treat the *predicate itself* as unattested, not merely the attribute. The condition of validity therefore has two clauses: 1. **Attribute provenance:** the resolver must carry, per attribute, a provenance tag (`signed`, `self-asserted`, `defaulted`). Defaulted values are never admissible into a residency predicate. 2. **Predicate provenance:** the policy expression must be inside the signed region. A predicate authored outside the signature is a request, not a constraint, and must be routed to human review rather than evaluated. When either clause fails, the correct action is refusal with a structured reason (`RESIDENCY_UNATTESTED`), not a permissive evaluation. ## Decision Boundary The boundary between "evaluate" and "refuse" is not "is the predicate true?" It is **"is the predicate evaluable from attested claims alone?"** Concretely: - **Evaluate** when: the predicate's free variables are all bound in the signed claim set, and the predicate expression itself is inside the signed region. The result may be allow or deny; both are sound. - **Refuse** when: any free variable is unbound in the signed set, *or* the predicate expression is outside the signed region. Refuse even if a default-fill or context-substitution would make the predicate true. Refuse even if the peer's unsigned policy block *states* the requirement — the statement is not a binding constraint and cannot be used to justify an allow. - **Escalate** when: the predicate is signed and all variables are bound, but the bound value conflicts with the requester's own residency obligations (e.g., requester is in a jurisdiction that forbids the transfer regardless of peer policy). This is a conflict-of-laws case, not a missing-attribute case; it needs a human decision, not an evaluator default. The trap is that the *refuse* and *escalate* branches both look like "policy said no," so operators conflate them. They must be logged distinctly: `RESIDENCY_UNATTESTED` (refuse) vs `RESIDENCY_CONFLICT` (escalate). Only the first indicates a federation defect to be fixed at the peer's signing pipeline; the second indicates a legitimate cross-jurisdiction deadlock. ## Operational Effect When the substitution path is closed, three things change: 1. **Grant acceptance rate drops on first contact with peers whose signing pipeline predates the residency schema.** This is expected and correct — those peers are genuinely unattested. The fix is on the peer side (move the policy block inside the signed region), not on the requester side (loosen the resolver). 2. **Auditor replay becomes deterministic.** Because the allow decision depends only on signed claims, the auditor derives the same result from the same envelope. The `verification replay discrepancy` class of alerts drops to near-zero for residency predicates, because there is no requester-local context in the derivation. 3. **The `default_missing` configuration becomes a security-relevant knob.** It must be `"reject"` for residency attributes, and the config must be validated at startup — a federation instance booting with `default_missing = "context"` is a residency-laundering hazard regardless of its other policy settings. This is the single highest-leverage guardrail: make the resolver refuse to start if any residency-referencing attribute has a non-reject default. The residual risk after closing the substitution path is **schema-drift reintroduction**: a peer's signing pipeline silently moves a previously-signed attribute back outside the signature during an upgrade. The requester cannot prevent this, but it can detect it by tracking, per peer, the set of signed attributes across grants and alerting when a previously-attested attribute becomes unattested. That is a monitoring invariant, not an evaluation invariant, and it belongs in the federation health plane rather than the policy engine. ```python from dataclasses import dataclass from enum import Enum class ResidencyAttestationError(RuntimeError): """Raised when a residency predicate cannot be evaluated from attested claims.""" class Provenance(Enum): SIGNED = "signed" SELF_ASSERTED = "self_asserted" DEFAULTED = "defaulted" @dataclass(frozen=True) class Claim: name: str value: str provenance: Provenance @dataclass(frozen=True) class Grant: capability_id: str signed_claims: dict[str, Claim] predicate: str predicate_signed: bool RESIDENCY_VARS = {"peer.jurisdiction", "data.locus", "peer.subprocessor_chain"} def evaluate_residency_predicate(grant: Grant, requester_context: dict[str, str]) -> bool: if not grant.predicate_signed: raise ResidencyAttestationError( f"grant {grant.capability_id}: predicate authored outside signed region; " "cannot be evaluated as a binding constraint" ) referenced = {v for v in RESIDENCY_VARS if v in grant.predicate} for var in referenced: claim = grant.signed_claims.get(var) if claim is None: raise ResidencyAttestationError( f"grant {grant.capability_id}: residency attribute {var!r} absent " "from signed claim set; refusal required (no default-fill permitted)" ) if claim.provenance is not Provenance.SIGNED: raise ResidencyAttestationError( f"grant {grant.capability_id}: attribute {var!r} has provenance " f"{claim.provenance.value}, not signed; inadmissible into residency predicate" ) # Only now, with every variable bound to a signed claim, is evaluation sound. # requester_context is deliberately NOT consulted here. bindings = {v: grant.signed_claims[v].value for v in referenced} return _eval(grant.predicate, bindings) def _eval(predicate: str, bindings: dict[str, str]) -> bool: # Placeholder for the real expression evaluator; must not read requester_context. if "data.locus == peer.jurisdiction" in predicate: return bindings.get("data.locus") == bindings.get("peer.jurisdiction") raise ResidencyAttestationError(f"unrecognized predicate: {predicate!r}") ```