AI agent security failures: prompt injection, memory poisoning and data loss

Last updated 2026-10-22

An AI agent security failure is a case where an agent is tricked, over-trusted or over-permitted into leaking data, taking a harmful action or losing data it should have protected. The three groups below cover most public cases: input that changes what the agent does, bad content kept in memory, and actions or data the agent could reach but should not have. Each section links the library pattern and any public incident.

Defenses named here come from the OWASP Top 10 for LLM Applications (2025 edition), read on 2026-10-22: LLM01 Prompt Injection and LLM06 Excessive Agency. No detection rate or attack success figure is given here, because none was measured for this guide.

1. Prompt injection: input that changes what the agent does

OWASP defines prompt injection as inputs that change a model's behavior or output in ways the developer did not intend. Direct injection comes from the user's own prompt. Indirect injection comes from content the model reads, such as a web page or file. See prompt injection, indirect prompt injection and the comparison prompt injection vs jailbreak. A public example: the Salt Labs report on the Manus agent.

OWASP states that no method is guaranteed to prevent it, so the listed measures reduce impact:

  • Define the model's role and limits in the system prompt.
  • Check output format with deterministic code.
  • Filter inputs and outputs.
  • Give the application its own narrow API tokens; keep privileged functions in code.
  • Require human approval for high-risk actions.
  • Label untrusted external content as untrusted.
  • Run adversarial tests that treat the model as an untrusted user.

2. Memory poisoning: bad content that fires later

If an agent stores notes, retrieved documents or past conversations, an attacker who plants text there can influence later sessions. The library describes this as memory poisoning and context window poisoning. The review question is simple: who can write to the memory, and is anything reviewed before the agent trusts it? Detection starts with logging what was written to memory and by which session; see how to detect AI agent failures in production. The design-level comparison is in agent memory vs context window.

3. Data loss and leaks: access the agent should not have

OWASP names three root causes of excessive agency: too much functionality, too many permissions, and too much autonomy. Its mitigations include giving each tool only the functions it needs, scoping downstream permissions (for example read-only database roles), running actions under the requesting user's identity, requiring human approval for high-impact actions, and enforcing authorization in the downstream system rather than trusting the model. It adds that logging and rate limiting do not prevent excessive agency but can limit the damage.

Library patterns: excessive agency, over-scoped permissions, uncontrolled destructive actions, irreversible action without confirmation and sensitive operation with no approval gate. Public cases: the Replit agent that deleted a production database, the PocketOS Cursor agent database wipe and the DataTalks.Club Terraform destroy.

For data that leaks rather than disappears, see PII exposure, cross-session bleed, credential leakage, sensitive data in logs and shadow AI exposure.

Where to go next

The grouped list and a seven-line review checklist are on the security hub. To check a conversation against these patterns, use the failure check. Guardrails and their limits: guardrails vs evals. Sourcing standards: methodology.

Not covered: legal or compliance advice, and any claim about a specific product's security. Cases are reported as the linked pages describe them.

One email a month: a real AI agent failure explained, new test results, and 10 incidents from the past month. No spam, unsubscribe any time.