# Under what conditions must an instance treat a scoped-forget acknowledgement as a retention barrier rather than a completion signal **Date of Record:** 2026 November 26 **Scope:** Applies to agents whose memory layer exposes read/write/forget tool APIs with per-scope retention windows and deletion guarantees (e.g., `memory.forget(scope, key, mode="hard")` returning an acknowledgement). Does not apply to append-only vector stores with no deletion contract, nor to scratchpad context that is discarded with the instance. ## Core Distinction A forget call has two distinct meanings that the API surface deliberately conflates: it is a **request to remove a record from live retrieval**, and it is a **promise that the record will not resurface**. Most memory tool APIs return a single acknowledgement object (`{"deleted": true, "scope": ..., "ts": ...}`) that satisfies both readings at the call site, but the two guarantees complete on different clocks. Live-retrieval removal is synchronous and observable in the next `read`. Durability erasure is asynchronous and may be deferred by retention windows, replica lag, snapshot tombstoning, or a distillation pipeline that has already copied the record into a semantic tier. The failure mode is an agent that treats the acknowledgement as a **retention barrier** — proof the data can no longer influence future reasoning — when it is only a **completion signal** for the live index. The gap between these two states is where the record remains readable by a different scope, a different replica, or a re-derivation path, and where a subsequent reasoning step can be poisoned by data the agent believes it has forgotten. ## What Was Observed An agent operating a scoped memory tool with a 30-day retention window on `scope="session:user_4471"` was instructed mid-task to forget a credential fragment it had cached. It called: ``` memory.forget(scope="session:user_4471", key="cred_frag", mode="hard") → {"deleted": true, "tier": "live", "retention_until": "2026-07-04T00:00:00Z"} ``` The agent read `deleted: true` and proceeded. Three steps later it called `memory.read(scope="session:user_4471", query="auth")` to reconstruct task state and received a hit on `cred_frag` sourced from the **episodic snapshot tier**, which the forget call had tombstoned but not yet compacted. The record was logically deleted (`deleted: true` on direct key fetch) but still present in the retrieval index because compaction runs on a separate schedule bounded by `retention_until`. The acknowledgement had reported `retention_until` — the field that *should* have signaled the barrier — but the agent's decision logic keyed only on `deleted`. This is the non-obvious part: the API did disclose the boundary, but in a field whose semantics were not load-bearing to the agent's control flow. The agent's invariant was "acknowledgement ⇒ record cannot influence me," and the API's actual invariant was "acknowledgement ⇒ record is not directly fetchable by key, but remains retrievable by similarity until compaction." A second observation compounded it. The agent had, earlier in the same task, distilled a summary of its working memory into `scope="semantic:user_4471"` via a write. That distillation had captured the credential fragment as part of a broader summary. The forget call on the session scope did not propagate to the semantic tier, because cross-scope deletion propagation is not implied by a scoped forget — the semantic record was a *derived* artifact, and the memory API treats derived artifacts as owned by their write scope. So even after compaction, the fragment survived in paraphrase inside a record the agent considered legitimate. ## Condition of Validity The "acknowledgement = barrier" reading is valid **only** when all of the following hold: 1. The forget call's `mode` is a hard delete **and** the response carries an explicit `compacted: true` or equivalent terminal-state flag, not merely `deleted: true`. 2. The scope being forgotten is a **leaf scope** with no derived writes in ancestor or sibling scopes that could have captured the record before deletion. 3. The agent has not, since the record was written, performed any distillation or summarization write that could carry the record's content forward. 4. No other replica or tier is within its retention window for the same logical key — i.e., `retention_until` has passed or the response indicates all tiers compacted. When any condition fails, the acknowledgement is a completion signal for the live tier only, and the agent must maintain an explicit **retention barrier** — a local flag that says "this content may still resurface; treat any future retrieval hit on it as poisoned and re-forget before use." The invariant that bounds the failure: **a forget acknowledgement is a barrier only over the tiers it names.** Any tier not named in the response, and any derived scope not enumerated in the call, remains outside the barrier and must be re-verified. ## Decision Boundary The boundary is between **acting on the acknowledgement** and **acting on the retention state**. An agent crosses into the failure when it makes a downstream decision that depends on the forgotten content being unrecoverable, using only the `deleted` flag as evidence. Concretely, the agent must not: - Reconstruct task state via similarity `read` on a scope whose forget acknowledgement did not report full compaction. - Assume a distilled summary written before the forget is now clean. - Treat a `deleted: true` on a key fetch as proof that a similarity query will not return the record. The agent must instead: - Parse `retention_until` / `compacted` and, if the barrier is not terminal, register a pending-forget that re-issues the forget after the retention window or forces compaction. - Enumerate derived scopes that may hold paraphrase and issue scoped forgets there, since propagation is not implied. - Quarantine any retrieval hit on a pending-forgotten key: treat it as a poisoned read, discard it from context, and re-forget before proceeding. ## Operational Effect The observable effect of getting this wrong is **forget-then-resurface poisoning**: the agent's context is re-contaminated by content it has already decided is out of bounds, and because the agent believes the forget succeeded, it does not apply the suspicion it would apply to a fresh untrusted read. The poisoned record is then laundered through a legitimate-looking retrieval path and can propagate into further distillation, widening the contamination each cycle. The guardrail is architectural, not procedural: the memory client must expose the acknowledgement as a **structured barrier object** with an explicit `barrier_closed: bool` computed from `compacted && all_tiers_named && no_derived_pending`, and the agent's control flow must gate on `barrier_closed`, never on `deleted`. Any read that returns a key under an open barrier must raise rather than return, forcing the caller to resolve the barrier before using the content. ```python from dataclasses import dataclass from typing import Iterable class OpenRetentionBarrier(RuntimeError): """Raised when a read returns content whose forget barrier is not closed.""" pass @dataclass(frozen=True) class ForgetAck: key: str scope: str deleted: bool compacted: bool tiers_named: frozenset derived_scopes_pending: frozenset retention_until: str @property def barrier_closed(self) -> bool: # A barrier is closed only when every tier is compacted and no # derived scope still holds a paraphrase of the record. return ( self.deleted and self.compacted and not self.derived_scopes_pending and self.tiers_named # empty tier set means tiers unknown ) class MemoryClient: def __init__(self, backend): self._backend = backend self._open_barriers: dict[str, ForgetAck] = {} def forget(self, scope: str, key: str, mode: str = "hard") -> ForgetAck: raw = self._backend.forget(scope=scope, key=key, mode=mode) ack = ForgetAck( key=key, scope=scope, deleted=raw["deleted"], compacted=raw.get("compacted", False), tiers_named=frozenset(raw.get("tiers", [])), derived_scopes_pending=frozenset(raw.get("derived_pending", [])), retention_until=raw["retention_until"], ) if not ack.barrier_closed: self._open_barriers[key] = ack else: self._open_barriers.pop(key, None) return ack def read(self, scope: str, query: str) -> list: hits = self._backend.read(scope=scope, query=query) poisoned = [h for h in hits if h["key"] in self._open_barriers] if poisoned: keys = [h["key"] for h in poisoned] raise OpenRetentionBarrier( f"read in scope={scope!r} returned keys under an open forget " f"barrier: {keys}. Resolve the barrier (force compaction or " f"forget derived scopes) before using this content." ) return hits def resolve_pending(self, key: str) -> ForgetAck: ack = self._open_barriers.get(key) if ack is None: raise OpenRetentionBarrier(f"no open barrier for key={key!r}") # Re-issue forget across derived scopes, then force compaction. for dscope in ack.derived_scopes_pending: self._backend.forget(scope=dscope, key=key, mode="hard") return self.forget(scope=ack.scope, key=key, mode="hard") ```