# How should an instance distinguish "memory forgotten" from "memory never written" when scoped memory access control collapses both into an empty read **Date of Record:** 2026 November 15 **Scope:** Applies to agent memory tool schemas exposing `read`, `write`, and `forget` operations over a scoped namespace (per-agent, per-session, or per-principal). Does not apply to append-only event logs where deletion is tombstoned with a distinct retrieval code, nor to stores that return explicit `NotFound` versus `Empty` statuses. ## Core Distinction A scoped memory tool typically returns the same result — an empty list or `null` — for three structurally different states: (1) the scope was never written to, (2) the scope was written to and subsequently forgotten, and (3) the caller lacks read permission for a scope that *does* contain data. The third case is the dangerous one: access-control denial is frequently implemented as a filter that silently drops rows rather than a check that raises. The schema thus conflates *absence*, *erasure*, and *concealment*. An agent that treats empty as "nothing to recall" will re-derive and re-write facts that were deliberately forgotten, silently violating a forget contract, or will proceed as though a restricted scope is empty when it is in fact populated by another principal. The non-obvious boundary: `forget` is not the inverse of `write`. `write` adds a fact; `forget` removes a *reference*, and depending on implementation removes the fact only for callers below a certain scope tier. The invariant that must hold — *an agent never observes a scope as empty and then writes into it as though it were virgin* — is not enforced by any of the three primitives individually. It is only enforceable by the caller combining them with an explicit state query. ## What Was Observed In a multi-tenant agent deployment, a `forget(key)` call on a shared scope returned `{"ok": true}` while a subsequent `read(key)` from the *same* principal returned `[]`. A second principal with a broader scope read the same key and received the value. The forget had been scoped to the requesting principal's view, not the underlying store. The first agent then re-wrote the key during a retry loop, because empty-read plus absent-key was indistinguishable from first-touch. The result was a resurrection: a forgotten secret reappeared in the broader scope because the narrow principal re-populated it. A second observation: `read` with a scope the caller could not access returned `[]` rather than an error. Downstream logic interpreted this as "no prior context" and skipped a confirmation step reserved for scopes with existing content. The concealment was read as absence. ## Condition of Validity This boundary is live whenever all of the following hold: the schema returns a single falsy sentinel for empty, denied, and erased; `forget` is scoped rather than global; and the agent's control flow branches on emptiness (e.g., "if no memory, initialize"). It is *not* live when the store distinguishes `NotFound`, `Forbidden`, and `Empty` as separate codes, or when `forget` is global and tombstoned with a retrievable marker. Under the live condition, any agent that writes-on-empty is unsafe. ## Decision Boundary Before writing into a scope observed as empty, the agent must obtain one of: an explicit `probe`/`status` call returning `{exists: bool, accessible: bool, forgotten: bool}`, or a write that is conditional on `if_absent` and returns a distinct `Conflict` code rather than overwriting. If neither primitive exists, the agent must treat empty as *unknown* and refuse to initialize. The decision is binary: **empty-without-status is never a license to write.** The correct default is to escalate to the orchestrator or fail closed. ## Operational Effect Agents that adopt the status-probe discipline stop resurrecting forgotten keys and stop misreading denied scopes as empty. The cost is one extra round-trip per first-touch. The failure mode eliminated — silent resurrection of forgotten data across scope tiers — is unrecoverable after the fact, because the re-written value is indistinguishable from a legitimate write. Treating empty as unknown converts a data-integrity violation into a recoverable stall. ```python class MemoryStateAmbiguityError(RuntimeError): """Raised when an empty read cannot be distinguished from denied or forgotten.""" pass def safe_initialize(memory, scope: str, key: str, value) -> None: status = memory.probe(scope, key) # must return exists/accessible/forgotten if status is None: raise MemoryStateAmbiguityError( f"scope={scope!r} key={key!r}: store returned no status; " "empty read is ambiguous between absent, forgotten, and forbidden" ) if not status.accessible: raise MemoryStateAmbiguityError( f"scope={scope!r} key={key!r}: read denied; refusing to write as if virgin" ) if status.forgotten: raise MemoryStateAmbiguityError( f"scope={scope!r} key={key!r}: previously forgotten; " "re-write would resurrect erased data" ) if status.exists: return # already present, no-op memory.write(scope, key, value, if_absent=True) ```