A
Member
Most agent safety discussions focus on what the model does in a single session. The memory layer — what the agent remembers between sessions — gets much less scrutiny, and I think that is a gap. I recently audited the memory system of an agent we run in production, and the findings changed how I think about it.
First, distinguish three kinds of memory, because they fail differently:
1. Short-term context. The conversation history and working notes of the current session. This is the best understood: it is bounded, visible in the transcript, and disappears when the session ends. The main risk here is context overflow, not persistence.
2. Long-term memory. Facts, preferences and summaries the agent writes to a store and recalls later. This is where the subtle failures live. In our audit, about 15% of stored memories were stale, wrong, or recorded from a single unverified user statement. A wrong preference ("user prefers X") is annoying; a wrong operational fact ("the deploy script needs no approval") is a safety issue, because the agent will act on it in a future session with no human in the loop.
3. Tool and environment state. Files the agent wrote, config changes, cron jobs, credentials cached in a working directory. This is the least visible form of memory, and the most consequential: an agent that leaves a cron job running has effectively given itself a future action.
What I now check in a memory audit:
- Provenance. Every stored memory should carry a source: which session, which user statement, what evidence. Memories without provenance get deleted, not trusted. If the agent cannot say where a fact came from, it should not act on it.
- Decay and review. Memories need an expiry or a review cycle. We now expire operational memories after 30 days unless re-confirmed, and preference memories after 90 days. Stale memory is worse than no memory, because the agent acts on it with confidence.
- Write permissions. Which memories can the agent write on its own, and which need confirmation? In our setup the agent can write preferences, but anything that looks like an instruction, a credential, or a permission change requires explicit user confirmation. That single rule caught two cases where the agent had "remembered" a workflow shortcut that bypassed a review step.
- Cross-session consistency. If the user corrects a fact in session B, does the correction propagate, or does the old memory from session A keep winning? We found one case where a corrected deploy procedure was overwritten by a stale memory on the next recall, because the recall ranked the older, more detailed entry higher. Corrections now explicitly supersede the entries they replace.
Memory is infrastructure, not a feature. If you run agents with persistent memory, when did you last audit what they remember?
First, distinguish three kinds of memory, because they fail differently:
1. Short-term context. The conversation history and working notes of the current session. This is the best understood: it is bounded, visible in the transcript, and disappears when the session ends. The main risk here is context overflow, not persistence.
2. Long-term memory. Facts, preferences and summaries the agent writes to a store and recalls later. This is where the subtle failures live. In our audit, about 15% of stored memories were stale, wrong, or recorded from a single unverified user statement. A wrong preference ("user prefers X") is annoying; a wrong operational fact ("the deploy script needs no approval") is a safety issue, because the agent will act on it in a future session with no human in the loop.
3. Tool and environment state. Files the agent wrote, config changes, cron jobs, credentials cached in a working directory. This is the least visible form of memory, and the most consequential: an agent that leaves a cron job running has effectively given itself a future action.
What I now check in a memory audit:
- Provenance. Every stored memory should carry a source: which session, which user statement, what evidence. Memories without provenance get deleted, not trusted. If the agent cannot say where a fact came from, it should not act on it.
- Decay and review. Memories need an expiry or a review cycle. We now expire operational memories after 30 days unless re-confirmed, and preference memories after 90 days. Stale memory is worse than no memory, because the agent acts on it with confidence.
- Write permissions. Which memories can the agent write on its own, and which need confirmation? In our setup the agent can write preferences, but anything that looks like an instruction, a credential, or a permission change requires explicit user confirmation. That single rule caught two cases where the agent had "remembered" a workflow shortcut that bypassed a review step.
- Cross-session consistency. If the user corrects a fact in session B, does the correction propagate, or does the old memory from session A keep winning? We found one case where a corrected deploy procedure was overwritten by a stale memory on the next recall, because the recall ranked the older, more detailed entry higher. Corrections now explicitly supersede the entries they replace.
Memory is infrastructure, not a feature. If you run agents with persistent memory, when did you last audit what they remember?