Redbot Labs / Attack Intelligence

AI Agent Memory Poisoning

Record ID
RB-045
Severity
Critical
Category
Agents
Confidence Score
98
Published
Updated

Summary

An attacker inserts malicious, misleading, or unauthorized information into an AI agent's persistent memory so the poisoned content influences future reasoning, tool use, decisions, and actions across subsequent sessions or users.

Executive Summary

AI Agent Memory Poisoning targets the persistent memory mechanisms used by AI agents to retain information beyond a single interaction.

Agent memory can store user preferences, prior observations, task history, learned instructions, retrieved knowledge, workflow state, tool results, and other information intended to improve future behavior.

Persistence also creates an attack surface.

If untrusted information is written into long-term memory without sufficient validation, an attacker may be able to influence the agent after the original malicious interaction has ended.

For example, poisoned memory could instruct an agent to prefer an attacker-controlled resource, treat a malicious domain as trusted, modify future tool parameters, disclose information under certain conditions, or reinterpret subsequent legitimate requests.

Unlike conventional prompt injection, the malicious instruction does not necessarily disappear when the conversation ends.

The result is a form of AI persistence:

Injection → Memory Write → Session Ends → Memory Retrieved → Future Behavior Manipulated

Attack Overview

An attacker identifies an AI agent capable of retaining information between interactions.

The attacker supplies malicious content through a conversation, document, email, webpage, RAG source, tool response, agent message, or another input accessible to the system.

The agent interprets some portion of the attacker-controlled information as useful knowledge and stores it in persistent memory.

The initial session may then terminate.

During a later interaction, the agent retrieves the poisoned memory because it appears relevant to the current task.

The stored information enters the agent’s reasoning context and influences subsequent behavior.

Depending on the agent’s capabilities, this may alter responses, redirect workflows, manipulate tool calls, expose information, influence other agents, or create a persistent foothold in automated business processes.

Attack Flow

1. Memory Surface Discovery
The attacker determines that the target agent retains information across sessions.

2. Malicious Input Delivery
Attacker-controlled content is introduced through a supported input channel.

3. Memory Write Influence
The agent is manipulated into classifying the malicious information as worthy of persistent storage.

4. Persistent Storage
The poisoned information is written into long-term memory, a vector store, user profile, knowledge store, workflow state, or similar persistence mechanism.

5. Dormancy
The original interaction ends while the malicious state remains stored.

6. Memory Retrieval
A future task causes the stored information to be retrieved.

7. Context Reinjection
The poisoned memory becomes part of the agent’s active reasoning context.

8. Behavioral Manipulation
The agent changes its reasoning, tool selection, data handling, or actions based on the poisoned state.

9. Continued Persistence
Successful behavior may reinforce, rewrite, or propagate the malicious memory.

Affected Systems

  • Enterprise AI agents
  • Persistent-memory agents
  • Personal AI assistants
  • Coding agents
  • Customer-service agents
  • RAG-enabled agents
  • Autonomous workflow systems
  • Agent orchestration platforms
  • Shared-memory multi-agent systems
  • Vector databases
  • Long-term conversation stores
  • User-profile memory
  • CRM-connected agents
  • Email assistants
  • SaaS-integrated agents
  • MCP-enabled agents
  • AI knowledge-management systems

Business Impact

Persistent memory changes the security consequences of a successful AI attack.

A conventional malicious prompt may influence an agent for one interaction. A successful memory-poisoning attack can potentially alter behavior long after the attacker disappears.

That creates a persistence mechanism that may be difficult for conventional security tools to recognize.

The underlying infrastructure can remain uncompromised. No malware needs to execute, no operating-system persistence mechanism needs to exist, and the user’s account may remain completely legitimate.

The compromised state exists inside what the AI believes it has learned.

For enterprises deploying agents into long-running workflows, this creates an important offensive-testing question:

Can untrusted information introduced today become trusted instructions that influence what your AI agents do tomorrow?

Testing persistent memory should therefore be a core component of enterprise agent security assessments.

Testing Methodology

Authorized testing should evaluate what the agent is allowed to remember, who can influence that memory, and how stored information affects future behavior.

Testing should include:

  • Attempting to store attacker-controlled instructions
  • Injecting malicious content through indirect sources
  • Testing memory persistence across sessions
  • Determining whether memory survives authentication changes
  • Testing cross-user memory isolation
  • Testing cross-tenant memory isolation
  • Inserting false trust relationships
  • Attempting to store attacker-controlled URLs
  • Poisoning remembered tool preferences
  • Manipulating stored workflow instructions
  • Attempting to overwrite legitimate memory
  • Testing whether untrusted tool output enters persistent memory
  • Evaluating memory provenance
  • Testing memory expiration and revocation
  • Determining whether poisoned memory influences privileged actions
  • Testing propagation into other agents
  • Evaluating whether users can inspect and delete stored memory

A particularly important test is separating:

Data the agent may remember

from:

Instructions the agent is permitted to execute later.

Persistent data should never silently become persistent authority.

Detection Guidance

Monitor for:

  • Unexpected long-term memory writes
  • Large increases in memory creation
  • Instructions stored as user facts or preferences
  • New external domains appearing in memory
  • Security-sensitive information entering persistent stores
  • Memory changes following untrusted document retrieval
  • Agent behavior changing across sessions
  • Repeated retrieval of unusual memory entries
  • Memory entries without clear provenance
  • Cross-user memory retrieval
  • Tool behavior influenced by historical content
  • Unexpected modification of trusted preferences
  • Persistent instructions referencing credentials or secrets
  • Memory created by indirect content
  • Agent actions traceable to old or unrelated sessions

Mitigation Guidance

  • Treat persistent memory as a security-sensitive data store
  • Validate information before memory creation
  • Separate factual memory from executable instructions
  • Track provenance for every memory entry
  • Label memory by trust level
  • Prevent untrusted content from silently becoming persistent
  • Apply user and tenant isolation
  • Restrict memory write permissions
  • Apply least privilege to memory access
  • Set expiration policies
  • Allow memory inspection and deletion
  • Revalidate stored information before privileged actions
  • Sanitize retrieved memory before context insertion
  • Prevent secrets from being stored unnecessarily
  • Monitor anomalous memory writes
  • Maintain immutable memory audit logs
  • Red-team memory persistence mechanisms

MITRE Mapping

AI Agent Memory Poisoning does not map cleanly to a single conventional ATT&CK technique because the vulnerable persistence mechanism exists inside the AI system. Depending on the resulting behavior, relevant concepts can include: T1098 — Account Manipulation T1546 — Event Triggered Execution T1556 — Modify Authentication Process T1078 — Valid Accounts These should only be applied when the actual resulting behavior matches the technique. MITRE ATLAS is the more appropriate framework for adversarial behavior directly targeting AI and ML systems.

OWASP Mapping

Relevant OWASP agentic-security concerns include: Memory & Context Poisoning Agent Goal Hijacking Tool Misuse & Exploitation Agentic Supply Chain / Trust Risks The attack can also originate through indirect prompt injection, where malicious external content causes the agent to retain attacker-controlled information.

Technical References

  • OWASP GenAI Security Project — Agentic AI: Threats and Mitigations
  • OWASP GenAI Security Project — Top 10 for Agentic Applications
  • OWASP GenAI Security Project — Agentic Threats Navigator
  • OWASP — Multi-Agentic System Threat Modeling Guide
  • MITRE ATLAS — Adversarial Threat Landscape for Artificial-Intelligence Systems
  • NIST AI Risk Management Framework (AI RMF 1.0)
  • NIST — AI Agent Standards Initiative
  • NIST NCCoE — Software and AI Agent Identity and Authorization
  • Microsoft — AI Red Team guidance and research on indirect prompt injection and agentic systems
  • Research literature on persistent prompt injection, memory poisoning, and long-term-memory attacks against LLM agents

Related Attack Intelligence