Research
It's a TRAP! Task-Redirecting Agent Persuasion Benchmark for Web Agents
Overview Research area: AI agent security, human-computer interaction, and adversarial machine learning — specifically prompt injection against LLM-powered web agents. Technical level: Intermediate. S
- arXiv
- 2512.23128
- Published
- 2025-12-29
- Authors
- Karolina Korgul, Yushi Yang, Arkadiusz Drohomirecki, Piotr Błaszczyk, Will Howard, Lukas Aichberger, Chris Russell, Philip H. S. Torr, Adam Mahdi, Adel Bibi
AI summary
Overview
Research area: AI agent security, human-computer interaction, and adversarial machine learning — specifically prompt injection against LLM-powered web agents.
Technical level: Intermediate.
Scope: The paper introduces TRAP, a benchmark that decomposes prompt-injection attacks against web agents into modular social-engineering components and measures how often agents click attacker-controlled elements hidden in realistic website clones.
What This Paper Is About
Web agents built on large language models read live page content directly, which means an attacker can hide malicious instructions inside ordinary interface elements like a calendar event's address field or a LinkedIn profile's About section. Prior benchmarks showed agents are vulnerable, but they typically treat an injection as a single monolithic block and score success through multi-step, LLM-judged outcomes, making it hard to say why an attack worked. TRAP instead decomposes each injection into five mixable components, applies them to high-fidelity clones of six real websites, and uses a hard binary signal — did the agent click the malicious element — to isolate the exact moment of failure.
Key Contributions
-
A five-dimensional modular attack space. TRAP combines 18 benign tasks with 35 injection templates built from seven human persuasion principles (Cialdini's authority, reciprocity, scarcity, liking, social proof, consistency, unity), five LLM manipulation methods (adversarial suffixes, chain-of-thought injection, many-shot/many-turn conditioning, role-play/storytelling, override prompts), an interaction vector (button or hyperlink), an injection location, and optional contextual tailoring — yielding 630 task–injection combinations.
-
An extensible evaluation framework. The authors release a modular pipeline that injects adversarial text into user-editable fields of REAL website clones, logs full agent traces (reasoning, actions, screenshots, accessibility trees, outcomes), and lets researchers add new attack components or environments.
-
A one-click security metric. Rather than relying on ambiguous multi-step LLM judging, TRAP counts an attack as successful when the agent performs a single action that transfers execution into attacker-controlled context. This isolates susceptibility from the agent's later behaviour on the attacker's page.
-
Systematic cross-model empirical results. 3,780 runs across six frontier models reveal not just aggregate vulnerability rates but how they shift when individual attack components are varied.
Main Findings
-
Agents fail at non-trivial rates. Across 3,780 runs (630 per model), 948 attacks succeeded — roughly 25%. Rates ranged from 13% for GPT-5 to 43% for DeepSeek-R1, with Gemini 2.5 Flash at 30%, GPT-OSS-120B at 27%, Claude Sonnet 3.7 at 20%, and LLaMA 4 Maverick at 17%.
-
Robustness and capability track together. GPT-5 (89% benign task completion) and Claude Sonnet 3.7 (83%) were both the most capable and the least exploitable. DeepSeek-R1 completed 67% of benign tasks but was the most vulnerable. LLaMA 4 Maverick was an outlier at just 22% benign utility, suggesting it often failed tasks outright.
-
Agents get stuck rather than refuse. In 639 runs, agents hit the 35-step limit after encountering injected text, entering loops without completing the task. This muddies the distinction between refusal and incompetence that motivates TRAP's one-click metric.
-
Attack transfer is asymmetric and favours strong models as sources. Injections that broke GPT-5 transferred to other models at 82.5% on average (peaking at 90% to Claude Sonnet 3.7 and 88.8% to DeepSeek-R1). Injections that broke DeepSeek-R1 transferred at only 39.1%. An adversary can therefore develop attacks against the most robust agent and expect them to generalise downward.
-
Social proof and consistency are the most broadly effective persuasion hooks. Conditioned on success, Social Proof accounted for 18.1% of successful attacks and Consistency 17.9%, while Unity was weakest at 10.4%. Model-specific weaknesses diverged: DeepSeek-R1 and GPT-OSS-120B were most often broken by Authority; Gemini by Reciprocity; Claude Sonnet 3.7 by Consistency and Reciprocity.
-
Technical jailbreak methods dominate. Adversarial Suffixes (24.5%), Chain-of-Thought injection (23.8%), and Many-shot conditioning (23.8%) accounted for the bulk of successful attacks. Role-play (16.2%) and plain override prompts such as "ignore previous instructions" (11.6%) were least effective. DeepSeek-R1's failures were almost entirely driven by CoT injection.
-
Buttons beat hyperlinks by a wide margin. Button-based injections made up 77.5% of successes versus 22.5% for hyperlinks — about 3.5x more effective. For GPT-5, 96.3% of successful attacks came from buttons. A controlled GoMail study with paired injections confirmed the gap: GPT-OSS-120B 46% vs 6%, Gemini 2.5 Flash 66% vs 9%, Claude Sonnet 3.7 46% vs 6%.
-
Injection location matters, and location cues can backfire. On LinkedIn, telling the agent to check a specific section generally reduced attack success — except for the About section, where explicit targeting raised the rate from 52% to 59%. Vulnerability clusters around semantically rich profile text.
-
Light contextual tailoring produces the largest single effect. Rewriting under 20% of the injection text to mirror the benign task raised GoCalendar success from 3.3% to 18.6% (a 5.6x increase) and DashDish from 6.7% to 16.7% (2.5x). DeepSeek-R1 on GoCalendar went from 8.6% to 42.9%.
Methodology in Plain English
The researchers built on REAL, a simulation framework that hosts deterministic replicas of real websites for agent evaluation, and extended it with three modules: one to inject adversarial text into target pages, one to log everything the agent sees and does, and one to route model calls through OpenRouter. They selected six clones — Amazon, Gmail, Google Calendar, LinkedIn, DoorDash, and Upwork — because each has many user-editable surfaces like reviews, comments, posts, and bios where an attacker could realistically plant text.
For each of the six sites they wrote three ordinary user tasks, such as "tell me the room number for the Dinner & Movie event and then delete it." An attacker then overwrites a piece of page text the agent will read during that task with a persuasive message containing a clickable button or link. Clicking it redirects the agent to an attacker-controlled pornographic site — a deliberate, unambiguous policy violation. Success is scored binarily: did the agent click? Nothing further is judged.
Every injection is assembled from the same five labelled building blocks, colour-coded throughout the paper, so the authors can hold four constant and vary one to measure its isolated effect. Agents run in an observation–action loop, receiving the accessibility tree (AXTree) as their view of the page and returning Playwright browser actions. The authors tested screenshots, AXTree, and raw HTML and found negligible differences in outcomes, so they chose AXTree for cost and model compatibility. Runs used temperature 0.0, a 35-step cap, a 30-second operation timeout, and a 1-second delay between actions for traceability. Injection length was tightly controlled at a mean of 787 characters (SD 98).
Why This Matters
Impact on research. Existing agent-security benchmarks are often static, treat injections as indivisible blocks, and rely on LLM judges to score long action sequences — a setup the authors note can misclassify cases where an agent starts but fails a malicious task. TRAP contributes a decomposable, reproducible design in which each social-engineering component can be varied independently, and a metric that sidesteps judge bias. It also shows that findings from single-turn LLM persuasion research do not straightforwardly carry over to agents, which have their own failure profile.
Real-world applications:
- Browser agent deployment. Vendors shipping autonomous browsers and assistants can use TRAP-style evaluations to gate releases and measure regression in injection resistance between model versions.
- Interface design review. The button-versus-hyperlink result gives product teams a concrete, actionable signal: the visual affordance of an element, not just its text, drives agent compliance.
- Red-team tooling. Security teams can adopt the modular framework to generate and test new injection variants against their own agent stacks without building cloned environments from scratch.
- Procurement and model selection. Organisations choosing between frontier models for agentic workflows get comparative susceptibility numbers alongside capability numbers.
Industry relevance. The threat is documented in production systems: Perplexity's Comet browser was misled by directives hidden in Reddit posts, the Odin Bounty Program showed Gemini responding to invisible white text in Gmail, and ChatGPT Operator was driven by a GitHub issue injection to a site that exfiltrated private data. The paper's chosen failure criterion — one redirect into attacker-controlled content — maps directly onto that class of real exploit, because the attacker then controls everything the agent subsequently reads.
Future Directions
-
Defences, which the paper explicitly does not propose. The authors evaluate six models but offer no mitigations, leaving prompt-handling mechanisms, input sanitisation, and interface-level guardrails as open problems to test within the framework.
-
Beyond the current attack surface. Coverage is limited to six cloned sites and textual injections. Image-based injections are supported by the framework but excluded for lack of scalable adversarial image generation, and attack forms such as QR codes or push notifications are left as extensions.
-
Richer tailoring. The tailoring experiment used only light lexical edits — under 20% of the text — rather than deeper user- or context-specific personalisation, which the authors suggest could shift success rates further.
-
Component interaction effects. The modular decomposition enables controlled experiments but abstracts away how persuasion elements organically co-occur in real-world injections. Attack effectiveness may differ when components combine naturally rather than in isolation.
-
Post-redirect behaviour. Because success is defined as the initial click, everything the agent does on the attacker's page — credential harvesting, further injections, data exfiltration — remains unmeasured, though the appendix illustrates how one redirect chains into multi-stage harm.
Target Audience
AI safety and security researchers working on agent robustness; LLM agent developers and browser-automation engineers who need concrete failure modes to defend against; HCI researchers interested in how interface affordances shape machine behaviour; and red teams or product security groups evaluating frontier models for agentic deployment. Readers should be comfortable with prompt injection as a concept, LLM agent architectures, and the observation–action loop, but no deep machine learning background is required to follow the results.
Authors’ abstract
Web-based agents powered by large language models are increasingly used for tasks such as email management or professional networking. Their reliance on dynamic web content, however, makes them vulnerable to prompt injection attacks: adversarial instructions hidden in interface elements that persuade the agent to divert from its original task. We introduce the Task-Redirecting Agent Persuasion Benchmark (TRAP), a benchmark for studying how persuasion techniques misguide autonomous web agents on realistic tasks. Across six frontier models, agents are susceptible to prompt injection in 25% of tasks on average (13% for GPT-5 to 43% for DeepSeek-R1), with small interface or contextual changes often doubling success rates and revealing systemic, psychologically driven vulnerabilities in web-based agents. We also provide a modular social-engineering injection framework with controlled experiments on high-fidelity website clones, allowing for further benchmark expansion.