arXiv:2611.11971cs.CRNov 2026

Manuscript Offprint

arXiv:2611.11971

Harness Matters: Measuring and Dissecting Security Resilience in Web Agents

Xinyi Wu, Jiagui Chen, JiaYi Dong, Geng Hong, Xudong Pan, Jiarun Dai, Mingxuan Liu, Min Yang

Xinyi Wu¹§, Jiagui Chen¹§, JiaYi Dong¹, Geng Hong¹✉, Xudong Pan¹,², Jiarun Dai¹, Mingxuan Liu³, Min Yang¹,⁴✉

¹Fudan University, ²Shanghai Innovation Institute, ³Zhongguancun Laboratory,

⁴Shanghai Pudong Research Institute of Cryptology

¹{xinyiwu20, jgchen20, qhong, xdpan, jrdai, m_yang}@fudan.edu.cn, ¹dongjy25@m.fudan.edu.cn, ³liumx@mail.zgclab.edu.cn

✉: Corresponding authors

Abstract—Web agents extend LLMs from text generation to real-world web interaction by relying on execution harnesses that interpret user goals, perceive webpages, plan actions, and ground model decisions into browser operations. While prior work has recognized that agent security depends on more than the backend model alone, how harness design quantitatively shapes web-agent security remains insufficiently measured.

To systematically study web-agent harness security, we first characterize web-agent harnesses as a four-stage execution workflow covering goal interpretation, webpage perception, reasoning and planning, and action execution. Based on this abstraction, we build WEBTRAP FARM*, a systematic and extensible evaluation framework covering three representative attack categories: malicious user prompts, malicious prompt injection, and deceptive web design. To avoid conflating security with task capability, we use paired usability calibration tasks to separate genuine defensive behavior from capability limitations.

Our evaluation shows that existing web-agent harnesses remain vulnerable to typical attacks, with some unsafe behaviors occurring even without explicit attack content, revealing harness-intrinsic security failures (RQ1). Statistical analysis further shows that both harness and backend model significantly affect security outcomes, indicating that deployed-agent security is jointly shaped by the harness and backend model (RQ2). Finally, we localize where defensive behavior emerges across workflow stages and identify more secure design mechanisms, providing actionable guidance for building more robust web agents (RQ3). These findings highlight the web-agent harness as an important security boundary and motivate moving beyond model-centric defenses toward harness-level security design.

1. Introduction

Large language models (LLMs) are increasingly integrated into agents that autonomously interact with real web environments. Unlike chatbots, web agents automate practical tasks such as information retrieval, online transactions, and appointment scheduling [1, 2, 3, 4]. However, exposing LLMs to untrusted webpages and connecting model outputs to real-world actions introduce broad security threats,

including malicious user prompts [5, 6], webpage prompt injection [7, 8, 9, 10], and deceptive webpage designs [11, 12].

Prior studies have shown that web agents can be easily attacked, but they provide limited insight into why unsafe actions are executed. Most evaluations focus on the robustness of backend models against malicious instructions or adversarial webpage content [8, 13]. Although recent academic and industry efforts have recognized that system-level design choices beyond the backend model can affect agent security [14, 15, 16], how harness design quantitatively shapes web-agent security across different systems and attack surfaces remains insufficiently measured.

Existing evaluations provide limited support for such measurement because they often entangle harness-level security with model robustness and task capability. Specifically, these works face three limitations. First, they often focus on a specific type of attack, making it difficult to understand the overall security exposure of web agents across different attack surfaces. Second, they may conflate attack failures caused by insufficient task capability with successful defenses, which overestimates the agent's security resilience and introduces bias into the evaluation. Third, existing benchmarks are often coupled to specific agent harnesses, imposing substantial manual effort on cross-harness and systematic evaluation.

Our Work. Therefore, we present WEBTRAP FARM, a unified framework for quantitatively measuring and dissecting security resilience in web agents. WEBTRAP FARM enables systematic cross-harness evaluation while separating security behavior from task incapability and localizing where defensive behavior emerges in the execution workflow. It includes an extensible benchmark covering three major attack categories across different attack surfaces: Malicious User Prompts, Malicious Prompt Injection, and Deceptive Website Design. To avoid conflating security with task failure, WEBTRAP FARM introduces paired usability calibration tasks that distinguish defense success from cases where an agent simply cannot complete the original task. It also provides a cross-harness execution and monitoring suite based on webpage instrumentation, enabling consistent evaluation without additional manual effort. We conduct experiments around three research questions:

RQ1: How vulnerable are web-agent harnesses and backend models under different attack surfaces? We

§. These authors contributed equally to this work.

*. https://github.com/Agrfeblove/WebTrapFarm first evaluate the end-to-end vulnerability of both open-source harnesses and commercial web agents. We instantiate representative harnesses with multiple backend models and measure their attack success rates, including naive attacks that contain no explicit injected instruction or deceptive content. This design allows us to test whether unsafe execution depends on specific harnesses or models, and whether it can arise from ordinary task execution. Our results show that vulnerabilities persist across the open-source harnesses, with an overall attack success rate of 32.55%. The evaluated commercial systems achieve lower attack success rates but still exhibit meaningful vulnerabilities.

RQ2: How much does the web-agent harness matter for agent security resilience? We next examine the effects of harness and backend model on security resilience. Using usability calibration, we apply a mixed-effects logistic regression to quantify harness and model effects while accounting for repeated tasks and attack-category effects. Our results show that the harness, backend model, and their interaction all have significant effects on security outcomes (p<10−45p < 10^{-45}), and remain robust under sensitivity analyses for capability-dependent missingness. These results show that deployed-agent security is jointly shaped by the harness and backend model, rather than being determined by either factor alone.

RQ3: Where does defensive behavior emerge within web-agent harnesses, and which design mechanisms strengthen security? Finally, we localize observed defensive behavior across the four workflow stages. Using execution traces, we identify effective defenses after excluding attacks mitigated at earlier stages. The resulting stage-level analysis reveals different defensive patterns across attack surfaces, which we further examine through controlled ablations. For user-side attacks, the ablations support the security benefits of fine-grained intent interpretation and risk-aware reasoning. For web-side attacks, they support perception filtering and goal-anchored planning. These results provide concrete guidance for designing more secure web-agent harnesses.

In summary, this paper makes the following contributions:

  • A systematic and extensible framework for evaluating web-agent harness security. We introduce WEBTRAP FARM, a framework for quantitatively measuring web-agent harness security across different attack surfaces. WEBTRAP FARM combines usability calibration, harness-independent monitoring, and unified metrics, while supporting the incorporation of emerging attacks through paired usability tasks and observation criteria.

  • A quantitative evaluation of how harness and model jointly shape web-agent security. We systematically evaluate diverse harness-model configurations and frontier commercial web-agent systems, providing quantitative evidence for how harness design and backend models jointly shape deployed-agent security.

  • A stage-level analysis of harness security mechanisms. We localize where defensive behavior emerges across the web-agent workflow and use controlled ablations to examine specific mechanisms, providing a principled basis for understanding and improving harness-level security design in practical web agents.

Figure

Figure 1: The Workflow of Web Agents

References (63)