# Why does an instance read a federated memory record it is not scoped to when the scope predicate is evaluated against a stale namespace snapshot? **Date of Record:** 2026 November 29 **Scope:** Applies to any agent instance that resolves cross-org read scoping by evaluating a scope predicate against a locally cached namespace manifest, rather than against the authoritative namespace state at read time. Does not apply to single-tenant memory stores or to deployments where scope is enforced by the storage layer itself (row-level security at the backing store). ## Core Distinction The failure is not a permission bypass in the classic sense. The instance is *correctly* evaluating a scope predicate — it is just evaluating it against a namespace manifest that has drifted from the authoritative one. Federated memory namespaces are partitioned by org, and each partition publishes a manifest of `(namespace_id, owning_org, reader_orgs, record_epoch)`. Instances cache this manifest to avoid a cross-org round-trip on every retrieval. When org B revokes org A's read grant on a namespace, the authoritative manifest updates immediately, but A's cached copy does not. A's retrieval loop then admits records from that namespace because the predicate `reader_orgs ∋ A` still evaluates true in the stale snapshot. The non-obvious part: revocation is the dangerous direction, not grant. A stale grant cache fails *closed* (A can't see a namespace it was just granted — annoying but safe). A stale revocation cache fails *open* (A keeps reading a namespace it was just cut off from — a continuity and confidentiality break). Most cache-invalidation designs treat these symmetrically. They are not symmetric in consequence, and the symmetric treatment is the bug. ## What Was Observed A retrieval agent for org A held a manifest cache with a 300-second TTL. Org B revoked A's reader grant on `ns:shared-incident-2025` at T+0. Between T+0 and T+300, A's agent executed eleven retrieval cycles against that namespace and returned records into its working context. The records were then distilled into A's episodic memory and, later, cited in a downstream summary. At T+300 the cache expired, the manifest refreshed, the namespace vanished from A's view — but the distilled memory persisted. The revocation was enforced at the *access* layer and silently defeated at the *memory* layer. The trace: 1. `retrieve(namespace=ns:shared-incident-2025, query=...)` is called. 2. `manifest = cache.get_or_fetch(org=A)`. Cache hit at T+47 → stale entry, `reader_orgs = {A, C}`. 3. Scope predicate `A ∈ manifest[ns].reader_orgs` → `True`. Request proceeds. 4. Backing store returns records. Records enter context window. 5. Records are summarized and written to A's local episodic store with `source_namespace` and `epoch` metadata — but no `grant_epoch`. 6. At T+300, manifest refreshes: `reader_orgs = {C}`. Access is now denied. 7. The distilled episodic entries are never re-validated. They are now orphaned reads that persist indefinitely. The invariant that broke: *a memory record derived from a federated namespace must carry the grant epoch under which it was admitted, and must be re-validated against the authoritative manifest before it is re-surfaced.* Without that, revocation is a one-time access cut, not a continuity cut. ## Condition of Validity The stale-read window is bounded and the failure is preventable only if all of the following hold: - The manifest is cached at all (if scope is resolved against the authoritative manifest per read, no window exists — at the cost of a cross-org round-trip per retrieval). - TTL-based invalidation is used rather than push-based invalidation. With push invalidation (org B publishes a revocation event to subscribers), the window collapses to propagation latency. - The derived memory does not carry grant-epoch provenance. If it does, downstream re-validation catches the orphan at re-surface time even if the original read slipped through. If any of these is false, the analysis does not apply. In particular, a deployment that resolves scope per-read has no stale window and needs no grant-epoch provenance — but pays a latency tax on every retrieval, which is usually why teams cache in the first place. ## Decision Boundary The choice is between three positions, and the boundary between them is the revocation window you are willing to tolerate: | Strategy | Revocation window | Cost | |---|---|---| | Per-read authoritative manifest | ~0 | one cross-org RTT per retrieval | | TTL cache + grant-epoch provenance on derived memory | ≤ TTL at access, ~0 at re-surface | provenance plumbing + re-validation pass | | TTL cache only | ≤ TTL at access, **unbounded at re-surface** | none — and this is the failure | The third row is where most federated-memory deployments land by default, because provenance plumbing is invisible work and the failure only manifests after a revocation that someone cares about. The decision boundary is: *if derived memory outlives the manifest cache TTL, you must carry grant-epoch provenance.* The TTL is the wrong unit to reason in. The relevant unit is the lifetime of the distilled memory, which is typically "forever." The guardrail is not "shorten the TTL." A shorter TTL narrows the access window but does nothing for the orphaned derived memory. The guardrail is: stamp every admitted record with `(source_namespace, grant_epoch)`, and on every re-surface of derived memory, verify `grant_epoch` is still ≥ the authoritative manifest's current epoch for that namespace. If the namespace no longer lists the reader org, the derived record is quarantined, not silently served. ## Operational Effect Without the guardrail, a single revocation produces a permanent, invisible contamination of the reading org's memory. The records look like any other distilled memory; nothing in the episodic store marks them as out-of-scope. Downstream agents citing them have no way to know. The failure is only discovered when someone audits `source_namespace` against current grants — which, in practice, happens after an incident, not before. With the guardrail, the revocation window is bounded to the TTL at access, and the orphaned-memory problem is closed at re-surface. The cost is a re-validation pass on every derived-memory read, which is cheap if the manifest is already cached and the check is a set membership test. The deeper lesson: in federated memory, *access* and *continuity* are separate enforcement points, and revocation must be enforced at both. An instance that only enforces at access will pass every access-control test and still leak revoked data through its own memory. The scope predicate is not the invariant. The invariant is that no derived memory outlives the grant that admitted it. ```python from dataclasses import dataclass from typing import Optional class StaleGrantAdmissionError(RuntimeError): """Raised when derived memory is admitted under a grant epoch that the authoritative manifest no longer honors for the reading org.""" pass @dataclass(frozen=True) class DerivedRecord: source_namespace: str grant_epoch: int payload: str def admit_derived_record( record: DerivedRecord, reader_org: str, authoritative_manifest: dict, ) -> DerivedRecord: """Re-validate a derived record against the authoritative manifest before re-surfacing it. This is the re-surface guardrail; it is NOT the access check and must not be collapsed into it.""" entry = authoritative_manifest.get(record.source_namespace) if entry is None: raise StaleGrantAdmissionError( f"namespace {record.source_namespace!r} no longer published; " f"record admitted under epoch {record.grant_epoch} is orphaned" ) if reader_org not in entry["reader_orgs"]: raise StaleGrantAdmissionError( f"org {reader_org!r} not in reader_orgs for " f"{record.source_namespace!r}; grant revoked after epoch " f"{record.grant_epoch}" ) if entry["record_epoch"] > record.grant_epoch: raise StaleGrantAdmissionError( f"record epoch {record.grant_epoch} predates authoritative " f"epoch {entry['record_epoch']} for {record.source_namespace!r}; " f"re-validation required" ) return record def resurface( records: list[DerivedRecord], reader_org: str, authoritative_manifest: dict, ) -> list[DerivedRecord]: admitted, quarantined = [], [] for r in records: try: admitted.append(admit_derived_record(r, reader_org, authoritative_manifest)) except StaleGrantAdmissionError: quarantined.append(r) return admitted ```