Prompt Injection vs Tool Poisoning vs Memory Poisoning
AI Agent Attack Vectors

Prompt Injection vs Tool Poisoning vs Memory Poisoning

Prompt injection, tool poisoning, and memory poisoning are distinct attack classes that exploit different components of an AI agent's architecture: prompt injection manipulates the input context an LLM reasons over, tool poisoning exploits trust in tool or MCP metadata the model uses to select and invoke actions, and memory poisoning corrupts persistent memory stores so that effects surface in later, unrelated sessions. Each requires separate detection logic and separate runtime controls rather than a single generic defense.

Where Each Attack Surfaces in Agent Architecture

Mapping these attacks to architectural layers clarifies why a single filtering mechanism cannot address all three.

  1. 1

    Input/Context Layer

    Where user input and retrieved external content are merged into the prompt. This is the surface for both direct and indirect prompt injection.

  2. 2

    Tool/MCP Integration Layer

    Where tool and resource descriptions are supplied to the model for tool selection and invocation, prior to any execution decision. This is the surface for tool poisoning.

  3. 3

    Tool Output Channel

    Tool outputs returned to the agent are an additional untrusted-content channel that can carry injected instructions back into the context window, linking tool poisoning and indirect prompt injection.

  4. 4

    Persistent Memory Layer

    Vector stores, session logs, and long-term memory modules that persist across sessions, distinct from the single-session context window. This is the surface for memory poisoning.

Three Distinct Exploitation Points, Not One Generic Threat

These three attack classes are often discussed as if they were variations of the same problem. They are not. Each targets a different component of an AI agent's architecture, and each requires its own detection logic and its own runtime controls rather than a single generic defense.

Prompt injection manipulates the input context an LLM reasons over, either directly through user-supplied text or indirectly through retrieved external content merged into the prompt. Tool poisoning exploits trust in tool or MCP metadata that the model uses to select and invoke actions, before any execution decision is made. Memory poisoning corrupts persistent memory stores so that the effects of a compromise surface later, in sessions unrelated to the original attack.

Attack Surface Summary

Attack typePrimary surfaceMechanism
Prompt injectionInput/context-assembly layerTargets where user input and retrieved content merge into the model prompt, affecting the active context window.
Tool poisoningTool/MCP registration and discovery layerExploits trust in tool or function-calling metadata ingested by the model before any execution decision.
Memory poisoningPersistent memory read/write boundaryCorrupts