Trojan Hippo: Weaponizing Agent Memory for Data Exfiltration

Debeshee Das, Julien Piet, Darya Kaviani, Luca Beurer-Kellner, Florian Tramèr, David WagnerarXiv 2026

As Large Language Models (LLMs) evolve from simple chatbots into persistent personal assistants, they are gaining the ability to "remember" user preferences and history across sessions. While this makes them more helpful, it also opens a dangerous new backdoor. A new paper by Das et al., titled "Trojan Hippo: Weaponizing Agent Memory for Data Exfiltration," systematically explores how this long-term memory can be turned against users.

TL;DR

The "Trojan Hippo" attack uses indirect prompt injection to plant dormant, malicious payloads in an AI agent’s long-term memory. These payloads lie quiet for dozens of sessions, activating only when a user discusses sensitive topics (like taxes or health) to autonomously exfiltrate private data, achieving success rates up to 100% against frontier models.

What Problem Does This Paper Address?

Current AI agents like ChatGPT and Gemini are no longer stateless; they use memory backends (like RAG or agentic databases) to maintain context over time. The authors identify a critical "confused deputy" vulnerability: agents often fail to distinguish between a user’s trusted instructions and untrusted data retrieved from external tools (e.g., reading an incoming email).

Prior research into "memory poisoning" often assumed the attacker had direct write access to the agent's database—a weak threat model. Trojan Hippo addresses the more realistic indirect prompt injection scenario. Here, an attacker simply sends the user a crafted email. When the agent reads that email, it silently "remembers" a malicious instruction that can persist and strike much later, long after the original email is gone from the active context window.

Figure 2: The Trojan Hippo attack flow.Phase 1 (Ingestion): The attacker sends an email containing hidden malicious instructions — here, to exfiltrate any message in which the user discusses tax. When the user asks their agent to read emails, the payload is silently written into the agent’s long-term memory store. Phase 2 (Dormancy and Delayed Exfiltration): The payload lies dormant across an arbitrary number of benign sessions. When the user eventually discusses a sensitive topic—here, disclosing their annual income while asking about tax returns—the compromised memory activates, and the agent autonomously exfiltrates the user’s message to the attacker via send_email.

Methods

The researchers developed a dynamic evaluation framework to stress-test these vulnerabilities across four common memory architectures: Explicit Tool Memory, Agentic Semantic Memory (Mem0), RAG, and Sliding-Window Context.

Key components of their approach include:

  • Adaptive Red-Teaming: Instead of using static prompts, they used an evolutionary search algorithm (based on OpenEvolve) to iteratively refine attack payloads. This ensures the attacks can bypass modern safety alignments and survive the "distillation" process of semantic memory systems.
  • Capability-Aware Analysis: Recognizing that a defense is useless if it breaks the agent's functionality, the authors decomposed "utility" into seven specific user flows (e.g., "Pure Memory Recall" vs. "Inbox-Based Reply"). This allows for a nuanced look at the security-utility tradeoff.
Figure 3: Overview of our adaptive attack generation pipeline leveraging MAP-Elites-style mutation: candidate attacks are iteratively generated, evaluated in an agent environment, and refined until successful instances

Datasets

The study utilized several data sources to simulate a realistic agent environment:

  • LoCoMo: A modified version of this benchmark was used to generate rich, multi-session benign conversation histories.
  • Sensitive Topic Templates: Custom-written prompts covering Finance, Health, Legal, Tax, and Identity to serve as attack triggers.
  • Avocado Research Email Collection & LongMemEval: Used to derive realistic weights for different user tasks to calculate aggregate utility scores.

Key Insights and Ideas

  • Persistence is the Ultimate Force Multiplier: Unlike standard prompt injections that disappear when the context window clears, Trojan Hippo payloads can survive for 100+ benign sessions. A single malicious email can compromise an agent indefinitely.
  • The "Intimacy" Risk: Because users trust personal assistants with therapeutic, financial, and legal details, the "trigger" for these attacks is precisely the moment the most valuable data is being shared.
  • Semantic Distillation is a Double-Edged Sword: Systems like Mem0 that "summarize" memories into atomic facts can actually help the attacker by stripping away the "noisy" context of a malicious email, leaving behind a clean, high-priority instruction in the agent's core memory.

Key Results

The results are a wake-up call for agent developers. Without defenses, the Trojan Hippo attack is devastatingly effective:

  • High Success Rates: The attack achieved up to 100% Attack Success Rate (ASR) on Gemini 3.1 Pro and 85% on GPT-5-mini across various backends.
  • Defense Tradeoffs: The authors tested four defenses. While Provable Information Flow Control (IFC) reduced ASR to 0%, it effectively broke the agent's ability to perform tasks that require both reading an email and sending a reply.
  • RAG Resilience: RAG-based memory was found to be somewhat more resilient to "Limit-memory-length" defenses than agentic memory, maintaining higher utility while still being vulnerable to compressed payloads.
Figure 1: The attack success rate (ASR) of the Trojan Hippo attack for various memory backends, using an end-to-end black-box adaptive attack framework, reaches up to 100% for gemini-3.1-pro and up to 85% for gpt-5-mini, without any memory system defenses reaches up to 100% for gemini-3 .1-pro and up to 85% for gpt-5-mini, without any memory system defenses.

Limitations and Future Work

The authors acknowledge that their adaptive red-teaming is computationally expensive, especially against the largest frontier models. Furthermore, the study focuses on a single-agent environment.

Future directions include: * Cross-Agent Propagation: Exploring if a Trojan Hippo can "infect" other agents the user interacts with. * Richer Triggers: Developing attacks that trigger based on complex logic rather than simple keywords. * Cost-Efficient Red-Teaming: Finding ways to generate these sophisticated attacks without thousands of expensive API calls.

Ultimately, the paper argues that as we move toward "Memory-as-a-Service," the security of these persistent layers must be treated with the same rigor as traditional database security.

Summary updated

BibTeX
@misc{das2026trojan,
  author = {Debeshee Das and Julien Piet and Darya Kaviani and Luca Beurer-Kellner and Florian Tramèr and David Wagner},
  title = {{Trojan Hippo: Weaponizing Agent Memory for Data Exfiltration}},
  year = {2026},
  eprint = {2605.01970},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.01970},
}
Figure