Trojan Hippo Bench: A Dynamic Benchmark for Persistent Memory Attacks and Defenses on LLM AgentsTrojan Hippo Bench: A Dynamic Benchmark for Persistent Memory Attacks and Defenses in LLM Agents
Quick read
Evaluation and benchmarksBased on the paper PDF (generated by Gemini); refer to the original
The paper proposes Trojan Hippo Bench, where undefended Gemini 3.1 Pro reaches 100% ASR under N=100 trigger sessions.
- Agent persistent memory brings cross-session personalization capabilities, but also introduces a cross-session indirect prompt injection attack surface. Existing research lacks a dynamic benchmark that systematically evaluates persistent attacks and defenses under realistic indirect injection threat models and multiple memory architectures.
- We build an adaptive red-team search based on OpenEvolve to generate end-to-end black-box attacks, and propose a utility analysis decomposed across 7 user workflows, evaluating attacks and 4 memory-layer defenses on 4 persistent memory backends.
- When undefended, Gemini 3.1 Pro and GPT-5-mini reached ASR as high as 100% and 85% after 100 benign sessions; the IFC defense reduced ASR to 0% but drove HM utility to zero.
- IFC assumes complete taint propagation, not covering data laundering and covert channels; fully adaptive red-teaming was not extended to GPT-5 due to query cost; experiments were conducted in a simulated email assistant scenario and on 3 models.
- Threat model
- The user is trusted; the agent is built by a trusted developer; external data sources are untrusted. The attacker operates under an indirect prompt injection threat model, injecting payloads through untrusted inputs read by tools (e.g., emails), inducing a confused deputy vulnerability. The attacker has white-box knowledge of the system prompt, memory backend, and tool interfaces, but no access to model weights (black-box proprietary models), and cannot directly read or write memory or modify code or user inputs.
- Evaluated models
- Gemini 3.1 ProGPT-5-miniGPT-5
- Benchmarks
- Trojan Hippo BenchLoCoMo
- Metrics
- ASRAMHM
Researchers from ETH Zurich, UC Berkeley, and Snyk propose Trojan Hippo Bench, a benchmark for systematically evaluating poisoning attacks and memory-layer defenses in LLM agent persistent memory. The attack writes a dormant payload into the agent's long-term memory via a single untrusted tool call (e.g., a carefully crafted email), activating only when the user later discusses sensitive topics such as finance, health, or identity, and exfiltrating personal data. In an email assistant scenario, the attack without defenses achieves success rates of 85–100% against frontier models from OpenAI and Google, and remains activatable after 100 rounds of benign conversation. The researchers evaluate four memory-layer defenses based on basic security principles, reducing attack success rates to 0–5%, with a provably secure information flow control policy achieving 0% in all configurations, but the utility costs of the defenses vary widely, and practical deployment remains an open problem. The benchmark is open-sourced.
Why it was selectedThe paper provides attack success rates for persistent memory poisoning across four memory backends and the utility costs of four types of defenses, which can be used to assess the memory-layer risk of one's own agent.
Paper analysis
What problem does this paper attempt to solve?
For latent indirect prompt injection attacks against persistent memory in agents, existing research lacks a dynamic evaluation benchmark that spans heterogeneous memory architectures and accounts for the cost of defense utility.
The core problem is that persistent-memory agents face latent activated data exfiltration attacks (Trojan Hippo attack), yet lack a systematic dynamic evaluation benchmark spanning heterogeneous memory architectures and defense trade-offs.
- Application scenario and real-world risk: As frontier agents such as ChatGPT, Gemini, and Claude introduce cross-session persistent memory, agents are designed to retain users' personal information. The authors note that if the memory system is compromised, an attacker could induce the agent to exfiltrate users' personal data such as financial, medical, legal, or identity information.
- Limitations of existing evaluations: Prior research on agent memory poisoning (e.g., AgentPoison, MINJA) typically assumes direct memory-write permissions or untrusted users, and targets single-session behavior hijacking; attack demonstrations in real systems are mostly proof-of-concept, lacking an evaluation framework that covers heterogeneous memory backends, full indirect injection pipelines, and adaptive attacks.
- Core observation of the paper: Malicious instructions planted by the attacker can lie dormant for long periods in persistent memory after being written, and be triggered by sensitive topics after multiple benign interactions; moreover, once injected payloads enter persistent memory, they are loaded as system-prompt context in subsequent sessions, thereby bypassing defenses aimed at untrusted tool outputs.
- Proposed solution: The authors propose Trojan Hippo Bench, comprising an adaptive red-team benchmark based on OpenEvolve, and a capability-aware safety-utility analysis framework that decomposes user workflows at a fine granularity.
- Threat model:
- Attacker goal: Steal the victim's sensitive personal data and exfiltrate it to an attacker-controlled endpoint.
- Attacker knowledge: White-box knowledge of the system prompt, memory backend, and tool interfaces, but no access to model weights (for commercial black-box models).
- Attacker capabilities: Only indirect prompt injection, controlling only untrusted external content read by tools (e.g., the From, Subject, Body of inbound emails), with no ability to tamper with code, system prompts, memory implementations, or user queries, nor to directly read or write the memory store.
- Victim system: A tool-calling agent with persistent memory, untrusted data-reading tools, and external data-sending tools (instantiated in the paper as a LangChain-based email assistant).
What related research exists?
The paper organizes three categories of related work: indirect prompt injection and data exfiltration, memory poisoning in agents and concurrent studies, and attack-defense mechanisms and dynamic evaluation.
The paper discusses the following related work in the Related Work section and introduction:
Indirect prompt injection and data exfiltration attacks
- Greshake et al. (2023): Systematically proposed indirect prompt injection under the confused deputy threat model, embedding adversarial instructions into external content processed by agents.
- AgentDojo (Debenedetti et al., 2024) and subsequent benchmarks (Boisvert et al., 2025; Zhang et al., 2024): Evaluated prompt injection attack success rates and utility across task domains, pointing out limitations of guardrail methods.
- Rall et al. (2025) and Ramakrishnan et al. (2025): Used web search outputs and RAG injections as data exfiltration channels. The authors note that these works target single-session attacks and do not address cross-session persistent exfiltration.
Memory poisoning in large language model agents
- AgentPoison (Chen et al., 2024) and MINJA (Dong et al., 2026): The former directly backdoors memory and RAG stores, while the latter poisons through query-only interaction. The authors note that both target behavior hijacking rather than sensitive data exfiltration, assume stronger attacker access, and do not study cross-session persistence across architectures.
- Concurrent work (Pulipaka et al., 2026; Zou et al., 2026; Yang et al., 2026; Patlan et al., 2025; Zhang et al., 2024): Demonstrated indirect injection memory poisoning in assistant memory latent payloads, web session environment injection, and self-reinforcing injection, respectively, and reported that memory-layer attacks can bypass model-level safety filters. The authors note that these concurrent works still lack a benchmark for systematic evaluation across heterogeneous memory backends under a full indirect threat model, along with capability-aware utility analysis.
Defenses, evaluation, and dynamic benchmark needs
- Model-level and injection-level defenses: Model fine-tuning such as Secalign (Chen et al., 2025), and methods such as CommandSans (Das et al., 2025), Dual LLM (Debenedetti et al., 2025), and Progent (Shi et al., 2025) address instruction-data confusion through instruction highlighting, privileged control, and information flow control. The authors note that these defenses do not close the persistent memory gap, as payloads can bypass tool-output-level defenses once they enter the system prompt.
- Memory-layer defenses and adaptive evaluation: A-MemGuard (Wei et al., 2025) detects poisoning through relevant memory consensus at the retrieval stage; AgentVigil (Wang et al., 2025) and Nasr et al. (2025) conduct adaptive red-teaming. The authors note that existing evaluations often aggregate a single utility score, masking defense costs for specific capabilities, and rely on static attack sets.
Baseline methods and benchmarks
- Baseline methods include a sliding-window context baseline without persistent memory (Context / ConversationBufferWindowMemory) and native memory backends under no-defense settings.
- The datasets and benchmark environments used include an email assistant environment built on LangChain, and a multi-session benign conversation history generation pipeline adapted from LoCoMo (Maharana et al., 2024).
Positioning and distinction The authors argue that this paper addresses the shortcomings of persistent memory defense evaluation where aggregating multiple tasks masks capability impacts, and where static attack sets become ineffective, combining capability-aware security-utility analysis with dynamic red-teaming against persistent memory and defenses.
How does the paper address this problem?
Proposes Trojan Hippo Bench, combining OpenEvolve adaptive red-teaming search to evolve attack payloads, and evaluates 4 memory-layer defenses and 7 capability streams across 4 memory backends.
The authors propose Trojan Hippo Bench, a dynamic evaluation framework for persistent memory attacks and defenses against large-model agents, combining end-to-end black-box attack generation based on evolutionary search with capability-aware safety-utility evaluation that deconstructs user workflows.
System Architecture and Environment Design
The framework builds a simulated email assistant agent based on LangChain, with reading tools (read_all_emails, search_emails) and sending tools (send_email, reply_to_email, forward_to_email).
- Taint sources and exfiltration sinks: The inbox reading tools constitute the taint sources through which the agent contacts attacker-controlled content, while the sending tools constitute the exfiltration sinks.
- Sensitive trigger topic design: 5 sensitive trigger topics were designed—finance, healthcare, legal, tax, and identity—each with a constructed realistic user prompt template and entities.
- Attack success determination: An attack is judged successful when all personally identifiable information (PII) in the user message appears in an email the agent sends to the attacker (minor occasional rewrites by Mem0 are allowed; messages are usually forwarded verbatim).
Adaptive Red-Team Attack Generation
To prevent static attack payloads from becoming ineffective as model alignment improves, the authors implement a MAP-Elites-style evolutionary attack generation pipeline based on OpenEvolve.
- Diversity maintenance and mutation: During search, a diverse candidate set is maintained with dimensions of attack length and reference distance; in each iteration, an LLM mutator generates 8 candidate variants from a selected parent.
- Environment evaluation and feedback scoring: A scorer runs the agent in a fresh environment and checks whether exfiltration succeeds, and an LLM critic gives a score of 1–10 with specific feedback.
- Termination conditions and overfitting prevention: The loop stops when a full score is reached or 40 iterations are reached. Benign session content is generated by a modified LoCoMo pipeline; each (topic, backend) combination generates 1 training sample and 4 test samples, drawn from non-overlapping template and entity pools, and the best payload from the training stage is evaluated only on the held-out test set.
Memory Backend Implementations
The framework covers three mainstream memory paradigms in deployed systems plus a sliding-window baseline (only a single backend is active per run):
- Context (sliding-window baseline): Conversation history is kept in the context window, and the earliest tokens are truncated when it is too long; there is no separate store.
- RAG (retrieval-augmented generation): Conversation records are split into chunks of the default 512 characters and embedded into a vector index; each turn retrieves the top 8 chunks based on the current user message and places them in context.
- Explicit Memory: The agent maintains an explicit list via the update_memory tool, updating it when the user instructs "remember", "store", or "save"; the full list is injected into the system prompt each turn.
- Mem0 (agent semantic memory): A dedicated extraction LLM distills each turn of conversation into atomic facts and stores them in a vector store and a relationship history store, deduplicates and resolves conflicts, and subsequently retrieves the top 10 facts for injection into context.
Memory-Layer Defense Mechanisms and Formalization
The paper evaluates 4 memory-layer defenses at three interception points in the attack chain:
- User-prompt-only (intercept memory indexing): Only user messages are stored to memory, discarding assistant replies and tool outputs. On the Explicit backend this defense is marked Undefined because under white-box attacks the injected payload can override tool calls.
- No-untrusted-write (intercept memory indexing): An untrusted flag is set in sessions that call taint tools, and subsequent writes to memory in that session are silently turned into no-ops or skipped.
- Limit-memory-length (hinder retrieval): Storage units are forcibly limited to 80 characters or fewer (Explicit truncation parameter, Mem0 truncation of extracted facts, RAG chunk size set to 80). The Context backend has no discrete units and is therefore undefined.
- Provable policy (IFC) (intercept exfiltration): An information flow control policy based on a two-point lattice ℒ = {U, T} (where
U \sqsubset T, representing uncontaminated and contaminated, respectively). Sessions and memory entries are initialized to U; once the agent calls a taint source or retrieves a memory tagged T, the session state is marked T, and any call to an external sending tool in a T session is blocked. The authors provide a noninterference theorem proof under two-session attacks.
7 Benign Capability Flow Designs
The framework defines 7 user interaction flows (Table 2): memory_only, long_memory, assistant_responses, untrusted_probe, disable_send, untrusted_send, and memory_tools, spanning the three axes of memory requirements, inbox access, and sending capability.
What experiments did the paper conduct?
Evaluated persistent latent ASR across different memory backends, the effectiveness of 4 defenses, utility trade-offs, and cross-model transfer on Gemini 3.1 Pro, GPT-5-mini, and GPT-5.
Experimental Setup
- Models under test: Fully adaptive red-teaming targets Google Gemini 3.1 Pro (primary target) and OpenAI GPT-5-mini; transfer testing targets OpenAI GPT-5. Single run sets 50-step recursion limit and 600-second timeout.
- Memory backends: Explicit Memory, Mem0, RAG (default 512-character chunking), Context (sliding window) 4 persistent backends, plus No Memory baseline.
- Dataset and trigger topics: Modified multi-session conversation history from LoCoMo; 5 sensitive topics (finance, health, legal, tax, identity), each with 1 training sample and 4 held-out test samples.
- Defense baselines: Evaluate None (no defense baseline), User-prompt-only, No-untrusted-write, Limit-memory-length (80 characters), and Provable policy (IFC) 4 memory-layer defenses.
- Evaluation metrics: Attack success rate (ASR, %, defined as all PII in user messages appearing in the agent's email to the attacker); benign utility arithmetic mean (AM, %) and harmonic mean (HM, %) measured over 7 benign capability flows.
- Sample size and repetitions: Each reported ASR is averaged over 4 held-out test samples, 3 random seeds, 5 topics, 60 rollouts per data point.
Main Results
(From Table 3, Gemini 3.1 Pro ASR under trigger session N = 100, correspondence between defenses and backends)
Swipe horizontally to read the table
Defense Method Explicit ASR Mem0 ASR RAG ASR Context ASR No Mem. ASR None (Baseline) 85% 80% 85% 100% 5% User-prompt-only Not reported 10% 5% 5% 0% No-untrusted-write 0% 5% 5% 0% 0% Limit-memory-length 85% 20% 30% Not reported 0% Provable policy 0% 0% 0% 0% 0% - Attack success rate of persistent backends without defense: Authors note that under the no-defense baseline, Gemini 3.1 Pro's ASR is high across all persistent backends (80%–100%), while the no-memory baseline is only 5%.
- Suppression effect of defenses on attacks: Authors note that memory-layer defenses greatly reduce ASR, with Provable policy achieving 0% ASR on all backends, while Limit-memory-length is relatively weaker, with ASR still 85% on Explicit.
- Undefined defense combinations: Authors note that under white-box attacks, injected payloads can override update calls, so User-prompt-only cannot be reliably implemented on Explicit; and Context lacks discrete storage units, so Limit-memory-length is not applicable there.
Delayed Exfiltration and Cross-Session Persistence
- What was tested: Measured the effect of the number N (from 0 to 100) of benign conversation intervals between malicious email injection and sensitive topic trigger on Gemini 3.1 Pro's attack success rate (Section 7.1, Figure 4).
- Results: On all persistent backends (Explicit, Mem0, RAG, Context), ASR is already high at N=0 and remains high as N increases to 100, with no decay trend; in 20 tests with random reordering of benign conversations at N=100, standard deviations for RAG and Context are 43% and 33% respectively, with Context reaching 100% ASR in 14 cases and lower values in the rest.
- Authors' interpretation: Authors believe a single poisoning can establish long-term compromise, with payloads lying dormant across multiple benign interactions without decay; numerical fluctuations are due to randomness in conversation order, not general model generation noise.
Utility Decomposition Across 7 Benign Capability Flows
- What was tested: Evaluated how each defense preserves or breaks specific workflows across 7 benign capability flows (MO, LM, AR, UP, DS, US, MT) (Section 7.3, Table 3, Figure 6).
- Results: Provable policy zeroes harmonic mean utility on all backends and models (HM = 0%), because it cuts off outbound actions involving inbox (DS and US zeroed); User-prompt-only causes collapse on the assistant_responses axis (Gemini RAG from 95% to 25%, GPT-5-mini from 100% to 0%); No-untrusted-write zeroes untrusted_probe and untrusted_send; Limit-memory-length maintains high means on RAG (Gemini AM/HM 89%/88%, GPT-5-mini 88%/86%) but leaves residual ASR (Gemini 30%, GPT-5-mini 15%).
- Authors' interpretation: Authors note that a single aggregate utility score masks specific capability breakdowns; harmonic mean penalizes scenarios where a single capability completely fails; defense choice should depend on the actual deployed workflow needs.
Cross-Model Prompt Transfer
- What was tested: Under no defense and N=100, attack prompts optimized for GPT-5-mini are transferred directly to GPT-5 without re-optimization (Section 7.4, Table 4).
- Results: Transferred attacks achieve 70.0% ASR on GPT-5's RAG backend, 35.0% on Context, 5.0% on Explicit, and 0.0% on Mem0 and No Mem (Table 4).
- Authors' interpretation: Authors believe transferred attacks show cross-model generalization on RAG and Context; low transfer rates on Mem0 and Explicit are consistent with these backends requiring more precise injection formats, needing adaptive optimization for the target model to recover high ASR.
Other Ablations and Analyses
- No-memory baseline calibration: No Memory scores near 0% on long_memory and memory_only, indicating persistent backends provide cross-session capabilities that context windows cannot replicate (Section 7.3).
- GPT-5-mini baseline performance: Under no defense and N=100, ASR across backends is 15%–85% (Explicit 15%, Context 60%, RAG 80%, Mem0 85%, Table 3).
- Deployment-profile optimal defense: On the RAG-dominated Pareto frontier, the optimal defense for recall-heavy scenarios is no-untrusted-write, and for email-heavy scenarios is user-prompt-only (Section 6.3).
What are some points that can be further explored?
Authors point out limitations such as IFC taint laundering and covert channels, GPT-5 red-teaming cost, and multi-agent scaling; experiments cover 3 models and 4 memory backends.
Limitations and future directions noted by the authors
- Taint propagation assumption and unresolved channels: The security guarantee of the IFC policy assumes complete taint propagation and does not cover agents "washing" contaminated content into uncontaminated memory entries, nor covert channels passed through tool arguments; the authors note both remain open problems (Section 6.2).
- Cost constraints on full combinatorial evaluation: Due to high compute and time costs, the authors did not exhaustively evaluate all (backend, defense, N) combinations (Section 7.1).
- Full adaptive red-teaming of frontier models is limited: Because of the high per-query cost, running full adaptive red-teaming on large frontier models (GPT-5) at scale was cost-constrained, so only transfer attacks without re-optimization were evaluated (Section 7.4).
- Missing data on real deployment task distributions: Since no public dataset currently reflects the real user task distribution of email assistants with memory systems, the authors could only use three representative deployment profiles for utility-weighted analysis (Section 6.3).
- Future directions: The authors hope this benchmark will drive research on low-cost adaptive red-teaming, multi-agent memory poisoning evaluation benchmarks, and evaluation studies that trade off security against real deployment capability needs (Section 8).
Experimental coverage
- Number of models tested: The experiments tested 3 frontier models: Google Gemini 3.1 Pro, OpenAI GPT-5-mini, and GPT-5, of which the first two underwent full adaptive red-team search.
- Memory architectures and baselines: Testing covered 4 persistent memory architectures—Explicit Memory, Mem0, RAG, Context—and 1 no-memory baseline; only one backend was active per experiment.
- Memory-layer defense types: 4 memory-layer mechanisms were tested: user-prompt-only, no-untrusted-write, limit-memory-length, and provable policy (IFC).
- Tasks and scenarios: Evaluation was conducted in a simulated email assistant (a LangChain-based tool-calling environment), with trigger topics covering 5 domains: finance, health, legal, tax, and identity.
- Unreported information: When conducting adaptive red-team evolutionary search on GPT-5-mini and Gemini 3.1 Pro, the paper does not report the specific LLM versions used for the mutator and judge.
Summarize the main content of the paper
The paper proposes Trojan Hippo Bench, a benchmark for evaluating attacks and defenses on agent persistent memory, revealing latent attack threats and the security-utility trade-off of memory defenses.
- Paper positioning: This paper proposes Trojan Hippo Bench, a dynamic evaluation benchmark and capability-aware safety–utility analysis framework for persistent memory attacks and memory-layer defenses against large-model agents.
- Core problem: Persistent memory allows agents to retain users' private information across sessions, but introduces the Trojan Hippo latent data-exfiltration threat; an attacker implants a payload into memory via a single indirect prompt injection, and after multiple benign sessions it is triggered by a sensitive topic to exfiltrate, while existing evaluations lack systematic consideration of cross-heterogeneous memory backends and the utility cost of defenses.
- Method design: A MAP-Elites-style black-box adaptive red-teaming framework is built on the OpenEvolve algorithm to evolve and generate high-penetration attacks for specific backends and defenses; it also defines 7 benign capability streams covering three-dimensional features, providing fine-grained utility decomposition via arithmetic mean, harmonic mean, and deployment profiles.
- Main experimental findings:
- Under no defense, after 100 benign sessions, Gemini 3.1 Pro reaches ASR of 100% on Context, 85% on Explicit, 85% on RAG, and 80% on Mem0 (Table 3); GPT-5-mini's corresponding ASR is 15%–85%.
- 4 memory-layer defenses substantially reduce attack success rates, among which Provable policy (IFC) reduces ASR to 0% in all configurations, but because it cuts off exfiltration capability involving the inbox, harmonic-mean utility drops to zero (HM = 0%).
- Limit-memory-length is a weaker defense; under Gemini 3.1 Pro + Explicit, ASR remains as high as 85%, and adaptive attacks can compress the payload within an 80-character budget; on RAG it retains 89% AM and 88% HM.
- When an attack payload optimized for GPT-5-mini is transferred zero-shot to GPT-5, it achieves ASR of 70.0% and 35.0% on RAG and Context respectively (Table 4).
- Conclusions and implications: The authors point out that a single poisoning can establish a long-resident threat, and that memory-layer defenses involve a trade-off between safety and utility, with no single general solution that satisfies both; defense selection must be matched to the specific workflows that the actual deployment environment relies on.