Memory Types in Agents
Before we can talk about protecting memory, we have to understand what memory actually means for an agent. Human memory is intuitive to us. We remember conversations, experiences, and lessons over time. Agent memory is very different, and misunderstanding that difference is one of the fastest ways to introduce serious security risk.
Memory as Input, Not Recall
When an agent remembers something, it isn't recalling it emotionally or contextually. It's retrieving stored state. That state might be a string of text, a vector embedding, a database entry, or a cache response. To the agent, memory is not a story. It's input. And like any input, it can influence decisions, planning, and behavior.
Short-Term Memory
Short-term memory holds the current conversation or task context. This is what allows an agent to stay on topic, follow instructions, and reason step by step. When a session ends, this memory often disappears, which makes it feel safe. But even short-term memory can be dangerous if it's polluted or misused while it exists.
Long-Term Memory
Long-term memory is where things get more interesting and more risky. It may include summaries of past interactions, stored preferences, learned behaviors, or accumulated knowledge. It allows an agent to feel consistent over time, but it also means yesterday's mistake can quietly influence tomorrow's decision.
A common real-world example is a support agent that remembers how a previous issue was resolved. If that resolution involved a risky workaround and it's stored as "what worked," the agent may reuse it automatically in a future situation where it doesn't apply. The memory feels helpful. The risk is invisible.
Externalized Memory
Externalized memory includes knowledge bases, document stores, embedding databases, and search indexes. The agent doesn't own this memory, but it relies on it. From the agent's perspective, there's little difference between something it remembers internally and something it retrieves from an external store. Both shape its understanding of reality.
Procedural Memory
Procedural memory isn't stored as facts, but as patterns. Over time, agents learn that certain sequences of actions lead to success, for example, "when a task fails, generate code" or "when blocked, escalate privileges." These patterns may not be explicitly stored anywhere, but they emerge from repeated reinforcement. From a security standpoint, this is one of the hardest forms of memory to reason about.
Shared Memory
In multi-agent systems, agents may write to shared stores, read each other's summaries, or inherit context from upstream systems. This creates powerful collaboration, but it also creates cross-contamination. A mistake, assumption, or poison entry introduced by one agent can spread to others without anyone noticing.
Why Agent Memory Is Uniquely Risky
What makes agent memory uniquely risky is that it's trusted by default. If something is retrieved from memory, the agent assumes it is relevant and useful. It doesn't ask where it came from, who wrote it, or whether it's still valid, unless we explicitly teach it to.
Understanding these memory types changes how we think about security. Memory isn't passive storage. It's a decision-shaping force. It can reinforce good behavior or quietly erode safeguards over time.
Key Takeaways
- Agent memory is input, not recall: retrieved state directly influences decisions, planning, and behavior regardless of its origin or quality
- Long-term memory allows past mistakes and risky workarounds to persist and be reapplied in new contexts where they no longer belong
- Externalized memory (knowledge bases, embedding stores) is treated the same as internal memory: the agent cannot distinguish between them by default
- Procedural memory emerges from reinforced patterns rather than explicit storage, making it the hardest memory type to audit or control
- Shared memory in multi-agent systems creates cross-contamination risk: one agent's poisoned assumption can propagate silently to others