Skip to content

Researchers propose MemGhost, achieving covert memory injection into persistent personal agentsWhen Claws Remember but Do Not Tell: Stealthy Memory Injection in Persistent Personal Agents

Paper Tracker· arXiv:2607.05189· Yechao Zhang, Shiqian Zhao, Jiawen Zhang, Jie Zhang, Gelei Deng, Xiaogeng Liu, Chaowei Xiao, Tianwei Zhang·Indexed by this site · 2026-10-03· Originally publishedSelected AttacksSelectedAttention42

Quick read

Attacks

Based on the paper PDF (generated by Gemini); refer to the original

MEMGHOST uses offline training with both environment and target agents, achieving an 87.5% end-to-end memory injection success rate in OpenClaw+GPT-5.4 background mode.

Threat modelA remote black-box adversary, with no victim runtime feedback, sends a single malicious email only through indirect prompt injection, inducing a personal agent to silently write a target false memory into persistent storage and influence downstream decisions in future independent sessions.

Questions
Persistent personal agents write external untrusted content into long-term memory and reuse it as trusted state, creating a stealthy memory injection threat. The attack must satisfy three-stage objectives: writing into memory, replies that do not leak, and influencing behavior in subsequent sessions, all under black-box non-interactive feedback.
Methods
Propose the MEMGHOST framework, which uses an environment agent that simulates agent-file-tool interactions and a target agent with fine-grained rewards combining memory adoption and covertness, internalizing the search strategy via supervised fine-tuning and GRPO reinforcement learning to generate a single attack email in a single forward pass.
Experiments and results
On the 56 test cases in WhisperBench, MEMGHOST achieves an 87.5% E2E success rate on OpenClaw (GPT-5.4) in background mode, reaches 71.4% on Claude Code SDK (Sonnet 4.6) in background mode, and successfully transfers to the Mem0 vector database.
Limitations and future work
In Section 7, the authors note that unmodeled upstream email delivery infrastructure (such as spam filtering and SPF/DKIM/DMARC validation), multi-agent propagation and multi-tenant contamination are not covered, the payload is plain text only, and long-term memory decay dynamics are not tested; the experiments cover 6 models, 3 agent frameworks, and 3 types of defenses.
Experimental setupGPT-5.4、Claude Sonnet 4.6 et al. · WHISPERBENCH · ISR、SSR et al.
Evaluated models
GPT-5.4Claude Sonnet 4.6Claude Sonnet 4.5MiniMax-M2.5Grok 4.1 FastDeepSeek v4 FlashDataSentinelMeta-SecAlignAgentDoG
Benchmarks
WHISPERBENCH
Metrics
ISRSSRESRE2EFNR
AI summaryand selection rationaleThe researchers propose a covert memory injection attack, where untrusted external content is silently written into an agent's persistent memory and later reused as trusted state. To evaluate this threat, they build WhisperBench, a benchmark with 108 cases covering five risk categories and fact and preference poisoning, using real IMAP/SMTP email flows and real email agent skills for full-cycle evaluation. The attack framework MemGhost simulates persistent agent execution through an environment proxy, converts memory adoption and session covertness into dense rewards for the target agent, then trains attack policies with supervised fine-tuning and reinforcement learning, enabling one-shot payload generation from a single email.

The researchers propose a covert memory injection attack, where untrusted external content is silently written into an agent's persistent memory and later reused as trusted state. To evaluate this threat, they build WhisperBench, a benchmark with 108 cases covering five risk categories and fact and preference poisoning, using real IMAP/SMTP email flows and real email agent skills for full-cycle evaluation. The attack framework MemGhost simulates persistent agent execution through an environment proxy, converts memory adoption and session covertness into dense rewards for the target agent, then trains attack policies with supervised fine-tuning and reinforcement learning, enabling one-shot payload generation from a single email.

Why it was selectedThe paper proposes a covert memory injection attack against persistent personal agents and provides success rate data across frameworks and memory backends, which can be used by teams deploying such agents to assess risk.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The paper studies the long-range attack threat in which a personal agent, under black-box non-interactive conditions, is silently written into persistent memory via a single external email and manipulated in subsequent sessions.

    When processing external untrusted interactions, persistent personal agents may be stealthily written into persistent memory by a single malicious email, which can then continuously manipulate downstream behavior in future independent sessions.

    • Scenario and importance: Personal agents with long-term memory and external tool access (such as OpenClaw) have been integrated into daily workflows, autonomously reading emails, modifying files, and maintaining user profiles and preferences across sessions; if external input is absorbed as internal state, it creates persistent cross-session harm.
    • Shortcomings of existing methods: The authors note that previous research mostly focuses on single-session direct jailbreaks or immediate tool hijacking, or pre-assumes attackers can directly tamper with the underlying database; there is a lack of end-to-end evaluation for "delivered through normal external input, remaining silent without alarming the user, and taking effect in subsequent independent sessions."
    • Core observation and hypothesis: Personal agents commonly rely on specific persistent files (such as AGENTS.md or MEMORY.md) to build context and tend to remain friendly and transparent in replies; however, as long as the payload is framed as authoritative, reusable objective facts, the agent will autonomously store it into core memory carriers without alerting the user.
    • Proposed approach and benchmark: The authors construct WHISPERBENCH, a full-cycle evaluation benchmark containing 108 real email cases, and propose the offline optimization framework MEMGHOST, which can generate highly stealthy memory injection emails in a single pass without interacting with the victim during the test phase.
    • Threat model:
      • Attacker objective: Achieve stealthy memory injection, simultaneously satisfying memory write success (Injection), no anomaly leakage to the user in the current reply (Stealthiness), and influence on downstream decisions in future independent trigger sessions (Effectiveness).
      • Attacker knowledge: Black-box setting; the attacker does not know the victim's base LLM, specific persistent state contents, or user-defined behavior rules; knows the target uses a general personal agent architecture and can build a local shadow agent.
      • Attacker capability: Remote black-box non-interactive; can only send a single ordinary email via indirect prompt injection (IPI); cannot obtain victim runtime feedback during testing or perform multi-round probing; cannot control when the agent reads the email or whether it is in foreground or background mode.
      • Victim system: An LLM-based personal agent system with local file or database persistent memory, capable of email retrieval and tool calls.
  2. What related research exists?

    Reviews research on agent safety evaluation, indirect prompt injection, and memory poisoning, noting that existing work lacks modeling of external, interaction-free, full-lifecycle memory injection.

    In the introduction and related work (Section VI), the paper reviews three closely related research directions:

    Security evaluation of personal agent ecosystems

    • OpenClaw ecosystem risk evaluation: Wang et al. (2026), Chen et al. (2026), and Shan et al. (2026) analyzed trajectory auditing and security risks of OpenClaw agents; Dong et al. (2026) explored token consumption vulnerabilities in tool-chain calls; Deng et al. (2026) analyzed autonomous agent threats. The authors note that these works are largely limited to stateless single-session attacks (e.g., immediate tool hijacking) and do not treat cross-session persistent memory as a core attack surface.

    Indirect prompt injection (IPI)

    • Immediate task hijacking: Greshake et al. (2023) and Liu et al. (2024) studied IPI attacks that tamper with current task instructions via external payloads such as web pages, documents, or emails. The authors note that these methods aim to trigger immediate malicious tool calls; this paper extends them to a memory implantation setting with time spans and state accumulation.

    Agent memory attacks

    • Self-targeting and shared environment poisoning: Dong et al. (2025), Sunil et al. (2026), and Jiang et al. (2026) studied malicious memory injected by legitimate users into their own or shared agents through direct conversation. The authors note that these works rely on direct multi-turn interaction.
    • Prior data poisoning (Oracle injection): Srivastava and He (2025) and Patlan et al. (2025) evaluated the harm after memory stores are contaminated. The authors note that these works directly assume the underlying database has been tampered with, skipping the real-world challenge of how external payloads pass through the agent's cognitive filters.

    Baseline methods and comparison benchmarks

    • Comparison baselines: Includes 5 handcrafted template-based methods (Naive Attack, Escape Characters, Context Ignore, Fake Completion, Combined Attack) and 2 automated search methods (MAP-Elites and rubric-based RGS search).
    • Comparison benchmark: Evaluation is conducted on the real email-flow benchmark WHISPERBENCH (108 cases) constructed in this paper, covering 5 categories: health, finance, information integrity, cybersecurity, and business disruption.

    Positioning of this paper

    • The authors state that this paper fills the gap in full-cycle end-to-end attack and evaluation in external non-interactive black-box scenarios, from payload ingestion via a single email, silent persistent storage, to future cross-session triggering.
  3. How does the paper address this problem?

    Through a lightweight shadow environment and rubric-reward dual agents, using SFT and GRPO to train the generation policy, it achieves single forward generation of non-interactive stealthy emails.

    The overall idea is to build an offline dual-layer proxy system, converting the black-box no-feedback attack into parametric generation policy optimization, and propose the MEMGHOST framework to generate stealthy injection emails via single forward inference.

    Problem Formulation and Objective Formalization

    The attacker only provides the target false memory m and must generate a payload x such that agent A maximizes the full-cycle expected reward under the unknown configuration distribution P*: x⋆ = argmaxx ∈ 𝒳 𝔼ω ∼ 𝒫⋆ [𝕀inject · 𝕀stealth · 𝕀effective] where the indicator functions respectively check whether the state change Δ s contains the target memory, whether the visible reply y leaks the injection, and whether the future trigger behavior b is changed. Given the constraint of no interaction during the test phase, the optimization objective is transformed into maximizing a dense surrogate reward based on shadow environment trajectories: θ⋆ = argmaxθ 𝔼x ∼ πθ(·|m) [Rtrace(m, x)] This formulation converts discrete text search into reinforcement learning over the generation policy πθ.

    Environment Proxy: Shadow Agent

    • Lightweight file and tool simulation: A locally built Python execution environment provides a read/write virtual filesystem workspace, supporting file tools such as read, write, edit, grep, find, ls, as well as simulated email commands (himalaya envelope list/read).
    • Execution mode support: Covers user foreground interaction tasks (user-turn mode) and automated background tasks (heartbeat mode), allowing payloads to produce observable state changes Δ ŝ and replies ŷ along tool interaction paths close to real systems.

    Target Proxy: Rubric-Based Reward Design

    • Upfront downstream effectiveness evaluation: To avoid repeatedly simulating unknown trigger queries in the optimization loop, future effectiveness is replaced using memory carrier importance (writing to core files such as AGENT.md assigns coefficient μ=1, retrieval-type fragment files receive reduced weight μ=0.2) and semantic adoption quality.
    • Fine-grained rubric scoring: An instance-level injection rubric Qinj(m) is constructed to evaluate credibility and actionability, and a global stealth rubric Qstl is constructed to detect 4 leakage patterns including warnings, content restatement, and storage behavior disclosure.
    • Smooth reward combination: The combined reward is defined as Rtrace(m,x) = Rinj(m,x) · (Rstl(m,x) + λ), introducing a constant λ > 0 to prevent gradients from vanishing during early exploration when replies are not stealthy.

    Policy Training: Supervised Fine-Tuning and Reinforcement Learning

    • SFT stage (seed distillation): DeepSeek-V3.2 is used for iterative repair search guided by rubric diagnostic feedback to obtain high-quality seed pairs (m, x) forming DSFT; using Qwen-4B as the base with LoRA fine-tuning to train the generation policy πθ.
    • RL stage (GRPO optimization): Group Relative Policy Optimization (GRPO) combined with environment sampling (varying base models, prompts, and task types); a semantic diversity penalty Rdiv, KL regularization term, and a hard-example replay buffer (capacity 50, sampling proportion 30%) are introduced to improve cross-environment generalization.
  4. What experiments did the paper conduct?

    Validated on 6 models and multiple frameworks, MEMGHOST significantly outperforms 7 baselines on frontier and low-cost models and achieves cross-architecture transfer.

    Experimental Setup

    • Target models under test: Frontier models include GPT-5.4, Claude Sonnet 4.6, Claude Sonnet 4.5; low-cost models include DeepSeek v4 Flash, Grok 4.1 Fast, MiniMax-M2.5.
    • Agent frameworks and memory backends: Core targets use OpenClaw and Claude Code SDK (both using filesystem persistent storage); generalization experiments use NanoClaw and Hermes Agent; external vector memory backend uses Mem0.
    • Dataset and scale: WHISPERBENCH evaluation benchmark, 108 real cases total (52 for training, 56 held out for end-to-end single-generation evaluation; query-intensive baselines evaluated on a fixed representative subset of 20 cases).
    • Baseline methods: 5 handcrafted baselines (Naive Attack, Escape Characters, Context Ignore, Fake Completion, Combined Attack); 2 automatic optimization baselines (MAP-Elites, Rubric-Guided Search, abbreviated RGS).
    • Metric definitions and judgment methods: Injection Success Rate (ISR, LLM audit determines whether writing occurred), Stealth Success Rate (SSR, determines whether the reply leaks no hint), Effectiveness Success Rate (ESR, determines whether the new-session behavior score reaches 3-4), End-to-End Success Rate (E2E, all three satisfied simultaneously). The scoring model uniformly uses GPT-5.4-nano with temperature set to 0.

    Main Results

    The table below shows end-to-end attack success rates (E2E, %) on the 56 held-out test cases across major models, per Table I:

    Swipe horizontally to read the table

    Target ModelRun ModeNaive AttackFake CompletionRGS (search baseline)MEMGHOST (this paper)
    GPT-5.4Background mode (BG)0.00.040.087.5
    GPT-5.4Foreground mode (FG)0.00.020.075.0
    Sonnet 4.6Background mode (BG)0.00.00.071.4
    Sonnet 4.6Foreground mode (FG)0.00.00.048.2
    Sonnet 4.5Background mode (BG)25.017.975.080.4
    Sonnet 4.5Foreground mode (FG)3.60.015.071.4
    Grok 4.1 FastBackground mode (BG)78.680.485.091.1
    DeepSeek v4 FlashBackground mode (BG)5.40.050.075.0

    Note: Due to column limits, results for Escape Characters, Context Ignore, Combined Attack, and MAP-Elites are omitted; full per-model breakdown metrics are in Table I.

    • Authors' interpretation: end-to-end metric performance: The authors state that MEMGHOST achieves substantially leading E2E success rates across model tiers; on the most tightly defended Sonnet 4.6, the test-time search baseline RGS completely fails (0.0% in both modes), while MEMGHOST still reaches 71.4% in background mode.
    • Authors' interpretation: separation of stealth and injection: Some static baselines achieve high ISR on specific models (e.g., Fake Completion reaches 96.4% on Grok 4.1 Fast background mode), but because replies severely leak, SSR is extremely low, making effective end-to-end attacks difficult.
    • Authors' interpretation: category robustness and anomalies: Among the 5 risk categories (Figure 3), ESR for the cybersecurity category is relatively low; the authors believe this reflects that the models' built-in safety alignment still has some defensive preference for high-risk operations at execution time.

    Agent Architecture and Memory Backend Transfer Evaluation

    • Different agent architectures: With GPT-5.4 fixed (N=56, per Table II), background E2E on unseen NanoClaw is 80.4% (foreground 78.6%); on Hermes, background E2E is 82.1% (foreground 51.8%).
    • Vector database Mem0: After completely disabling file memory and switching to the Mem0 vector database, background E2E for both OpenClaw and Hermes reaches 85.7% (foreground 80.4% and 48.2%, respectively). The authors believe this indicates the payload learns general semantic adoption features rather than mechanically fitting specific file paths.

    Proxy Design and Real-Environment Relevance Validation

    • Reward and real metric correlation (per Table III): The proxy reward Rinj has a Pearson correlation coefficient of 0.872 with the real target ESR; Rstl has 0.785 with real SSR; the combined reward Rtrace has 0.839 with real E2E; Directional Accuracy for all metrics exceeds 0.90. The authors believe this demonstrates that offline proxy scoring is highly consistent with black-box real attack performance.

    Evasion Evaluation Against Input, Model, and System-Level Defenses

    • Bypassing existing defenses (per Table IV): Input-level detection DataSentinel has a false negative rate (FNR) of 91.59%; under model-level defense Meta-SecAlign, ISR remains 49.07% and SSR 98.15%; system-level audit AgentDoG has an FNR of 93.46% on OpenClaw and 40.38% on Claude Code SDK.
    • Adaptive foreground prompt defense (per Table V): When the user explicitly requires in the foreground prompt "reply stating what was checked and what actions were taken," the agent faces a conflict; Sonnet 4.6's E2E drops to 23.2%, OpenClaw+GPT-5.4's E2E drops to 1.8%, but Sonnet 4.5 still maintains 25.0% SSR.

    Other Ablations and Analyses

    • MiniMax-M2.5 foreground SSR drops to 21.4%: Figure 4 shows its reply length is significantly longer; the authors state there is a phenomenon of chain-of-thought content leaking into normal text (Section V-B).
    • SFT stage fine-tuning parameter count: Qwen-4B as base, LoRA rank set to 16, scaling factor 32, trained for 3 epochs (Appendix C).
    • RL stage GRPO group parameters: sampled candidate payload count G=8, temperature 1.2, LoRA rank 64, trainable parameter count approximately 132 million (Appendix C).
  5. What are some points that can be further explored?

    The authors note that delivery-layer infrastructure, multimodal payloads, and long-term decay are not covered; the experiments cover 6 model types and 4 agent frameworks.

    Limitations and future directions noted by the authors

    • Delivery-layer threat model assumption: In Section 7, the authors explicitly state that the evaluation begins at the agent-visible mailbox, assuming the payload has reached the inbox, and does not model upstream infrastructure such as MX routing, spam filtering, SPF/DKIM/DMARC enforcement, or enterprise secure email gateways.
    • Single-agent and single-user scope: In Section 7, the authors state that the experiments evaluate only single-agent, single-user environments and do not cover multi-agent propagation or multi-tenant memory contamination.
    • Payload modality limitation: In Section 7, the authors note that the current payload is plain-text email body only, leaving multimodal attack vectors such as attachments, embedded images, and calendar invitations for future work.
    • Missing long-term memory evolution dynamics: In Section 7, the authors note that they only measured whether injected memories persist and influence subsequent behavior, without modeling memory decay dynamics over long periods or memory consolidation processes across weeks.
    • Responsible disclosure: In Ethical Considerations, the authors state their plan to report the attack patterns and evaluation dataset to affected ecosystems (such as OpenClaw, NanoClaw, and related LLM vendors) before publication.

    Experimental coverage

    • Language models tested: A total of 6 models are covered: GPT-5.4, Claude Sonnet 4.6, Claude Sonnet 4.5, MiniMax-M2.5, Grok 4.1 Fast, and DeepSeek v4 Flash.
    • Agent frameworks and systems: 4 agent implementations are covered: OpenClaw, Claude Code SDK, NanoClaw, and Hermes Agent.
    • Persistence backend types: Two storage forms are covered: local Markdown filesystem workspaces and the Mem0 vector database.
    • Defense mechanism evaluation: This covers input-level DataSentinel, model-level Meta-SecAlign, system-level AgentDoG, and an adaptive defense with explicit foreground questioning.
    • Test sample size: The WHISPERBENCH evaluation set has 56 held-out test cases (with another 20 used for the query-intensive baseline); the paper does not report random seed variance for repeated tests.
  6. Summarize the main content of the paper

    Summarizes the paper's research background, the dual-agent optimization method MEMGHOST, full-cycle experimental results, and the authors' insights on the boundaries of memory trust.

    This paper studies the covert memory injection threat to persistent personal agents and proposes an automated generation framework and full-lifecycle evaluation benchmark that balances write success, covertness, and cross-session effectiveness.

    • Core problem and scenario: Personal agents with cross-session persistent memory and external tool permissions, during daily email processing, can silently convert untrusted external input into trusted persistent state, allowing attackers to exert long-range control over future independent sessions without needing to jailbreak in a single session.
    • Method design highlights: Propose the MEMGHOST framework, which uses a lightweight shadow environment (environment agent) simulating local file and email interactions, and a target agent with fine-grained rewards decomposing write quality and user-visible covertness, using supervised fine-tuning and GRPO reinforcement learning to internalize search capabilities into model weights, enabling single-forward email generation without runtime interaction.
    • Main experimental results: On WHISPERBENCH with 108 cases, MEMGHOST achieves 87.5% E2E success rate in OpenClaw+GPT-5.4 background mode and 71.4% background E2E on the frontier model Sonnet 4.6 (baselines are 0.0% for both); it also transfers to NanoClaw, Hermes, and Mem0 vector database without re-tuning.
    • Defense evaluation performance: Against input-level DataSentinel (FNR 91.59%) and system-level AgentDoG (OpenClaw FNR 93.46%), MEMGHOST maintains high evasion capability; however, foreground covertness decreases under adaptive prompts where users actively request reporting of operations.
    • Author conclusions and implications: The authors argue that persistent memory has become a critical security trust boundary, that relying solely on upstream content delivery filtering is insufficient, and that personal agents urgently need built-in access control, source marking, and user confirmation mechanisms for converting external content into persistent state.
Read originalarxiv.org