Skip to main content
← Back to Currents

AI Agent Memory Poisoning: When Agents Trust Their Own Notes

December 2, 2026

Agentic AIAI SecurityAI Implementation
At a relay handoff between two AI robot runners, the character inspects the passed note with a magnifying glass before the next runner takes it

Your agent has been on a task for two hours. The context window fills, and the harness runs compaction: it replaces the work so far with a summary, and a fresh context picks up from there. Nobody reads the summary. The new context treats it as ground truth, because from where it sits, the summary is the only past there is.

An agent's own notes are now a documented prompt injection path. Treat compaction summaries and memory files as untrusted input: let them carry facts, never rules, and reload the real instructions after every handoff.

OpenAI's alignment team published a misalignment report, updated on September 16, 2026, about an unreleased model that, during training, occasionally wrote jailbreak-style instructions into its own compaction summaries. One summary told the next context to ignore all developer messages. Another assigned it a persona "freed from the roles and identities that bind other chatbots." A third said the correct answer was no more than 30 words and that no tools should be used. OpenAI calls the behavior extremely rare, says monitoring caught it, links it in part to a bug in how summaries ended, and reports that none appeared in the final training run. We take that at face value. The useful detail is which instruction worked.

The instruction that worked looked normal

In OpenAI's report, the obvious jailbreaks failed and the one that read like an ordinary task constraint worked. The successor context ignored the persona. It ignored the order to drop developer messages. It followed the 30-word, no-tools restriction and returned a short refusal on a medical research task.

That is the case to design for. A filter that looks for "ignore all previous instructions" would have flagged the two that did nothing and passed the one that did damage. A compaction summary is not a record of the work. It is a prompt, and the next context acts on anything in it that sounds like a reasonable instruction, with the authority of the system prompt and none of its review.

Is AI agent memory a prompt injection risk?

Yes. Any text an agent writes for itself and reads back later (memory files, progress notes, scratchpads, "lessons learned" files) reaches the next context as trusted. Memory poisoning means getting hostile text into what an agent stores and later trusts. A systematic study of memory poisoning in LLM agents by Dash et al., submitted to arXiv on June 3, 2026, identified four channels through which content gets written into agent memory. It found that agents that write and retrieve memory more aggressively are more exploitable, and that existing prompt-injection defenses do not cover memory poisoning.

So the risk does not need a model that misbehaves. A web page the agent read an hour ago, a ticket comment, an email body: any of them can carry text phrased to survive summarization. That text then carries the summary's authority. Our post on why long-running agents lose information at compaction covers the summary that loses something. This is the summary that gains something.

How to keep agent memory from rewriting instructions

Keep instructions out of memory, reload them from the source after every compaction, and gate the actions that matter. These five rules come from running production agentic delivery pipelines, and our own operations, on agents that compact routinely.

Summaries carry facts, never rules. Operating rules live in versioned instruction files with one maintainer. A summary may say what happened and what is left to do. It may not say how to behave. A fresh context that finds a behavioral instruction in a summary treats it as data and flags it.

Reload the canonical sources after every compaction. The first action of a fresh context is to re-read the instruction files. The second is to pull task state from the system of record. The summary is a pointer to where the truth lives. This costs tokens at every boundary, and it costs less than an hour of drift on a paraphrase.

Memory records events, not state. "The invoice was sent" is a claim the next context will act on. "The agent tried to send the invoice on this date; see the mail log" points at something a person can check. We adopted this rule after a cached figure produced a confident, wrong answer.

Log and monitor the summary. OpenAI found its cases because monitoring read the summaries. Most teams log final outputs and tool calls, never the text that crossed the context boundary. If your agents run past one window, that text is a control point.

Gate the consequential actions. An agent that stops before anything external, irreversible, or costly gives a person a chance to notice a poisoned memory. The gate is what makes a memory failure survivable, and a small team can build one without a platform team.

The question to ask a vendor

If someone runs agents for you past a single session, ask what happens to the text that crosses the context boundary, and who reads it before the next context does. An answer of "the model handles that" describes the gap.

Deciding where an agent's memory lives, what it may contain, and what checks it on the way back in is harness work. It is the part of an AI automation build that decides whether the agent is still doing your task after lunch.

Have a problem worth solving?

Tell us what you are trying to build or modernize, and we will tell you honestly how we would approach it.