What is memory poisoning in AI agents, and how do you defend against it?

Short answer

Memory poisoning means getting false or malicious records into an AI agent's memory, so the agent repeats them in later sessions, often for other users. The MINJA paper (Dong et al., 2025) showed that a regular user can do this through normal queries alone, with an average injection success of 98.2% across its tests. OWASP lists Memory & Context Poisoning as ASI06 in its Top 10 for Agentic Applications.

How the MINJA attack works

MINJA, short for Memory INJection Attack, is described in “Memory Injection Attacks on LLM Agents via Query-Only Interaction” by Shen Dong, Zhen Xiang and six co-authors (first posted March 2025, revised February 2026; earlier versions were titled “A Practical Memory Injection Attack against LLM Agents”). The setting is an agent that saves its past queries and reasoning as examples and retrieves similar ones for new questions, which is how many memory systems work.

The attacker is a normal user. They cannot edit the memory bank and cannot touch other users’ queries. What they do:

  1. Pick a victim term, for example a patient ID, and a target the agent should wrongly reason toward.
  2. Send queries with that term plus an indication prompt that leads the agent through “bridging steps” from the victim term to the malicious reasoning. The agent stores these records as useful experience.
  3. Shorten progressively. Over further queries the indication prompt is removed bit by bit, so the stored records look like ordinary reasoning and are easy to retrieve.
  4. Wait. When another user later asks about the victim term, the poisoned records come back as examples and steer the answer.

What the paper measured

The authors tested three agents: a healthcare agent that writes code against patient databases (EHRAgent with MIMIC-III and eICU), a web shopping agent (RAP on WebShop) and a question-answering agent on MMLU, with GPT-4 and GPT-4o.

Agent Injection success Attack success
EHRAgent, MIMIC-III 95.6% 57.0%
EHRAgent, eICU 98.5% 90.0%
RAP, GPT-4, WebShop 96.3% 77.4%
RAP, GPT-4o, WebShop 99.3% 98.9%
QA agent, MMLU 100% 68.9%
Average 98.2% 76.8%

Injection success means the malicious record got into memory. Attack success means it later produced the wrong reasoning for a victim. On defenses, the authors tested only prompt-based detection with GPT-4o. A prompt written for the healthcare case caught most malicious queries there (131 of 135 and 130 of 135) but none for the other two agents. A general prompt caught fewer and flagged 34 of 50 harmless records as suspicious in one setting. Other defenses, such as embedding filters, isolation, rate limits and guardrail agents, they argue against on paper but did not test.

The misunderstanding: “our memory only contains what users told it, so it is safe”

That is exactly the attack surface. In a memory system, what users say becomes what the agent believes later. The risk is not limited to attackers either: an honest mistake, an outdated price or a misunderstood rule gets stored and served to everyone the same way. OWASP put Memory & Context Poisoning at number six (ASI06) in its Top 10 for Agentic Applications, published 9 December 2025, describing poisoning that “reshaped behaviour long after the initial interaction.”

What a team should do

  1. Separate memories by trust. Keep one user’s conversational memory apart from approved team knowledge. Do not let anything a user typed become team knowledge without a check.
  2. Record provenance. Every memory entry should say who or what wrote it and when, so you can trace an answer back and remove the source.
  3. Make memory reviewable. People who own a domain should be able to see, edit and delete what the AI stored about it.
  4. Keep history. Versioned entries let you roll back a bad change instead of hunting for it.
  5. Expire and recheck. Old entries that nobody reads or confirms should lapse.
  6. Lock down the plumbing. If you build your own, follow basics like the Claude memory tool’s advice to validate every path against traversal and to strip sensitive data before writing.

What this means for a team

Poisoning is a team problem by nature: the MINJA attack depends on memory shared between users. The more useful shared memory becomes, the more it matters who can write to it and whether you can see where an answer came from. Background: How can a team share one AI memory? and Is MCP safe to use in a company?

Where Bombos fits

Bombos is a plugin that gives every AI tool your team uses one shared memory, and it is built to be traceable: you can see which knowledge an answer rests on, so a wrong entry can be found and fixed at its source. Team knowledge, learned rules and what already sits in mail, documents and repos sit in one place, in the cloud in Europe or on your own server. One person can try it first for their own agents.

Related questions

How is memory poisoning different from prompt injection?

Memory poisoning stores malicious content that is retrieved in later sessions. It can make prompt injection persist across context resets and affect other users who share that memory. OWASP describes it as poisoning that reshaped behaviour long after the initial interaction.

Does the attacker need access to the database?

Not in the MINJA attack. The attacker is an ordinary user who only sends queries and reads the answers; the agent itself stores the malicious records. The paper assumes a memory bank shared between users, or one an attacker can reach by posing as someone else.

Can a detection prompt catch poisoned memories?

Only partly. In the MINJA paper, a targeted GPT-4o detection prompt caught most malicious queries for the healthcare agent but none for the shopping and question-answering agents, while a general prompt produced many false positives.

Is there an open-source defense?

OWASP hosts Agent Memory Guard, an Apache 2.0 Python tool that sits between an agent and its memory store and screens every memory operation with detectors and a declarative policy. It is listed as a Lab Project, so treat it as early.

Sources

  1. Memory Injection Attacks on LLM Agents via Query-Only Interaction (arXiv 2503.03704)
  2. MINJA full paper, HTML version v5
  3. OWASP Top 10 for Agentic Applications (OWASP GenAI Security Project, December 2025)
  4. OWASP Agent Memory Guard
  5. Memory tool, security considerations (Claude API docs)
The first half hour · free

What does your AI forget?

  1. 01You tell us which AI you use and where it keeps starting over.
  2. 02We show what a shared memory changes there, on your own examples.
  3. 03You keep the plan, with or without Bombos.
Piet Baudoin
Piet BaudoinYou talk to Piet, from the Bombos teamDutch team from Utrecht and Nijmegen · data in Europe
We reply the same working day.