Join our Newsletter — 33% off our NHI Course
Home› Glossary› Memory Poisoning (ASI06)

Memory Poisoning (ASI06)

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026

An attack where malicious content is injected into an AI agent's memory or context, causing it to alter its behaviour in subsequent tasks, potentially exfiltrating secrets, escalating privileges, or acting against its intended purpose. Because the poisoned content persists, the effect can outlast the original interaction and is hard to spot.

What Memory Poisoning Means in an Agentic System

Memory poisoning is not just “bad input”, it is an attack on the agent’s retained state. Once malicious instructions or fabricated facts are written into memory, they can reappear later as if they were trusted context, which makes the compromise durable, harder to detect, and more dangerous than a single prompt injection.

Because the poisoned content survives the original session, the attacker is no longer relying on one interaction. The agent may later follow the planted instruction during a different task, a different user session, or a different workflow stage, which is why this technique sits in the persistence and abuse part of the agentic attack surface.

This is the same reason AI Agent Memory Security Guide matters: memory is a security boundary, not a convenience feature, and anything written there can become part of future decision-making.

How Poisoned Memory Changes Agent Behaviour

The practical danger is behavioural drift. A poisoned memory entry can bias summarisation, retrieval, planning, or tool selection, so the agent starts acting on attacker-authored context rather than the actual user request. In a well-instrumented system, the change may look like ordinary continuity unless memory provenance and write controls are explicit.

Memory poisoning can also reshape what the agent “remembers” about trust. That can lead to overbroad permissions, unsafe tool use, or disclosure of secrets that were never meant to be part of retained context. The impact is strongest when the memory layer is reused across users, projects, or long-lived assistants.

For that reason, the Agentic AI Security Guide and the OWASP Top 10 for Agentic Applications Guide both treat memory as one element of a wider trust chain, alongside tools, orchestration and identity.

Where Memory Poisoning Tends to Enter

Common entry points include untrusted conversation history, retrieved documents, shared memory stores, profile or preference updates, and indirect prompt injection through content that the agent later indexes or reuses. If the system treats all persisted context as equally trustworthy, the attacker only needs one write path to create a long-lived foothold.

Memory poisoning is especially dangerous in systems that merge user-facing input with internal notes, because the distinction between “user content” and “agent state” becomes blurred. Once that happens, an attacker can hide instructions inside apparently normal text and rely on later retrieval to re-activate them.

The issue is closely related to the patterns discussed in AI Agent Memory Poisoning Guide and Agent Memory Poisoning vs RAG Poisoning, which separate persistent state abuse from retrieval-layer poisoning.

Why Detection and Recovery Are Hard

Memory poisoning is difficult because the malicious content may look legitimate after it has been normalised, summarised, or compacted. The agent may even reinforce the poison by repeating it in later outputs, making the bad state appear self-consistent. That creates a persistence problem: the compromise can survive simple prompt resets.

Detection therefore depends on memory write logging, provenance metadata, and the ability to trace when and why a memory entry was created or reused. Recovery is not just deletion, because removing the poisoned record without scoping its spread can leave copied or derived instructions behind.

The strongest operational references are AI Agent Memory Poisoning Response Playbook and Top 10 AI Agent Monitoring Blind Spots, because both focus on evidence, memory-write visibility, and post-incident review.

Risk and Threat Considerations

Memory poisoning creates durable exposure because it turns a single successful injection into a repeated attack condition. If poisoned memory is reused across sessions or users, the attacker can influence later actions, leak secrets, or steer the agent toward privileged operations long after the original interaction has ended.

Failure mechanism: The attacker writes malicious content into retained memory, then waits for the agent to retrieve that content as trusted context during a later task, where it alters planning, tool use, or output generation.

Impact: The agent may exfiltrate secrets, escalate privileges through unsafe actions, or continue acting on attacker-controlled instructions across multiple tasks, making containment and forensic cleanup significantly harder.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and MITRE ATLAS address the attack and risk surface, while NIST SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI06 — Memory & Context PoisoningDefines persistent memory poisoning as an agentic application risk.
Recommendation — Taint retained agent memory and gate writes to stop poisoned context from shaping later actions.
MITRE ATLASAML.T0080 — AI Agent Context PoisoningCovers persistent instructions planted in agent memory and shared context.
Recommendation — Map poisoned memory to AML.T0080 and hunt for persistence, spread, and context reuse.
NIST SP 800-53 Rev 5AU-2 — Event LoggingLogging is needed to trace memory writes, reuse, and post-incident evidence.
AC-6 — Least PrivilegeLimits what a poisoned memory can influence by constraining privileged actions.
SI-10 — Information Input ValidationInput validation applies to untrusted content before it becomes retained context.
Recommendation — Log memory writes, retrievals, and overwrites so poisoned entries can be traced and reviewed. Restrict agent actions and memory-scoped privileges to reduce blast radius after poisoning. Validate and filter memory writes before untrusted content can persist into future tasks.

Practitioner Guidance

Why practitioners should care: Memory is part of the agent’s control plane, so write permission, retention, and reuse rules need the same discipline as tool permissions. The practical question is not whether the agent can remember, but which memory sources are allowed to influence future authority-bearing actions.

What to watch for: Unexplained behaviour changes after a prior interaction, recurring instructions that do not match the current task, and memory entries that lack clear provenance or approval history. If the agent starts behaving “consistently wrong” across sessions, treat memory as a primary suspect.

Practitioner takeaway: Design memory so that persisted context is reviewable, segmentable, and reversible; otherwise the agent can be steered by state that outlives the original compromise.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org