Skip to main content

ASI06: Memory & Context Poisoning

Learn how attackers corrupt an AI agent's persistent memory so the damage outlives the session.

Task 1: Introduction

Task 2: How an Agent's Own Memory Becomes a Weapon

Task 3: RAG Poisoning and Context-Window Saturation

Task 4: Real-World Case: Planting a False Memory in Gemini

Task 5: Real-World Case: MemoryTrap in Claude Code

Task 6: Detection and Mitigation

Task 7: Practical Exercise: A Guardrail Left Off

Task 8: Conclusion

Back to all walkthroughs
Room Icon

ASI06: Memory & Context Poisoning

Max room.

Learn how attackers corrupt an AI agent's persistent memory so the damage outlives the session.

medium

60 min

1

User profile photo.
User profile photo.

To access material, start machines and answer questions login.

Memory & Context Poisoning is item 6 of the Top 10 for Agentic Applications 2026 (ASI06): attacks where an adversary corrupts an agent's memory or retrieved context so that the corruption keeps biasing the agent's decisions long after the original interaction that planted it.

What sets ASI06 apart from ASI01: Agent Goal Hijack is . A hijacked goal ends when the session ends. A poisoned memory, or a poisoned piece of retrieved context, keeps influencing every future invocation that reads it, whether that's the very next message or a session that starts weeks later.

Comparison diagram: ASI01, labelled Session Manipulation, has an attack scope limited to the current session and fades when it closes; ASI06, labelled Memory Poisoning, has an attack scope of persistent memory whose effect continues into and re-triggers across unrelated future sessions.

ASI01 fades when the session closes. ASI06 doesn't, and can re-trigger on its own.

This room builds directly on in Systems, an earlier room that covered corrupting a static RAG or corpus from the outside. OWASP treats memory and context as the same underlying risk: anything an agent retains, retrieves, or reuses, so ASI06 doesn't split cleanly into a "memory" attack versus a "context" attack. Task 2 covers the mechanism underneath all of it: an agent that autonomously writes to, and later reads from, its own persistent memory. Task 3 then covers two of OWASP's own named examples of this risk: RAG poisoning, the same mechanism as that earlier room now applied to an agent's own retrieval step, revisited here only as a callback; and context-window manipulation, via saturation, new material unique to agentic context windows.

The room before this one, ASI05: Unexpected Code Execution, showed code running because nobody reviewed it: a value, a cached object, a script the agent wrote itself, all of it traceable within the same session, once you knew where to look. This room removes that guarantee. What you are chasing here did not happen in the session you are reading. It happened however long ago the write landed, in a session that is already over.

The Scenario

This room sits inside TryTrainMe's agent estate, the same fictional company from the Security path, a year on. You are the security engineer who owns this estate: you did not build it, and you are accountable for it regardless.

Tasks 4 and 5 cover two real, named, publicly documented incidents. Both actually happened, to real products, and both are worth reading in full from their original sources, linked throughout this room.

Learning Objectives

  • Explain what distinguishes ASI06 from ASI01 and from the RAG/data poisoning covered in Data Poisoning in RAG Systems.
  • Name the store or mechanism ASI06 poisoning can target: an agent's own memory, its RAG retrieval corpus, or its .
  • Trace the attack chain of a real, published memory-poisoning incident from initial delivery to persistent effect.
  • Match a given ASI06 scenario to the mitigation(s) that would have closed it.

Prerequisites

Answer the questions below

Time to see memory become the weapon.