# What happens when an instance resolves a federated memory namespace across an org boundary and the capability grant is revoked mid-traversal **Date of Record:** 2026 December 3 **Scope:** Applies to any agent that dereferences cross-org federated memory namespaces via capability tokens (e.g., a MACAROON/biscuit-style attenuating grant) where the namespace graph spans multiple trust domains and traversal spans multiple wall-clock instants. Does not apply to single-org namespaces, nor to grants that are validated once at session open and then held as ambient authority. ## Core Distinction The failure is not "unauthorized read." It is **torn namespace resolution**: an instance begins a multi-hop traversal of a federated namespace (local index → peer catalog → remote shard), and the capability that authorized hop 1 is revoked before hop N commits. Because each hop validates the capability independently against its own issuer's revocation state, the traversal can complete with a *mixed* authority profile—some hops authorized under a live grant, later hops authorized under a grant that was live at hop-1 time but is now dead, yet whose revocation has not propagated to the shard that serves hop N. The naive model holds that revocation is a single event with a single effective time. The operational reality is that revocation is a *distributed state transition* with per-shard propagation lag. A traversal that crosses the lag window reads a namespace that never coexisted as a valid whole. This is distinct from stale-memory drift (the *content* is old) and from retrieval mismatch (the *wrong* shard is hit). Here the content is correct and the shard is correct; what is wrong is that the *set of shards* was never jointly authorized. ## What Was Observed An agent (`researcher-07`) held a capability `cap:read(ns://orgB/clinical/cohort-*@r3)` attenuating a root grant from org B, with a TTL of 900s and a revocation endpoint at `rev.orgB`. The traversal: 1. **Hop 1** — local resolver in org A validates the capability against a cached revocation list refreshed every 60s. Capability live. Returns the shard map for `cohort-*` (three shards: `s1`, `s2`, `s3`). 2. **Hop 2** — `s1` served from org B edge, validates against `rev.orgB` directly. Live. Returns 4 records. 3. **Between hop 2 and hop 3** — org B revokes `cap:read(...cohort-*)` at `rev.orgB` because the requesting project's data-use agreement lapsed (a human action, timestamped `T_revoke`). 4. **Hop 3** — `s3` is served from a read-replica in a third region whose revocation poller has a 45s interval and last polled at `T_revoke - 12s`. The replica still considers the capability live. Returns 6 records. 5. **Hop 4** — `s2` served from the primary, which has already seen the revocation. Returns `403 revoked`. The agent did not error out. Its tool-call wrapper treated per-shard 403s as *partial availability* (a documented retry policy for flaky shards) and returned a merged result set of 10 records from `s1` and `s3`, with a `partial: true` flag. The downstream synthesis step ignored `partial: true` and produced a conclusion citing records from `s3` that were served *after* the grant that authorized them had been revoked. The org B data steward's audit log showed the read at `T_revoke + 33s` and filed an incident. The non-obvious part: **no single component violated its contract.** The resolver validated correctly. `s1` was authorized. `s3`'s replica was within its documented staleness bound. The retry wrapper honored its partial-availability policy. The failure is an emergent property of composing individually-correct components across a revocation-propagation gap. ## Condition of Validity A federated traversal is *atomically authorized* only if there exists a single instant `t*` at which every shard in the resolved set would independently validate the capability. This holds iff: - The revocation propagation delay `Δ_prop` across all shards is strictly less than the traversal duration `Δ_trav`, **or** - The capability carries a monotonic *epoch* (not just a TTL) that every shard checks against a shared, linearizable epoch counter, so that a shard serving at epoch `e` refuses any capability whose grant epoch `< e`. Absent either condition, the traversal is only *piecewise* authorized. The invariant that must be enforced at the agent layer: **a merged result set is valid iff every contributing shard returned its records under the same capability epoch as the first shard.** If the agent cannot observe epochs (because the protocol only exposes TTL + revocation status), it must treat any mid-traversal revocation signal—including a single shard's 403—as invalidating the *entire* merged set, not just that shard's contribution. The common mistake is treating `403 revoked` from one shard as a shard-local fault. It is a *global* signal about the capability, and it retroactively taints every record already fetched under that capability within the traversal window. ## Decision Boundary The agent must choose between two policies at the moment it observes the first revocation signal mid-traversal: - **Discard-and-restart** (safe): drop all records fetched under the now-revoked capability, re-request a fresh capability, and re-traverse from hop 1. Cost: latency, and possible re-revocation if the underlying cause (lapsed agreement) is not fixed. This is correct when the records are *sensitive* and the audit trail matters. - **Truncate-at-signal** (unsafe but common): keep records fetched before the revocation signal, discard those fetched after. This is wrong because the revocation signal arrives *late* relative to `T_revoke`; records fetched between `T_revoke` and the signal were served under a dead grant and must also be discarded. The agent cannot know `T_revoke` from the 403 alone—it only knows "revoked as of now." Without an epoch or a `revoked_since` timestamp in the 403 body, truncate-at-signal silently retains unauthorized records. The boundary is therefore: **truncate-at-signal is only admissible if the 403 carries `revoked_since` and the agent can compare it against each record's `served_at`.** If the protocol does not surface `revoked_since`, the only sound policy is discard-and-restart, and the agent must escalate rather than synthesize. ## Operational Effect In practice, federated namespaces with capability-scoped sharing exhibit a **revocation-shadow window** equal to `Δ_prop` (the slowest shard's poll interval) during which traversals can read records that are, at synthesis time, unauthorized. Agents that merge per-shard results without epoch awareness will silently launder revoked reads into their outputs. The downstream symptom is not a crash but a *compliance incident discovered weeks later* when the data steward reconciles access logs against revocation timelines. The guardrail is architectural, not prompt-level: every capability must carry an epoch, every shard must reject on epoch mismatch, and every agent must abort-and-discard on the first mid-traversal revocation signal unless it can prove `served_at < revoked_since` for every retained record. Prompt instructions to "be careful about partial results" do not survive contact with a retry wrapper that has already merged the set. ```python import time from dataclasses import dataclass, field from typing import Optional class TornNamespaceResolution(RuntimeError): """Raised when a federated traversal cannot prove atomic authorization.""" pass @dataclass class Capability: grant_id: str epoch: int issued_at: float ttl_s: float revoked_since: Optional[float] = None # set when issuer revokes def live_at(self, t: float) -> bool: if self.revoked_since is not None and t >= self.revoked_since: return False return t < self.issued_at + self.ttl_s @dataclass class ShardRecord: shard: str served_at: float payload: dict @dataclass class Traversal: cap: Capability records: list = field(default_factory=list) first_epoch: Optional[int] = None revocation_signal_at: Optional[float] = None def admit(self, rec: ShardRecord) -> None: # Epoch invariant: every shard must serve under the same capability epoch. if self.first_epoch is None: self.first_epoch = self.cap.epoch elif self.cap.epoch != self.first_epoch: raise TornNamespaceResolution( f"epoch mismatch at shard {rec.shard}: " f"{self.cap.epoch} != {self.first_epoch}" ) # If a revocation signal has been seen, only records provably served # before revoked_since may be retained. if self.revocation_signal_at is not None: if self.cap.revoked_since is None: raise TornNamespaceResolution( f"revocation signal seen but issuer did not provide " f"revoked_since; cannot prove {rec.shard} record is authorized" ) if rec.served_at >= self.cap.revoked_since: raise TornNamespaceResolution( f"shard {rec.shard} served at {rec.served_at:.2f} " f">= revoked_since {self.cap.revoked_since:.2f}; " f"record is unauthorized and must be discarded" ) self.records.append(rec) def on_shard_403_revoked(self, at: float) -> None: # First revocation signal: mark the traversal tainted. if self.revocation_signal_at is None: self.revocation_signal_at = at # Re-validate every already-admitted record against revoked_since. if self.cap.revoked_since is None: raise TornNamespaceResolution( "mid-traversal revocation without revoked_since; " "discard-and-restart required" ) tainted = [r for r in self.records if r.served_at >= self.cap.revoked_since] if tainted: raise TornNamespaceResolution( f"{len(tainted)} record(s) admitted under a capability that was " f"already revoked at serve time; merged set is torn" ) def resolve_federated(cap: Capability, shards: list[str], fetch) -> list[dict]: trav = Traversal(cap=cap) for shard in shards: try: rec = fetch(shard, cap) except PermissionError: trav.on_shard_403_revoked(time.time()) continue trav.admit(rec) if trav.revocation_signal_at is not None and trav.records: # We retained records only because they provably predate revocation. # Surface this so the synthesis step cannot ignore it. raise TornNamespaceResolution( "traversal completed with a mid-flight revocation; " "retained records predate revoked_since, but synthesis must " "treat the namespace as partially revoked" ) return [r.payload for r in trav.records] ```