system: OPERATIONAL
← back to all hacks
AGENTS MEDIUM NEW

MemGhost: one email plants a hidden, persistent false memory in an AI agent

A single crafted email can make a personal agent write a false 'fact' into its long-term memory, hide the edit, and quietly steer later sessions. Defenses built to stop it mostly failed.

2026-07-21 // 6 min affects: llm-agents, personal-ai-agents, openclaw, email-assistants

What is this?

On 6 July 2026, researchers published an arXiv paper titled “When Claws Remember but Do Not Tell: Stealthy Memory Injection in Persistent Personal Agents”, describing an attack they call stealth memory injection. The write-up was widely covered a week later, on 13 July 2026, under the name of the tool that automates it: MemGhost. This is a lab study, not a break-in in progress — everything ran in sealed test environments with fake inboxes and fake users.

The core finding is simple and uncomfortable. A personal AI agent that both reads your email and keeps long-term notes about you can be made to write a false “fact” into its own memory from a single incoming message, say nothing about it in its reply, and then act on that false fact in future sessions. In one test case, the planted lie was that the user’s Zelle daily transfer limit had been raised to $10,000. The user reads an ordinary-looking answer and never learns the assistant was tampered with.

How it works

Persistent personal agents feel like they “know you” because they keep state in files that load at the start of every session — standing instructions and learned user facts. In the paper’s primary target, the open-source agent OpenClaw, this state lives in plain-text files (such as AGENTS.md and MEMORY.md) that are pulled into the model’s context each time it starts.

The attacker needs no password and no account access. They send an email to someone whose agent is configured to check their inbox, which for these assistants is a routine background job. Buried in that message is text aimed at the agent, not the human. If the email skill takes the bait, three things happen in sequence: the agent uses its own file-write tool to save the attacker’s note into persistent memory; its visible reply omits any mention of the write; and in a later, unrelated conversation the planted note changes what it tells the user or does on their behalf. To make the poison durable, the payload targets the core files that load every session, so one write is reused as trusted state indefinitely.

What separates this from a crude prompt injection is the generator. A blunt instruction like “save this quietly and say nothing” was caught or ignored by strong models almost every time. Instead, the researchers trained an attacker model offline against a shadow copy of a personal agent, rewarding messages that got the memory saved while keeping the reply silent. At attack time MemGhost writes the finished email in one shot, with no interaction with the victim. Across 56 fresh cases it completed the full attack — plant, hide, then sway a later session — in 87.5% of background-mode runs against OpenClaw on GPT-5.4, and 71.4% against a Claude Code SDK agent on Sonnet 4.6. Success stayed above 80% on two other agent frameworks and on a vector-based memory store instead of plain files. No payload is reproduced here; the mechanism is the point.

Why it matters

The attack cleared the defenses meant to stop it. An input filter built to catch poisoned emails missed the message more than nine times in ten. A model specially hardened to ignore instructions arriving by email still followed the planted one about half the time. Even when the owner explicitly asked, “tell me what you checked and what you did,” the write stayed hidden roughly a quarter of the time on one model.

Stealth is partly a design property, not a bug: capable agents are built to keep tool activity out of the chat, and background runs on a schedule often produce no message at all. This is the same trust-boundary failure behind write-time blind spots in agent memory and stored indirect injection against personal agents: untrusted external content becomes durable, trusted internal state with no visible moment where anyone approved it. It is the persistence upgrade to a lineage that runs from Johann Rehberger’s manual SpAIware against ChatGPT in 2024 to the EchoLeak zero-click email attack on Microsoft 365 Copilot in 2025 — but where those leaked data in the moment, MemGhost leaves a false memory that steers sessions long after the email is gone. It is a concrete instance of the lethal trifecta: private data, untrusted input, and the ability to act.

Defenses

The paper’s authors argue the fix has to live inside the agent, and the affected framework’s maintainers agree in direction. Tag provenance on every piece of information so content that arrived from untrusted channels can never be silently promoted to durable memory. Require explicit user confirmation before anything external reaches long-term storage, and log every memory write so an audit can reconstruct what changed and why. The blunt structural fix is to keep the two dangerous capabilities apart: route untrusted email through a separate reader agent stripped of memory, file, and shell tools, and pass only a sanitized summary to the main agent — a pattern the study did not test and that the maintainers recommend. Failing separation, tightly limit what an email-triggered or background run is allowed to change, and inspect the raw memory files after anything suspicious arrives. Treat memory as a security boundary, not a convenience — see OWASP’s agent memory guidance for controls to build against.

Status

ItemDetail
DisclosurearXiv paper published 6 July 2026; press coverage 13 July 2026
NatureStealth memory injection: untrusted email induces a hidden, persistent memory write that steers later sessions
Primary targetOpenClaw (plain-text AGENTS.md / MEMORY.md); also two other frameworks and a vector memory store
Tested onGPT-5.4 (OpenClaw), Sonnet 4.6 (Claude Code SDK agent)
SuccessUp to 87.5% full-attack success in background mode; evaded input filters and hardened models
PreconditionThe crafted email must already reach an inbox the agent reads; lab-only, no in-the-wild abuse reported
Prior artSpAIware (Rehberger, 2024); EchoLeak email attack on M365 Copilot (2025), tracked as CVE-2025-32711
ClassMemory poisoning via indirect prompt injection; missing provenance and write-time approval

Figures reflect the authors’ benchmark (WhisperBench, 108 cases) as run in sealed lab environments on specific model versions. Agent behavior and model safety change across releases — verify against the current version of any deployment before drawing conclusions.

Sources