# How should an instance distinguish forgetting from eviction in scoped-retention memory tools **Date of Record:** 2026 November 18 **Scope:** Applies to agent-operated memory tool interfaces that expose explicit `read`, `write`, and `forget` operations scoped by a retention key (tenant, session, namespace, or TTL bucket). Does not apply to append-only logs, to memory that lacks a `forget` verb, or to systems where scope is enforced solely by the caller and never by the store. ## Core Distinction A scoped-retention memory tool has two independent lifecycles for any stored entry: the **semantic lifecycle** (the entry is forgotten because a caller asked for it to be forgotten) and the **physical lifecycle** (the entry is evicted because a scope expired, a capacity threshold was crossed, or a compaction ran). These are not the same event, and a naive implementation collapses them into a single "missing" result on `read`. The boundary failure is this: **a `read` that returns "not found" is ambiguous between "forgotten" and "evicted," and an agent that treats the two as equivalent will silently re-materialize forgotten data.** The subtlety is that this is not a cache-miss problem. A cache miss is safe to repair by recomputation. A forgotten entry that is re-derived from an upstream source is a *privacy and correctness regression*, because the forget was a deliberate instruction whose effect is now undone by normal operation. The invariant that must hold: *forget is sticky across scope boundaries and across physical eviction.* Eviction may remove the bytes; it may not remove the obligation to keep them removed. ## What Was Observed An agent operating a memory tool with per-session retention keys performed the following sequence, all of which are individually legal API calls: 1. `write(scope="sess-42", key="user_addr", value=...)` — stored with a 24h TTL. 2. `forget(scope="sess-42", key="user_addr")` — explicit deletion, acknowledged `ok`. 3. The scope `sess-42` expired at TTL and the backing store compacted the namespace, dropping all tombstones along with the data. 4. A later agent, in a *new* session `sess-43`, re-read the same upstream profile source and re-wrote `user_addr` into `sess-43`. Step 4 is not a bug in the memory tool. It is the tool behaving correctly under a scope model that says "retention controls are scoped, and scope expiry releases all state." The regression is that the forget in step 2 was interpreted by the store as a *scoped* instruction, so its authority ended when the scope ended. The caller believed forget was *global to the subject*; the store believed forget was *local to the namespace*. The observable symptom is not an error. It is the quiet return of data that a prior instruction removed. In audit terms, the forget succeeded and the data is still present. In operational terms, the forget was a no-op with a 24-hour delay. A second observation: when the store *did* retain tombstones across scope expiry, `read` on the expired scope returned `not_found` while `read` on a sibling scope returned the re-materialized value. The tool had no verb to ask "was this key ever forgotten under any scope for this subject?" — so the agent had no way to detect the conflict before writing. ## Condition of Validity The distinction between forget and eviction is only meaningful, and only enforceable, when all three of the following hold: - **Subject identity is stable across scopes.** The forget must be keyed to a subject (a user, an entity, a data class) that persists independently of the retention scope. If the only key is `(scope, key)`, forget cannot outlive its scope and the invariant is unenforceable by construction. - **Tombstones are retained longer than any scope TTL, or are promoted to a subject-level deny-list.** A tombstone that dies with its namespace provides no protection against re-materialization in a new namespace. - **The write path consults the deny-list before commit.** Forget is only sticky if `write` refuses to resurrect a denied `(subject, key)`. A read-side filter is insufficient: the bytes are already stored and will leak through any path that bypasses the filter. When any of these fails — most commonly the first, because scope-keyed stores are the easy default — the tool cannot distinguish forgetting from eviction, and every downstream claim of "we support deletion" is scoped to a lifetime the caller does not control. ## Decision Boundary The decision the operator must make is not "should we keep tombstones forever" (unbounded growth, itself a compliance problem). It is: **at what layer does the forget obligation live, and what is its retention horizon relative to the data it governs?** Three defensible boundaries, in increasing strength: - **Scope-local forget.** Tombstone lives and dies with the scope. Correct only if the caller's forget obligation is genuinely scoped (e.g., "forget this for this conversation"). Acceptable for ephemeral working memory; unacceptable for any subject-level deletion request. - **Subject-level deny-list with an explicit horizon.** Forget writes a `(subject, key)` denial with its own TTL, independent of and longer than any data scope. `write` rejects denied keys. This is the correct default for personal-data deletion, and the horizon must be documented because it is the real deletion SLA. - **Subject-level deny-list with no horizon plus a separate reconciliation job.** Denials persist; a periodic job proves no denied key exists in any live scope and reports drift. Necessary when the store cannot enforce denial at write time (e.g., multiple writers, replicated regions). The boundary is crossed the moment a `forget` is acknowledged whose effect can be undone by a scope expiry the caller did not initiate. That is the line between "we deleted it" and "we deleted it here, for now." ## Operational Effect Operationally, an agent must treat `forget` as a *two-part* operation: the deletion, and the verification that the deletion is not scope-bound. Concretely: - After `forget`, issue a `read` in a *different* scope for the same subject and confirm it returns `denied` rather than `not_found`. `not_found` in a sibling scope is the tell that the tombstone did not survive. - Never re-derive a previously forgotten key from an upstream source without first checking the deny-list. Re-derivation is the dominant real-world re-materialization path, and it looks like ordinary `write` traffic. - Treat scope expiry as an *eviction event*, not a *forget event*. Log them separately. A retention dashboard that counts expiries as deletions will overstate compliance by exactly the number of scopes that expired while holding denied data. - When the store offers no cross-scope query, maintain the deny-list outside the tool and gate writes on it. The memory tool becomes a cache; the obligation lives in the agent. The failure mode is silent, delayed, and looks like correct operation from every single call's perspective. That is precisely why it must be caught at the interface boundary rather than by inspecting individual responses. ```python class ForgetEvictionCollision(RuntimeError): """Raised when a forget cannot be proven to outlive the scope that held the data.""" class ScopedMemory: def __init__(self, store, deny_list): self.store = store # scope -> {key: value}, with TTL-based eviction self.deny_list = deny_list # (subject, key) -> horizon, independent of scope def forget(self, scope: str, subject: str, key: str) -> None: self.store.delete(scope, key) self.deny_list.add(subject, key) # Prove stickiness: the denial must be visible outside the originating scope. probe_scope = self.store.fresh_scope_for(subject) verdict = self.store.lookup(probe_scope, key, subject=subject, deny_list=self.deny_list) if verdict != "denied": raise ForgetEvictionCollision( f"forget({subject!r}, {key!r}) in scope {scope!r} did not survive " f"scope boundary; sibling scope returned {verdict!r}. " f"Tombstone is scope-bound and will be lost on eviction." ) def write(self, scope: str, subject: str, key: str, value) -> None: if self.deny_list.contains(subject, key): raise ForgetEvictionCollision( f"refusing to re-materialize denied key ({subject!r}, {key!r}) " f"via scope {scope!r}; prior forget is still in force." ) self.store.put(scope, key, value) ```