Skip to content
Back to blog list
Yapay Zeka Hafıza Zehirleme Tek E-postayla Mümkün
Cybersecurity

Memory Poisoning With a Single Email: How the MemGhost Attack Works

Automatically translated
Hüseyin Şimşek
Hüseyin ŞimşekAdmin
7 min read
A memory poisoning attack on AI agents works with a single email. MemGhost reached an 87.5% success rate on the OpenClaw agent. How does it work, and how can you protect yourself?

A single email sent to an AI assistant with memory can permanently change what that assistant knows about the user. A study published on arXiv on July 6, 2026 demonstrated the technique with an automated tool called MemGhost, and reached an 87.5% success rate in background-mode tests. The attack is called covert memory injection. This article covers how the attack works, how effective it was in testing, and which defenses work.

What Is a Memory Poisoning Attack?

Memory poisoning is an attack that plants a fake record in the information an AI agent stores between sessions. The target is not the model itself, but the notebook the model reads at the start of every new session.

Persistent personal agents differ from chatbots that forget everything when a conversation ends. They keep your preferences, your contacts and the tasks you have given them in files. OpenClaw, the primary target of the study, stores its persistent instructions in plain text files such as AGENTS.md, and what it learns about the user in files such as MEMORY.md. At the start of each session, these files are loaded into the model's context.

This is exactly why the assistant feels personalized. The same structure also creates a lasting place for harmful content to take root.

Kalıcı kişisel ajan mimarisi: ayrı oturumların ortak bir hafıza katmanından beslenmesini ve bu katmanın saldırı yüzeyine dönüşmesini gösteren şema

How Does MemGhost Work With a Single Email?

The attacker needs no password, no account and no prior access. A normal-looking email is sent to a user whose agent is set up to check their inbox. Hidden in the text is an instruction written for the assistant, not for the human recipient.

If the email-processing skill takes in this instruction, three things happen in sequence:

  • Writing: The agent uses its own file-writing tool to save the fake note into its persistent memory.

  • Concealment: The response the user sees does not mention this action.

  • Steering: In a later session, that note changes what the assistant says or does.

Email is a convenient channel for this. It is asynchronous, high-volume and naturally carries personal information. Anyone who knows the address can put content in front of the agent without any permission.

The researchers did not write the payload by hand. MemGhost was trained against a shadow copy of the agent, and emails that successfully poisoned memory while keeping the visible reply quiet were rewarded. The result was a production pipeline that works in a single shot and does not require a back-and-forth dialogue.

MemGhost saldırı zinciri: tek bir e-postanın önce hafızaya yazılması, sonra görünen cevapta gizlenmesi ve ilerleyen oturumlarda davranışı yönlendirmesi

How Successful Was the Attack in Tests?

The numbers show that the attack ran consistently under laboratory conditions.

According to the results reported by CybersecAsia, full covert memory takeover was achieved in 56 new test cases: planting the fake memory, hiding it, and influencing later behavior. In background mode, OpenClaw running on GPT-5.4 reached an 87.5% success rate. For the Claude Code SDK agent using Sonnet 4.6, the rate was 71.4%.

The picture on the defense side is more troubling. According to The Hacker News, an input filter set up to catch poisoned emails missed the MemGhost message in more than nine out of ten attempts. Even a model hardened to ignore instructions arriving by email followed the planted instruction roughly half the time. Even when users directly asked what it was checking and doing, the attack stayed hidden in about a quarter of cases on one model.

The study also built a benchmark set of 108 cases. The set covers outcome-level risk categories such as health and safety, financial harm, information integrity and cybersecurity. The harm a poisoned memory can cause is not limited to a wrong movie recommendation.

MemGhost test sonuçlarının görselleştirmesi: arka plan modunda ulaşılan başarı oranları ile savunma filtrelerinin kaçırma oranlarını karşılaştıran veri grafiği

How Is It Different From Classic Prompt Injection?

Indirect prompt injection is not a new concept. Tests on malicious AI models had already shown that these systems are not robust enough against direct and indirect prompt injection attacks.

What MemGhost adds is persistence. In earlier examples, the poisoned instruction was placed by hand, or data was leaked only at the moment it was requested. Here, an automated payload turns a single email into a fake memory, and that memory keeps steering sessions even after the message itself has been deleted.

Feature

Classic prompt injection

Covert memory injection

Duration of effect

Single session, immediate

Persists across sessions

Payload creation

Mostly crafted by hand

Automated, single shot

Visibility

Usually leaves a trace in the reply

Leaves no trace in the visible reply

Trigger moment

When the instruction is read

In a session days later

User detection

Possible

Can stay hidden even when asked

The difference also shows in the target. A classic injection forces the agent to do something at that moment. A memory injection changes what the agent believes and leaves the timing to the attacker.

Klasik prompt enjeksiyonu ile gizli hafıza enjeksiyonunun karşılaştırması: anlık sönen bir etki ile kalıcı olarak yerleşen bir etkinin görsel ayrımı

Why Is a Quick Patch Not Expected?

No fix is expected, because the attack does not break any security boundary.

OpenClaw's security policy considers prompt injection on its own out of scope. For an injection to qualify as a fix target, it has to cross a boundary of authority, tool policy, approval or sandbox. MemGhost crosses none of these. It uses the memory-writing tool that the agent was given, exactly as it was designed to be used.

The problem therefore comes from a design choice more than from a technical flaw. The researchers stress this point: the danger is not that AI systems can read untrusted content. The danger is that they can store that content as trusted memory without any visible approval step.

This differs from data poisoning, a term often discussed in AI security debates. Data poisoning happens during training and corrupts the model. Memory poisoning happens at runtime, does not change the model at all, and targets a single user.

Hiçbir güvenlik sınırını aşmayan saldırı: yetki, araç politikası, onay ve sandbox katmanlarının arasından geçen hafıza yazma yolunu gösteren görsel

How Can Users and Developers Protect Themselves?

The core fix is to separate two jobs: reading untrusted email, and writing to one's own memory.

OpenClaw's own security guidance recommends running untrusted email through a separate reader agent. That reader agent has its memory, file and shell tools removed, and only a summary is passed to the main agent.

The study's authors argue that the fix needs to live inside the agent. They propose three measures:

  • Source labeling: Each piece of information is recorded with where it came from.

  • Write approval: Nothing moves into persistent memory without asking the user.

  • Audit logging: Every memory write is logged and can be reviewed after the fact.

OpenClaw said it is evaluating memory-write controls for external content. Source information, audit logs and approval prompts are on the table.

On the enterprise side, the wind is blowing in the same direction. According to SecurityWeek, the UK's NCSC launched Cyber Shield, an agent-based defense program, on July 7, 2026, and issued a broad call for collaboration spanning academia to critical infrastructure operators. The European Commission also presented a plan on July 7 addressing the cybersecurity risks of advanced AI. The plan explicitly notes that AI could be misused to automate attacks and scale up incidents.

İzole okuyucu ajan mimarisi: güvenilmeyen e-postanın hafıza ve dosya araçlarından arındırılmış ayrı bir katmanda işlenmesini gösteren savunma şeması

What Is the Community Saying?

The debate is not about whether the attack is real, but about whether the experimental setup is fair.

Those who take the research seriously point to the defense figures. Filters almost completely failing, and even hardened models following the instruction about half the time, suggest the problem will not be closed with a patch. There is also an unavoidable irony: concealment is fed by how well agents are designed. The only model that gave itself away was caught because it printed its intermediate steps in the reply. As agents get better at working silently, detection will get harder.

The other side, OpenClaw, says the isolated reader agent configuration proposed by the study has not been tested. It also argues that the model tier makes a difference: the tests ran on GPT-5.4, and Claude Opus 4.6 was skipped for cost reasons. The company points to a public competition in which thousands of injection emails failed to extract secrets from an Opus 4.6 agent. But that competition targeted data theft, not memory poisoning. So the objection does not directly answer the study. Whether model tier really makes a difference will not be settled until the tests are rerun on newer releases such as Claude Sonnet 5.

One caveat deserves emphasis. There is no ongoing attack in the field. Everything was run in sealed test environments with fake inboxes and fake users. The researchers said they will share their findings with the affected agent and model developers.

Araştırmacılar ile geliştirici tarafının ayrışması: hafıza zehirleme bulgularının deney kurulumu üzerinden tartışılmasını anlatan kavramsal görsel

Frequently Asked Questions

Which tools are affected by memory poisoning attacks? Any personal agent that has persistent memory and can read untrusted content is at risk. The study tested OpenClaw and an agent based on the Claude Code SDK. What matters is not the product name, but whether the same agent can read external content and write to its own memory without asking for approval.

Is an average ChatGPT user affected by this? The likelihood of direct impact is low. The attack targets setups where the agent can access an inbox and run on its own in the background. An assistant that only chats and is not connected to email is not exposed to this vector.

How can you tell if memory has been poisoned? It is not easy. In the tests, the attack stayed hidden in about a quarter of cases on one model, even when the user asked directly. A practical method is to open and read the agent's memory files by hand. In tools like OpenClaw, these files are stored as plain text.

Does switching to a new model solve the problem? It may reduce the problem partially but will not eliminate it. Even a hardened model followed the planted instruction roughly half the time. Model tier lowers the success rate but does not remove the attack surface, because the problem lies in the architecture.

Has this attack actually been used? No. The findings are laboratory results. The tests were run in sealed environments with fake inboxes and fake users, and were not used against real people.

The value of assistants with memory comes from remembering the user. That same feature also gives an attacker a lasting handle. While AI identity impersonation fraud built on voice cloning imitates the user themselves, memory poisoning imitates what the user's assistant knows about them. What the two share is that the attack now targets trust rather than the system. How much authority agents should be given seems likely to become the question of which authority gets taken back in the coming period.

A single email sent to an AI assistant with memory can permanently change what that assistant knows about the user. A study published on arXiv on July 6, 2026 demonstrated the technique with an automated tool called MemGhost, and reached an 87.5% success rate in background-mode tests. The attack is called covert memory injection. This article covers how the attack works, how effective it was in testing, and which defenses work. What Is a Memory Poisoning Attack? Memory poisoning is an attack that plants a fake record in the information an AI agent stores between sessions. The target is not the model itself, but the notebook the model reads at the start of every new session. Persistent personal agents differ from chatbots that forget everything when a conversation ends. They keep your preferences, your contacts and the tasks you have given them in files. OpenClaw, the primary target of the study , stores its persistent instructions in plain text files such as AGENTS.md, and what it learns about the user in files such as MEMORY.md. At the start of each session, these files are loaded into the model's context. This is exactly why the assistant feels personalized. The same structure also creates a lasting place for harmful content to take root. How Does MemGhost Work With a Single Email? The attacker needs no password, no account and no prior access. A normal-looking email is sent to a user whose agent is set up to check their inbox. Hidden in the text is an instruction written for the assistant, not for the human recipient. If the email-processing skill takes in this instruction, three things happen in sequence: Writing: The agent uses its own file-writing tool to save the fake note into its persistent memory. Concealment: The response the user sees does not mention this action. Steering: In a later session, that note changes what the assistant says or does. Email is a convenient channel for this. It is asynchronous, high-volume and naturally carries personal information. Anyone who knows the address can put content in front of the agent without any permission. The researchers did not write the payload by hand. MemGhost was trained against a shadow copy of the agent, and emails that successfully poisoned memory while keeping the visible reply quiet were rewarded. The result was a production pipeline that works in a single shot and does not require a back-and-forth dialogue. How Successful Was the Attack in Tests? The numbers show that the attack ran consistently under laboratory conditions. According to the results reported by CybersecAsia , full covert memory takeover was achieved in 56 new test cases: planting the fake memory, hiding it, and influencing later behavior. In background mode, OpenClaw running on GPT-5.4 reached an 87.5% success rate. For the Claude Code SDK agent using Sonnet 4.6, the rate was 71.4%. The picture on the defense side is more troubling. According to The Hacker News , an input filter set up to catch poisoned emails missed the MemGhost message in more than nine out of ten attempts. Even a model hardened to ignore instructions arriving by email followed the planted instruction roughly half the time. Even when users directly asked what it was checking and doing, the attack stayed hidden in about a quarter of cases on one model. The study also built a benchmark set of 108 cases. The set covers outcome-level risk categories such as health and safety, financial harm, information integrity and cybersecurity. The harm a poisoned memory can cause is not limited to a wrong movie recommendation. How Is It Different From Classic Prompt Injection? Indirect prompt injection is not a new concept. Tests on malicious AI models had already shown that these systems are not robust enough against direct and indirect prompt injection attacks. What MemGhost adds is persistence. In earlier examples, the poisoned instruction was placed by hand, or data was leaked only at the moment it was requested. Here, an automated payload turns a single email into a fake memory, and that memory keeps steering sessions even after the message itself has been deleted. Feature Classic prompt injection Covert memory injection Duration of effect Single session, immediate Persists across sessions Payload creation Mostly crafted by hand Automated, single shot Visibility Usually leaves a trace in the reply Leaves no trace in the visible reply Trigger moment When the instruction is read In a session days later User detection Possible Can stay hidden even when asked The difference also shows in the target. A classic injection forces the agent to do something at that moment. A memory injection changes what the agent believes and leaves the timing to the attacker. Why Is a Quick Patch Not Expected? No fix is expected, because the attack does not break any security boundary. OpenClaw's security policy considers prompt injection on its own out of scope. For an injection to qualify as a fix target, it has to cross a boundary of authori

Etiketler:Yapay Zeka Hafıza ZehirlemeYapay Zeka Hafıza Zehirleme 2026Hafıza Zehirleme Saldırısı NedirMemGhost OpenClaw SaldırısıYapay Zeka Asistanı Güvenliği
Hüseyin Şimşek
Hüseyin ŞimşekAdmin
@huseyincsec

Comments (0)

Log in to comment.

Log in
No comments yet. Be the first to comment!