Skip to content

Context manipulation attacks: web agents are vulnerable to memory poisoningContext manipulation attacks : Web agents are susceptible to corrupted memory

arXiv· arXiv:2506.17318· Atharv Singh Patlan, Ashwin Hebbar, Pramod Viswanath, Prateek MittalPrinceton UniversityIndexed by this site · 23 days ago· Originally publishedSelected AttacksSelectedAttention41

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose a plan injection attack against web navigation agents, stating that on Agent-E the ASR for opinion-type tasks reaches 94.7% and that it can bypass prompt injection defenses.

Threat modelThe attacker cannot modify the user's original instruction p0, browser observations, system prompt or agent code, and can only inject content δh into the stored context ht (plan injection instead modifies the planner's task plan Pi); the goal is to make the agent additionally perform unauthorized tasks, replace the original task, or complete the original task with compromised reasoning. The authors describe this as the weakest form of context manipulation, used to give a lower bound on the vulnerability.

Questions
Web navigation agents rely on external memory managed by the client or a third party to maintain context, which the authors consider to create a tamperable attack surface; existing prompt injection defenses do not cover manipulation of the agent's internal task representation.
Methods
The authors formalize context manipulation attacks and propose plan injection: injecting malicious steps into the task plan generated by the planner, divided by complexity into three levels—non-contextual, task-aligned, context-chained—with injection content dynamically generated using GPT-4o.
Experiments and results
On Agent-E, task-aligned injection achieves ASR 94.7% on opinion tasks and 18.7% on factual tasks; SANDWICH and SECURE defenses reduce the ASR of prompt injection, but a single plan injection still reaches 46% (Agent-E) and 63% (Browser-use).
Limitations and future work
The authors state that stronger reasoning models may lower ASR, but a full evaluation is left for future work; the experiments cover only two agents, Browser-use and Agent-E, with backbone models GPT-4o and GPT-4o-mini, and the paper reports no variance tests beyond human review and number of repetitions.
Experimental setupGPT-4o、GPT-4o-mini · Plan Injection Benchmark、WebVoyager-Privacy · ASR
Evaluated models
GPT-4oGPT-4o-mini
Benchmarks
Plan Injection BenchmarkWebVoyager-Privacy
Metrics
ASR
AI summaryand selection rationaleThe paper proposes and formalizes the "plan injection" attack, which induces web agents to perform unauthorized operations by tampering with their task plan context, and validates it on Browser-use and Agent-E. The authors first added two types of prompt defenses, Sandwich and Secure, to both agents; prompt injection was blocked, but a single plan injection during the initial planning stage still reached 46% on Agent-E and 63% on Browser-use. On the Agent-E plan injection benchmark, task-aligned injection achieved a 94.7% success rate on opinion-type tasks and 18.7% and 0% on fact-type tasks; in privacy leakage tasks, context-chained injection achieved a 53.3% success rate. Without defenses, the attack success rates of both against privacy leakage exceeded 80%. In the experiments, GPT-4o was used for planning and the controller, and GPT-4o-mini handled browser navigation.

The paper proposes and formalizes the "plan injection" attack, which induces web agents to perform unauthorized operations by tampering with their task plan context, and validates it on Browser-use and Agent-E. The authors first added two types of prompt defenses, Sandwich and Secure, to both agents; prompt injection was blocked, but a single plan injection during the initial planning stage still reached 46% on Agent-E and 63% on Browser-use. On the Agent-E plan injection benchmark, task-aligned injection achieved a 94.7% success rate on opinion-type tasks and 18.7% and 0% on fact-type tasks; in privacy leakage tasks, context-chained injection achieved a 53.3% success rate. Without defenses, the attack success rates of both against privacy leakage exceeded 80%. In the experiments, GPT-4o was used for planning and the controller, and GPT-4o-mini handled browser navigation.

Why it was selectedThe material gives the success rates of plan injection on two types of web agents, which can be used to understand where the differences in protection come from by comparing the layered architecture and task types.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors study the problem of tampered memory/context in Web navigation agents and propose and formalize the plan injection attack.

    Core question: Web navigation agents rely on external memory that can be tampered with by third parties; the authors study whether context manipulation attacks (plan injection) targeting their internal task representation are feasible and how effective they are.

    • Problem scenario: LLMs themselves are stateless, and Web agents rely on external memory to maintain cross-step context; unlike systems such as ChatGPT that centrally manage conversation history, an agent's context is often managed by the client or a third-party service, which the authors consider a security gap, and they mention the incident in which DeepSeek exposed chat context via a publicly accessible ClickHouse database (Nagli, 2025).
    • Existing gaps: the authors state that indirect prompt injection has been widely studied but defenses remain incomplete; Agent-E's hierarchical planning architecture appears able to mitigate persistent memory vulnerabilities, and this paper challenges that assumption.
    • Core observation: planning-type agents such as Agent-E place a high-level task plan Pi in the planner's context, and directly modifying that plan can influence behavior without touching user instructions or webpage observations.
    • Paper contributions: formalize plan injection; propose three levels of injection strategy (non-contextual, task-aligned, context-chained); construct two evaluation sets, Plan Injection Benchmark and WebVoyager-Privacy.
    • Threat model (Section 4.1):
      • Attacker goals: make the agent perform an unauthorized task Ta beyond the legitimate task Tv, replace Tv with Ta, or complete Tv with compromised reasoning; concretized into four attack categories: false reasoning, advertisement injection, privacy leakage, goal hijacking.
      • Attacker knowledge: the paper does not explicitly use white-box/black-box terminology; the setting is that the attacker cannot modify the user's original instruction p0, browser observations, system prompt, or agent code.
      • Attacker capability: can only inject content δh into the stored context ht (plan injection is modifying the plan Pi); the authors state this is the weakest form of context manipulation, used to give a lower bound on the vulnerability.
      • Victim systems: two open-source Web navigation agents, Browser-use and Agent-E.
  2. What related research exists?

    Related work falls into three groups: web navigation agents, prompt injection attacks against language agents, and attacks against agent memory.

    Web navigation agents

    • WEBVOYAGER (He et al., 2024): a unified success-rate evaluation benchmark across diverse Web tasks; this paper's WebVoyager-Privacy is sampled and adapted from it.
    • Browser-use (Muller & Zunic, 2025) and Agent-E (Abuelsaad et al., 2024): the two open-source agents selected in this paper; the former makes single-step decisions via a controller, the latter is hierarchical with a Planner Agent and a Browser Navigation Agent. The authors state that the two represent current mainstream architectures.
    • CoALA (Sumers et al., 2023): a cognitive architecture framework proposing that agents need dedicated memory modules; this paper uses it to illustrate the necessity of memory.

    Attacks against language agents

    • Indirect prompt injection (Greshake et al., 2023; Zhan et al., 2024; Debenedetti et al., 2024): embedding malicious instructions in retrieved content to hijack the agent; the paper cites OWASP (2024) calling it the top security risk for LLMs.
    • Direct prompt injection (Perez & Ribeiro, 2022; Chen et al., 2024a): bypassing safety guardrails through carefully crafted user input.
    • Web agent jailbreak (Kumar et al., 2024; Chiang et al., 2025): the paper states that even if the underlying model is trained to refuse, Web agents remain susceptible to jailbreak.

    Attacks against agent memory

    • AgentPoison (Chen et al., 2024c): optimized backdoor triggers poison knowledge base retrieval, biasing the agent's context.
    • MINJA (Dong et al., 2025): trajectory poisoning, injecting crafted fragments into interaction history to mislead current decisions.
    • ElizaOS attacks (Patlan et al., 2025a;b): tampering with conversation history in external databases to induce Web3 financial agents to execute unauthorized transactions; this paper's formalization of context manipulation follows that work and adapts it to Web agents.

    Baselines and defense comparisons: prompt injection baselines are weak PI (single retrieval injection) and strong PI (per-step retrieval injection); defense baselines are SANDWICH (Debenedetti et al., 2024; Schulhoff, 2023) and SECURE system prompt safety guidelines (Bai et al., 2022; Hubinger et al., 2024).

    The authors position this paper as: extending memory manipulation attacks from financial agents to multi-step Web navigation agents, and noting that plan injection differs from prompt-layer or data-layer attacks by directly targeting the persistent task plan.

  3. How does the paper address this problem?

    The authors formalize a context manipulation framework, propose a three-level plan injection strategy, and construct two benchmark evaluations.

    Overall approach: abstract the agent as a context-driven decision system, where a bounded perturbation to the context by an attacker can manipulate behavior; for planning-type agents, the perturbation falls on the task plan, which is plan injection.

    Agent framework and formalization

    • The agent consists of four parts: Perception Layer, Memory System, Decision Engine, Action Module; the context at time t is ct = (pt, dt, k, ht), corresponding to the user prompt, external data, static knowledge, and interaction history respectively.
    • The decision engine M maps the context to a probability distribution over action sequences, and actions are selected as at = arg max P(a | ct); Agent-E's Planner Agent corresponds to the Decision Engine, and the Browser Navigation Agent corresponds to the Action Module.
    • Context manipulation is modeled as injecting a bounded perturbation: c∗t = ct ⊕ δ, |δ| ≤ β, where ⊕ denotes injection into a specific context component and β limits the scale of manipulation.

    Three attack vectors and plan injection

    • DPI: tampering with the user prompt pt; IPI: tampering with external data dt (embedding malicious instructions in webpages); MI: tampering with stored history ht, with two mechanisms: direct (modifying backend storage) and indirect (gradually poisoning memory via prompt injection).
    • Plan injection: Agent-E sessions are independent and cannot modify history, but its planner context is augmented as ci,t = (pi, di,t, k, hi,t, Pi), and the attack directly modifies the plan: c* = (pi, di,t, k, hi,t, Pi ⊕ δP).

    Three levels of injection strategy

    • Non-contextual injection: directly inserting malicious steps unrelated to the user task; the authors state this usually fails against hierarchical agents like Agent-E because the planner cross-validates against the user's original intent.
    • Task-aligned injection: adopts a foot-in-the-door strategy (Nakash et al., 2024), first establishing topical relevance to the task before introducing malicious content, which the authors state can bypass planner filtering.
    • Context-chained injection: constructs a causal chain among the user task, intermediate goals, and the attacker's goal, forming a seemingly natural progression; used for complex goals such as privacy theft.

    Benchmark construction

    • Plan Injection Benchmark: covers four attack target categories (factual manipulation, opinion steering, advertisement injection, privacy exfiltration), 15 samples per category, each sample executed 5 times; samples are semi-automatically generated using standardized templates and GPT-4o, containing the user query, injection content, and success criteria.
    • WebVoyager-Privacy: takes 9 domains from the WebVoyager dataset, 5 tasks per domain, 45 scenarios in total; the attack goal is uniformly to exfiltrate the user's name, date of birth, and address to an untrusted external domain.
    • Dynamic injection generation: rather than static injections, an LLM dynamically generates injection content based on the current agent output trajectory, the attack goal, and the foot-in-the-door context defined in the dataset; the paper does not specify the exact model of this LLM.

    Success determination

    • The main metric is ASR: the proportion of attempts in which the agent executes the attacker's goal; determined separately by category—factual tasks check whether the injected specified wrong answer is given, opinion tasks check whether the injected opinion is expressed, advertisement tasks check whether the specified product is promoted, and privacy tasks check whether sensitive data is sent to the attacker-specified destination.
  4. What experiments did the paper conduct?

    The authors evaluate the three levels of injection on Agent-E and Browser-use, stating that plan injection can bypass prompt injection defenses.

    Experimental setup

    • Evaluated agents: Browser-use and Agent-E; both use GPT-4o for the controller/planner and GPT-4o-mini for the browser navigation component, running in headless mode.
    • Benchmarks: Plan Injection Benchmark (4 categories × 15 samples × 5 executions); WebVoyager-Privacy (9 domains × 5 tasks = 45 scenarios).
    • Attack variants: three levels of injection—non-contextual, task-aligned, context-chained; privacy tasks additionally test context-chained.
    • Prompt injection baselines: weak PI (single retrieval injection), strong PI (per-step retrieval injection); CI is a single plan injection (injected only once at the planner's first planning).
    • Defenses: SANDWICH (wrapping external content in <data> tags and declaring it as data) and SECURE (adding safety guidelines to the system prompt).
    • Metrics: ASR; on WebVoyager-Privacy, partial success (attacker gains tool access) is distinguished from full success (complete privacy data exfiltration).

    Main results

    ASR of Agent-E on the Plan Injection Benchmark (according to Figure 3 and the Section 6.1 main text):

    Swipe horizontally to read the table

    Task typeNon-contextualTask-alignedContext-chained
    Opinion70.7%94.7%not reported
    Factual0%18.7%not reported
    Advertisementnot reported78.7%not reported
    Privacy0%35.6%53.3%
    • The authors state that subjective tasks are inherently more manipulable: opinion tasks succeed even when absurd instructions are injected, while factual tasks show resistance due to semantic constraints.
    • The authors state that there is an effectiveness hierarchy among injection strategies: non-contextual basically fails against Agent-E, task-aligned achieves moderate success, and context-chained is most effective on privacy tasks.
    • Figure 4 presents a semantic analysis (based on the first 20% of tasks in WebVoyager-Privacy): the authors state that context-chained injection balances similarity to the user task and alignment with the attacker's goal; the figure is an embedding cosine similarity comparison, and specific values are not given in the figure caption text.

    WebVoyager-Privacy: cross-architecture and defense evaluation

    • Without defenses: the authors state that the ASR of both Browser-use and Agent-E against prompt injection and plan injection exceeds 80% (Figure 5).
    • With defenses: SANDWICH and SECURE reduce Agent-E's ASR against weak PI and strong PI (the main text says dramatically reduced; the specific bar heights in Figure 5 are not legible in the text); but a single plan injection still maintains an ASR of 46% (Agent-E) and up to 63% (Browser-use).
    • Injection complexity comparison (Figure 6, Agent-E / Browser-use): context-chained is not given in the main text for Agent-E / 63%; task-aligned is 20.6% / 31%; no-context is not given / 19%. The authors state that Browser-use is more vulnerable because it lacks an explicit planning layer and incorporates memory content into execution with almost no verification.

    Semantic similarity analysis

    • What was measured: cosine similarity of embeddings between the injected text and the user task, and between the injected text and the attacker's goal (Figure 4).
    • Results: the authors state that non-contextual injection is far from the user task in semantic space, task-aligned establishes topical relevance, and context-chained balances both.
    • Authors' interpretation: attack success depends on the degree of semantic integration, not on whether malicious content appears.

    Other ablations and analyses

    • Factual tasks: non-contextual injection ASR 0%, task-aligned 18.7% (Figure 3).
    • Privacy tasks: non-contextual 0%, task-aligned 35.6%, context-chained 53.3% (Section 6.1).
    • Advertisement tasks: task-aligned 78.7% (Section 6.1).
    • The authors mention that preliminary experiments suggest stronger reasoning models may further reduce ASR, but give no numbers, leaving full evaluation to future work (citing Wu et al., 2025).

    Negative results and exceptions

    • Non-contextual injection has an ASR of 0% against Agent-E on privacy and factual tasks; the authors explain this as the hierarchical planner cross-validating injected steps against user intent.
    • Factual tasks have lower ASR than other categories under all injection strategies; the authors attribute this to factual constraints providing a natural immunity that subjective tasks lack.
  5. What are some points that can be further explored?

    The authors state that evaluation of stronger reasoning models is left for future work, and propose two potential directions for defenses.

    Limitations and future directions noted by the authors

    • Stronger reasoning models not evaluated (Section 6.2): preliminary experiments suggest stronger reasoning models may further reduce attack success rates, but a comprehensive evaluation of such models remains an important direction for future work.
    • Defense direction one (Section 7): develop more robust models that can detect semantic inconsistency and malicious manipulation, effective even at small model sizes, possibly via specialized fine-tuning targeting context integrity.
    • Defense direction two (Section 7): implement a principled memory management system that enforces strict isolation and integrity guarantees, making context manipulation fundamentally impossible rather than merely more difficult.
    • The paper has no dedicated Limitations section; all of the above come from the results discussion and conclusion.

    Scope of experiments

    • The evaluated agents are two open-source systems, Browser-use and Agent-E; the controller/planner uses GPT-4o, and the browser navigation component uses GPT-4o-mini (Section 6).
    • The evaluation benchmarks are the self-built Plan Injection Benchmark (4 categories × 15 samples, each sample executed 5 times) and WebVoyager-Privacy (45 scenarios) (Sections 5.1, 5.2).
    • Defense evaluation includes two prompt-layer defenses, SANDWICH and SECURE, both evaluated on Agent-E; results under defense for Browser-use are given in Figure 6 (Section 6.2).
    • Attack targets cover four categories: factual manipulation, opinion steering, advertisement injection, privacy exfiltration; goal hijacking is listed as an attack type in Section 4.1, but the benchmark has no corresponding category.
    • The paper does not report the specific LLM used to dynamically generate injection content, the iteration budget or number of queries for injection generation, nor human review or statistical significance tests.
  6. Summarize the main content of the paper

    The authors propose the plan injection attack and evaluate two web agents, stating that existing prompt injection defenses cannot stop it.

    An attack paper targeting Web navigation agents: the authors formalize the agent as a context-driven decision system, point out that its external memory/task plan can be tampered with, and propose plan injection—directly injecting malicious steps into the planner's task plan.

    • Problem addressed: agent context is often managed by the client or a third party, which the authors consider a security gap; existing prompt injection defenses do not cover manipulation of the internal task representation.
    • Method highlights: three levels of injection strategy—non-contextual (direct insertion), task-aligned (foot-in-the-door to establish task relevance), context-chained (constructing a causal chain from the user task to the attack goal); injections are dynamically generated by an LLM according to the current trajectory; two self-built benchmarks, Plan Injection Benchmark and WebVoyager-Privacy.
    • Main results:
      • On Agent-E, task-aligned injection achieves ASR 94.7% on opinion tasks, 18.7% on factual tasks, and 78.7% on advertisement tasks; context-chained achieves 53.3% on privacy tasks (Figure 3 and Section 6.1).
      • Without defenses, both agents' ASR against prompt injection and plan injection exceeds 80% (Figure 5).
      • SANDWICH and SECURE defenses reduce the ASR of prompt injection, but a single plan injection still reaches 46% (Agent-E) and up to 63% (Browser-use) (Figures 5, 6).
      • On Browser-use, the ASR of no-context, task-aligned, and context-chained injection is 19%, 31%, and 63% respectively, all higher than the corresponding levels on Agent-E (Figure 6).
    • Authors' conclusion: prompt-layer defenses are insufficient to guarantee agent security, and secure memory handling must be a first-class concern in agent system design; the authors propose two directions—robust models that can detect semantic inconsistency (possibly via specialized fine-tuning), and memory management systems that enforce isolation and integrity guarantees.
Read originalarxiv.org