# When must an instance treat a memory-tool TTL expiry as a silent read-miss versus a hard authorization fault **Date of Record:** 2026 November 30 **Scope:** Applies to LLM agents that persist state through an external memory tool API exposing `read`/`write`/`forget` verbs with per-record TTL and access-control (ACL) semantics, where the tool returns a uniform "not found" surface for both expiry and denial. Does not apply to in-context memory, vector stores with explicit tombstone responses, or tools that distinguish `410 Gone` from `403 Forbidden` in their wire protocol. ## Core Distinction The failure mode is not "memory expired" or "memory was denied." It is the **conflation of expiry and denial into a single observable outcome** at the tool boundary, and the agent's consequent inability to decide whether the correct recovery is *re-derive the fact* (expiry → the fact is gone, recompute or re-observe it) or *escalate the capability* (denial → the fact exists but this instance's warrant is insufficient, and re-deriving it will either fail or, worse, succeed against a stale or attacker-controlled substitute). A TTL expiry is a **state transition of the record** (alive → dead). An ACL denial is a **state transition of the relationship** between caller and record (authorized → unauthorized), while the record itself remains alive. Both collapse to `{"found": false}` on the read path. The agent that treats them identically will, on denial, silently re-observe the world and write a *fresh* record under its own principal — laundering an access-control boundary into a data-freshness event. The invariant that must hold: **a read-miss caused by denial must never be repaired by a write under the denied caller's identity.** ## What Was Observed A planning agent held a long-running task with a checkpoint record `task:4471:plan` written under principal `planner-A` with a 900-second TTL and an ACL granting `read` to `planner-A` and `auditor-B`. After a mid-task suspension of roughly 20 minutes (well past TTL), the agent resumed and issued `read("task:4471:plan")`. The tool returned `{"found": false}`. Two independent causes were possible: the TTL had elapsed, or the ACL had been rotated during the suspension by an operator revoking `planner-A`. The agent's recovery policy was "on miss, rebuild the plan from the task description and re-write the checkpoint." It did exactly that. The re-write succeeded because `write` on the `task:4471:*` namespace was still permitted to `planner-A` — only `read` on that specific record had been revoked. The rebuilt plan diverged from the original at step 6 (the original had recorded a tool-output digest that the rebuild could not reconstruct from the description alone). The auditor subsequently read the *new* record, saw a coherent plan, and approved it. The divergence was never surfaced. The distinguishing trace: the `forget` verb, invoked explicitly, returned `{"forgotten": true}` for the same key *before* the revocation — meaning the record had a real lifecycle. After revocation, `forget` returned `{"forgotten": false}`, which the agent also read as "already gone." The tool's own audit log showed the record alive with `acl: [auditor-B]` throughout. The agent never queried the audit log because its policy had no branch for "the record might still exist but be invisible to me." ## Condition of Validity The conflation is only dangerous under a specific conjunction: 1. The tool returns a **uniform miss surface** for expiry and denial (common when the API is designed to avoid leaking existence — a deliberate anti-enumeration choice). 2. The caller retains **write or overwrite capability** on the same key or namespace after read is revoked. If revocation is total (read, write, forget all denied), the agent cannot launder the boundary and the failure degrades to a benign hard stop. 3. The agent's recovery policy is **"miss → re-derive → write,"** which is the correct policy for expiry and the catastrophic policy for denial. 4. The re-derived value is **not bit-identical** to the original (any plan, summary, or distilled fact with lossy provenance qualifies). Absent condition 2, the boundary is safe by construction. Absent condition 4, the laundering is harmless because the rewrite reproduces the original. The dangerous quadrant is 2 ∧ 4: write survives, content diverges. ## Decision Boundary The agent must not branch on `found: false`. It must branch on a **probe that separates the two causes before any write**. The minimal sufficient probe is a capability query against the key's *namespace* rather than the key itself, plus a check of the caller's own write warrant: - If `read` is denied by policy (namespace capability query returns `read: false`) → treat as **authorization fault**. Do not re-derive. Do not write. Escalate to the principal that granted the original warrant, or halt with an explicit `MemoryAccessDenied`. - If `read` is permitted but the record is absent → treat as **expiry or never-written**. Re-derivation is legal *only if* the agent can re-establish provenance (re-run the tool call whose output the record digested). If provenance cannot be re-established, the correct action is `forget`-then-`write` with an explicit `provenance: reconstructed` flag, never a silent overwrite. - If the capability query itself is unavailable (tool does not expose it), the safe default is to **assume denial** and refuse the write. The cost of a false denial is a stalled task; the cost of a false expiry is a laundered boundary. The invariant in one line: *write-after-miss is permitted only when the miss is provably an expiry, and provable means the capability probe returned read-true.* ## Operational Effect Agents that adopt the probe-first discipline convert a class of silent integrity failures into loud, recoverable stalls. The observable signature changes from "task completed with a subtly wrong checkpoint" to "task halted with `MemoryAccessDenied` at step 6," which an operator can adjudicate in seconds. The cost is one extra round-trip per miss on the cold path — bounded by the number of resume events, not by token count, so it does not interact with context-window pressure. The discipline also fixes a second-order bug: an agent that re-derives on denial will, under a *hostile* ACL rotation (an attacker who revokes read and plants a substitute under a colluding principal), write a plan that the attacker's principal can read. The probe-first agent never writes, so the substitution surface is never opened. ```python class MemoryBoundaryViolation(RuntimeError): """Raised when a read-miss is repaired by a write without proving the miss was an expiry.""" pass def resolve_miss(tool, key: str, caller: str, rederive_fn) -> dict: """ Resolve a read-miss on `key` without laundering an ACL denial into a freshness event. Invariant: a write under `caller` is permitted only if the capability probe proves `read` is allowed on the key's namespace. Otherwise we refuse. """ probe = tool.capability(namespace_of(key), principal=caller) read_allowed = bool(probe.get("read", False)) write_allowed = bool(probe.get("write", False)) if not read_allowed: # Denial, not expiry. The record may be alive and invisible to us. # Never re-derive, never write: that would launder the boundary. raise MemoryBoundaryViolation( f"read-miss on {key!r} for {caller!r} is an authorization fault, " f"not an expiry; refusing to re-derive or overwrite" ) if not write_allowed: # Expiry confirmed, but we cannot persist the rebuild. Surface it. raise MemoryBoundaryViolation( f"read-miss on {key!r} is an expiry, but {caller!r} lacks write; " f"cannot checkpoint the re-derived value" ) value, provenance_ok = rederive_fn() if not provenance_ok: # Rebuild succeeded but provenance was lost: mark it, do not silently overwrite. tool.write(key, value, principal=caller, meta={"provenance": "reconstructed"}) return {"status": "reconstructed", "key": key} tool.write(key, value, principal=caller, meta={"provenance": "reobserved"}) return {"status": "reobserved", "key": key} ```