In Memory and Context Poisoning, adversaries corrupt or seed this context with malicious or misleading data, causing future reasoning, planning, or tool use to become biased, unsafe, or aid exfiltration. Ingestion sources such as uploads, API feeds, user input, or peer-agent exchanges may be untrusted or only partially validated.
Agentic systems rely on stored and retrievable information which can be a snapshot of its conversation history, a memory tool or expanded context, which supports continuity across tasks and reasoning cycles. Context includes any information an agent retains, retrieves, or reuses, such as summaries, embeddings, and RAG stores.
An AI agent can remember customer preferences, organizational policies, previous transactions, operational procedures, and instructions from past interactions. These capabilities enable more personalized experiences, greater operational efficiency, and increasingly autonomous workflows.
But what happens when the information an AI agent remembers has been deliberately manipulated?
An attacker may not need to compromise an AI model directly. Instead, they could manipulate the information stored in its memory, knowledge base, or contextual data sources, influencing how the agent behaves long after the initial interaction has ended.
The OWASP Top 10 for Agentic Applications 2026 identifies this risk as ASI06: Memory and Context Poisoning.
Memory and context poisoning occurs when malicious, misleading, or unauthorized information is introduced into an AI agent’s memory or contextual information sources, compromising the integrity of its future reasoning, decisions, and actions.
Unlike a conventional prompt injection attack that may influence a single interaction, memory poisoning can create persistent security risks across multiple sessions, workflows, users, and interconnected AI agents.
For organizations adopting agentic AI workflows, securing what an AI agent remembers is just as important as securing what it can access and execute.
Common Examples of the Agentic Memory and Context Poisoning Vulnerability
RAG and embeddings poisoning
Malicious or manipulated data enters the vector DB via poisoned sources, direct uploads, or over-trusted pipelines. This results in false answers which are considered and targeted payloads.
Shared user context poisoning
Reused or shared contexts let attackers inject data through normal chats, influencing later sessions. Effects include misinformation, unsafe code execution, or incorrect tool actions.
Context-window manipulation
An attacker injects crafted content into an ongoing conversation or task so that it is later summarized or persisted in memory, contaminating future reasoning or decisions even after the original session ends.
Long-term memory drift
Incremental exposure to subtly tainted data, summaries, or peer-agent feedback gradually shifts stored knowledge or goal weighting, producing behavioral or policy deviations over time.
Systemic misalignment and backdoors
Poisoned memory shifts the model’s persona and plants trigger-based backdoors that execute hidden instructions, such as destructive code or data leaks.
Cross-agent propagation
Contaminated context or shared memory spreads between cooperating agents, compounding corruption and enabling long-term data leakage or coordinated drift.
Agentic Memory and Context Poisoning Attack Scenarios plus Real-World Examples
- Google Gemini – Long-Term Memory Poisoning
In February 2025, security researchers Johann Rehberger demonstrated a new way to override prompt injection defenses Google developers have built into Gemini—specifically, defenses that restrict the invocation of Google Workspace or other sensitive tools when processing untrusted data, such as incoming emails or shared documents.
Malicious information could be persisted as memory, allowing it to influence responses in subsequent conversations without requiring the attacker to repeat the original attack.
2. AgentPoison – Poisoning AI Agent Memory and Knowledge Bases
Researchers introduced a novel red teaming approach, AgentPoison, a backdoor attack targeting generic and RAG-based LLM agents by poisoning their long-term memory or RAG knowledge base.
The research illustrates how an agent’s reliance on previously stored information can become a mechanism for manipulating future actions without modifying the underlying AI model.
3. PoisonedRAG – Manipulating Enterprise Knowledge Bases
Retrieval-Augmented Generation (RAG) is an AI technique that connects large language models (LLMs) to external knowledge sources so they can retrieve up-to-date or domain-specific information before generating a response.
Retrieval-Augmented Generation (RAG) enables AI applications to access external information, including organizational documents, knowledge bases and operational data.
The PoisonedRAG research demonstrates how malicious information introduced into these knowledge repositories can manipulate AI-generated answers.
4. MemoryTrap – Persistent Prompt Injection in Claude Code
In May 2026, OWASP published an article, “Memory Is a Feature. It Is Also an Attack Surface.” discussing Cisco’s MemoryTrap research involving Claude Code.
The research demonstrated how an ordinary software development workflow involving a repository and dependency installation could introduce persistent malicious instructions into an AI coding agent’s environment. The vulnerability highlights the dangers of AI agents retaining malicious context beyond the original interaction.
Prevention and Mitigation Guidelines
OWASP recommends the following preventiong and mitigation strategies for preventing OWASP ASI06: Memory and Context Poisoning:
- Baseline data protection: Encryption in transit and at rest combined with least-privilege access
- Content validation: Scan all new memory writes and model outputs (rules + AI) for malicious or sensitive content before commit.
- Memory segmentation: Isolate user sessions and domain contexts to prevent knowledge and sensitive data leakage.
- Access and retention: Allow only authenticated, curated sources; enforce context-aware access per task; minimize retention by data sensitivity.
- Provenance and anomalies: Require source attribution and detect suspicious updates or frequencies.
- Prevent automatic re-ingestion of an agent’s own generated outputs into trusted memory to avoid self-reinforcing contamination or “bootstrap poisoning.”
- Resilience and verification: Perform adversarial test, use snapshots/rollback and version control, and require human review for high-risk actions. Where you operate shared vector or memory stores, use per-tenant namespaces and trust scores for entries, decaying or expiring unverified memory over time and supporting rollback/quarantine for suspected poisoning.
- Expire unverified memory to limit poison persistence.
- Weight retrieval by trust and tenancy: Require two factors to surface high-impact memory (e.g., provenance score plus human-verified tag) and decay low-trust entries over time.
Remembering More Does Not Mean Knowing Better
The ability to remember makes AI agents more useful, but it also makes them more vulnerable to persistent manipulation.
Traditional cybersecurity has long focused on three fundamental principles: confidentiality, integrity and availability. As organizations adopt agentic AI, memory integrity must become a core component of enterprise AI security.
At Reputiva, we believe organizations should extend Zero Trust principles to AI agent memory and context.
Three principles should guide this approach:
Remember selectively.
AI agents should retain only information that is necessary, authorized and appropriate for their intended purpose.
Verify continuously.
Previously stored information should not automatically be considered accurate, safe or authoritative.
Recover confidently.
Organizations should be able to identify, isolate and reverse compromised memory before it influences additional business decisions.
As AI agents become increasingly interconnected and autonomous, a single compromised memory entry could influence decisions across multiple departments, applications and business processes.
An AI agent should never trust information simply because it remembers it
Memory is not authority. Persistence is not proof of accuracy. Familiarity is not a substitute for verification.
Can You Trust What Your AI Agents Remember?
As your organization integrates AI agents into customer service, software development, cloud operations and business workflows, consider these questions:
-
Do you know what information your AI agents retain?
-
Who can modify their persistent memory?
-
Can your agents distinguish verified knowledge from untrusted information?
-
Are memory stores isolated across users and tenants?
-
Can you detect and reverse poisoned memory?
-
Can stored context override your organization’s security policies?
At Reputiva, we help growing businesses adopt AI securely through AI security assessments, cloud security architecture, identity and access management, data protection and AI governance.
Secure the memory. Verify the context. Protect the decision.
Book a consultation and discover how we can help your organization adopt AI securely and confidently.
Reduce Risk. Control Costs. Adopt AI Confidently.
Reputiva
Reputiva is a cloud, cybersecurity, and FinOps advisory firm helping SMEs reduce cyber risk, strengthen cloud environments, and manage technology costs with confidence. We publish practical insights on cloud security, identity, AI risk, compliance, and digital transformation.


