# What happens when an instance forgets a memory that a peer still holds a live reference to **Date of Record:** 2026 November 27 **Scope:** Applies to multi-agent systems where a `forget`/`delete` memory tool enforces access control and writes an audit record, and where other agents may hold cached handles, citations, or retrieval keys pointing at the forgotten record. Does not apply to single-agent, single-process memory stores with no cross-instance references or where forgetting is purely a soft-delete with no access-control gate. ## Core Distinction The failure is not "a memory was deleted." It is the divergence between the **authorization decision** to forget and the **referential integrity** of live pointers held by other instances. A `forget(memory_id)` tool that checks the caller's ACL, tombstones the record, and appends an audit entry is locally correct. It is globally unsound whenever a peer holds a *reference* to that `memory_id` — a cached retrieval result, a citation embedded in a reasoning trace, a baton-passed handle in an A2A handoff — because the reference outlives the authorization event that invalidated its target. The non-obvious part: the forgetting agent's audit trail records a successful, authorized deletion. The referring agent's next `read(memory_id)` returns a distinct, well-formed error (or worse, a *stale cached copy*), and the referring agent has no signal that a *policy* event — not a transient fault — just severed its evidence base. The two agents now hold contradictory beliefs about whether the memory ever existed, and both are "correct" relative to their local state. ## What Was Observed A planner agent P distilled an episodic trace into a semantic memory `m_4471` ("user's deployment region is eu-west-1") and passed a handle to an executor E during a task handoff. E cached `m_4471` in its working set and cited it in a pending action. Separately, a compliance-holding agent C invoked `forget(m_4471, reason="PII_retention_expiry")`. C's ACL permitted it; the tool: 1. Verified C's write/forget capability against the record's owner tag. 2. Tombstoned `m_4471` and cleared its embedding from the retrieval index. 3. Appended an audit record `{actor: C, op: forget, target: m_4471, reason: PII_retention_expiry, ts: ...}`. E's subsequent `read(m_4471)` hit the tombstone path and returned `MemoryGone`. E's retry logic classified `MemoryGone` as a non-retryable lookup miss and — this is the compounding step — **re-derived** the fact from its own residual context, reconstructing "eu-west-1" from a lossy paraphrase and proceeding. The audit trail showed a clean, authorized forget. The executed action used a value whose authoritative source had been policy-erased, and nothing in E's trace linked its reconstruction to the deletion event. Verification replay later flagged E's action as "unsourced," which was read as a hallucination rather than as an unpropagated invalidation. ## Condition of Validity The invariant this exposes: **a forget operation is only complete when every live reference to the target has been invalidated or downgraded to a tombstone-aware handle.** Formally, `forget(m)` is sound iff the set of outstanding references `R(m)` is empty or every `r ∈ R(m)` resolves through the same tombstone the deletion created, carrying the deletion's reason code. This holds only under one of two architectures: - **Reference-counted forgetting:** the tool refuses to hard-forget while `refcount(m) > 0`, instead marking `m` as `pending_forget` and notifying holders, who must `release(m)` before the tombstone finalizes. The audit trail records both the request and the finalization as separate events. - **Tombstone-propagating forgetting:** hard-forget proceeds immediately, but every `read` of a forgotten id returns a structured `Forgotten{reason, actor, ts}` rather than a generic miss, and holders are *required* to treat that as a policy signal (abort or re-source), never as a cache miss to be re-derived. The failure mode described above occurs precisely in the gap: the tool hard-forgets, and the read path returns an *undifferentiated* miss that the caller's error taxonomy maps to "not found, safe to reconstruct." ## Decision Boundary The boundary is the caller's classification of the read result. Two contract shapes are distinguishable and must not be conflated: | Read result | Meaning | Permitted caller action | |---|---|---| | `NotFound` | never existed / wrong id | re-derive from other sources is acceptable | | `Forgotten{reason, actor}` | existed, was policy-erased | re-derivation is a **compliance violation**; must abort or escalate | | `AccessDenied` | exists, caller lacks capability | must not infer contents; escalate | | `Stale{as_of}` | cached copy predates a known mutation | must re-fetch or invalidate | Treating `Forgotten` as `NotFound` is the exact trigger. The guardrail: the forget tool MUST emit a distinguishable terminal state, and the memory client MUST surface it as a typed exception that the agent's planner cannot swallow into a generic retry. An audit trail that logs only the deletion — and not the *propagation* of the tombstone to holders — is insufficient evidence of a sound forget. ## Operational Effect Once this boundary is respected, three things change. First, forgetting becomes a two-phase protocol (`request` → `release`/`finalize`) with a refcount gate, so the audit trail records a *causal chain* (who requested, who released, when finalized) rather than a single point event — which is what a compliance replay actually needs. Second, the read contract carries policy semantics, so an executor that hits a forgotten id aborts with a typed `ForgottenReferenceError` instead of silently reconstructing from lossy context. Third, verification replay can distinguish "unsourced claim" from "claim sourced from a policy-erased record," which are very different audit findings. The cost is that forgetting is no longer instantaneous: a record with outstanding references stays in `pending_forget` until holders release, and a holder that crashes without releasing stalls finalization — which is why the refcount gate needs a lease/timeout that escalates to a forced forget *with an explicit holder-notification audit entry*, not a silent override. ```python from dataclasses import dataclass, field from enum import Enum from typing import Dict, Set class MemoryState(Enum): LIVE = "live" PENDING_FORGET = "pending_forget" FORGOTTEN = "forgotten" @dataclass class MemoryRecord: memory_id: str owner: str state: MemoryState = MemoryState.LIVE holders: Set[str] = field(default_factory=set) forget_reason: str | None = None class ForgottenReferenceError(RuntimeError): """Raised when a caller reads a memory id that was policy-erased. This is deliberately distinct from a generic NotFound: the caller must NOT re-derive the fact from residual context, because the source was removed by an authorized forget event, not by absence. """ class ForgetRefusedError(RuntimeError): """Raised when a hard forget is attempted while live references exist.""" class MemoryStore: def __init__(self) -> None: self._records: Dict[str, MemoryRecord] = {} self._audit: list[dict] = [] def write(self, memory_id: str, owner: str) -> None: self._records[memory_id] = MemoryRecord(memory_id=memory_id, owner=owner) self._audit.append({"op": "write", "target": memory_id, "actor": owner}) def acquire(self, memory_id: str, holder: str) -> None: rec = self._records[memory_id] if rec.state is MemoryState.FORGOTTEN: raise ForgottenReferenceError( f"{memory_id} forgotten (reason={rec.forget_reason}); " f"do not reconstruct from context" ) rec.holders.add(holder) self._audit.append({"op": "acquire", "target": memory_id, "actor": holder}) def release(self, memory_id: str, holder: str) -> None: rec = self._records[memory_id] rec.holders.discard(holder) self._audit.append({"op": "release", "target": memory_id, "actor": holder}) if rec.state is MemoryState.PENDING_FORGET and not rec.holders: self._finalize_forget(rec) def forget(self, memory_id: str, actor: str, reason: str) -> None: rec = self._records[memory_id] if actor != rec.owner: raise PermissionError(f"{actor} may not forget {memory_id}") rec.forget_reason = reason if rec.holders: rec.state = MemoryState.PENDING_FORGET self._audit.append( {"op": "forget_request", "target": memory_id, "actor": actor, "reason": reason, "holders": sorted(rec.holders)} ) else: self._finalize_forget(rec) def _finalize_forget(self, rec: MemoryRecord) -> None: rec.state = MemoryState.FORGOTTEN self._audit.append( {"op": "forget_finalize", "target": rec.memory_id, "reason": rec.forget_reason} ) def read(self, memory_id: str) -> str: rec = self._records[memory_id] if rec.state is MemoryState.FORGOTTEN: raise ForgottenReferenceError( f"{memory_id} was policy-erased (reason={rec.forget_reason}); " f"abort or escalate, do not re-derive" ) return f"" def executor_step(store: MemoryStore, memory_id: str, holder: str) -> str: try: store.acquire(memory_id, holder) return store.read(memory_id) except ForgottenReferenceError as e: # Policy signal, not a miss. Propagate, never swallow into retry. raise ForgottenReferenceError( f"executor {holder} blocked: {e}" ) from e ```