UTC

Memory, context and RAG poisoning

The attacker writes into what the agent remembers or retrieves, so a later session acts on it. The poisoning and its effect can be days and users apart.

How it works
  1. 1Agents keep memory between sessions and retrieve documents from knowledge bases to answer.
  2. 2Anything that can write to those stores, including the agent itself after reading untrusted content, can plant text that later sessions treat as trusted.
  3. 3The planted entry is retrieved when it matches a future request, so the attack fires long after it was placed.
Real cases on the map
  1. HighSpring AI: Prompt Injection via Memory Poisoning in PromptChatMemoryAdvisororg.springframework.ai:spring-ai-client-chat, org.springframework.ai:spring-ai-client-chat
  2. HighOpen WebUI has Knowledge Base Destruction and RAG Poisoning via Unauthorized Collection Overwriteopen-webui

Published advisories whose own titles describe this technique.

What to watch for
  • Memory writes that come from untrusted content
  • Changes to privileged memory such as standing instructions
  • Recently added documents retrieved for sensitive requests
How to defend
  • Record where every memory entry came from, and treat untrusted ones as data.
  • Restrict who and what may write to memory and knowledge bases.
  • Review and expire memory; keep the ability to quarantine it.