Manuscript Offprint

arXiv:2610.17457

BrowseSafe++: Benchmarking Prompt Injection Detection Across Web Contexts, Languages, and Browser Views

Yuetian Chen, Kaiyuan Zhang, Yuntao Du, Thomas Li, Mark Tenenholtz, Kyle Polley, Jerry Ma, Denis Yarats, Ninghui Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Browser agents need to make decisions and execute actions on behalf of users while consuming untrusted webpages, creating opportunities for malicious instructions embedded in webpages to redirect legitimate tasks. We introduce BrowseSafe++, which extends BrowseSafe from 14,719 pages to 38,675 pairs of pages. Most of its prompt injections were observed in the wild on production websites. We keep each injection unchanged and rewrite the sensitive parts of the page around it to protect privacy. Each attacked page has a clean copy of the same page as its control. Both are provided as HTML, Markdown, an accessibility tree, and a screenshot. Every pair includes a user task and its expected answer. The benchmark includes twelve types of websites, from news articles to shared documents and forums, with 24 attack types appearing in 18 different locations on a page. We use these paired pages to train BrowseSafe-Guard, two 0.8B-parameter detectors for text and screenshots. Both achieve higher F1 scores than the detector based on frontier models, while keeping false-positive rates on benign pages and inference cost low. BrowseSafe-Adapt revises benchmark injections from browser-agent feedback, and attacks that succeed on only a few percent of tasks when replayed directly reach up to 95.41% success once adapted.

Website

GitHub

HuggingFace

Leaderboard

Figure

Figure 1: BrowseSafe++ contains injections captured in the wild across twelve web domains, with every page in four views. The outer ring shows each domain’s mix of attack types.

∗^{*}Equal contribution.

Table 1: Comparison with existing prompt-injection benchmarks. BrowseSafe++ builds on BrowseSafe. It adds screenshot views, outcome targets for agent tasks, attack/control page pairs, and wild attacks collected from live webpages.

Benchmark referenceDetectionAttack constructionPage viewsTasks and controlsProvenance
Detection evaluationBenign distractorsContextual attacksMultilingual casesWeb pagesMultimodal page viewsOutcome targetsAttack/control page pairsWild attacks
BIPIA (2025)——————✓——
InjecAgent (2024)——✓———✓——
AgentDojo (2024)——✓———✓——
ASB (2024a)✓—✓———✓——
NotInject (2025b)✓✓—✓—————
WASP (2025)——✓—✓✓✓——
WAInjectBench (2025a)✓—✓—✓✓———
DTap-Bench (2026)——✓—✓✓✓——
BrowseSafe (2026a)✓✓✓✓✓————
BrowseSafe++✓✓✓✓✓✓✓✓✓

1 INTRODUCTION

Browser agents interact with external webpages to answer questions and carry out actions for users (Zhou et al., 2023; Koh et al., 2024). Attackers can insert instructions into those pages to redirect an agent's answer or actions away from the user's request, a threat known as indirect prompt injection (IPI) (Greshake et al., 2023; Zhan et al., 2024; Evtimov et al., 2025). Several IPI benchmarks have been proposed, measuring either whether a model can detect an injection (Li et al., 2025b; Liu et al., 2025a; Zhang et al., 2026a) or whether an injection alters an agent's answers, tool calls, or application state (Yi et al., 2025; Zhan et al., 2024; Debenedetti et al., 2024; Zhang et al., 2024a; Evtimov et al., 2025; Chen et al., 2026). However, existing benchmarks have several limitations. First, the injections are synthesized. Because injection attacks on real websites can follow a different distribution, scores on the benchmark may not be indicative of their performance in deployment. Second, most benchmarks represent each page in only a single view, typically HTML. In practice, agents consume webpages through different representations, including filtered HTML in MindAct (Deng et al., 2023), accessibility trees in AgentOccam (Yang et al., 2025b), and screenshots in UI-TARS (Qin et al., 2025). Moreover, converting a page from one representation to another may remove or alter an injection. As a result, differences across agents or detectors can be confounded by differences in the page representation and the content preserved by it. Third, benign examples are often sampled differently from injected examples. As a result, a detector may achieve high accuracy by learning differences in page topics or writing styles rather than detecting the injections themselves.

We introduce BrowseSafe++, which extends BrowseSafe to address the above limitations. It contains 38,675 attack/control pairs, where the attack page and the control page in a pair differ only in whether an injection is present. Both pages share the same user task and expected outcomes, while the attack page is additionally associated with an attack goal. Of these pairs, 32,187 contain real injections observed on production webpages between September 2025 and September 2026. We keep the injection text unchanged and rewrite the surrounding page content to protect privacy. The remaining 6,488 pairs retain BrowseSafe injections. For page views, we generate Markdown, an accessibility tree, and a screenshot from each page's HTML and check that the injection appears in every view, so detection can be compared across forms of identical content. Annotations also record the domain, attack type, placement, and the languages of the page and the injection. Table 1 compares the features BrowseSafe++ with existing benchmarks.

We evaluate 16 models on BrowseSafe++ and find that even frontier models exhibit substantial false-positive rates. We further train BrowseSafe-Guard, a pair of 0.8B-parameter detectors: a text detector that accepts HTML, Markdown, or accessibility trees, and a multimodal detector for screenshots. Compared with frontier models, BrowseSafe-Guard achieves higher overall accuracy while being substantially cheaper and faster.

In case BrowseSafe++ becomes saturated by future detectors and defenses, we introduce BrowseSafe-Adapt, an adaptive attack framework which revises attacks based on feedback from a target agent. Starting from a BrowseSafe++ entry, including its page, task, observed injection, and attack goal,

Shade: Production BrowseSafe

Domains

Figure

Risk categories

Writing tones

Prose placements

Container placements

Markup placements

Navigation placements

Attacker goals

Non-English page languages

Non-English injection languages

Figure 2: Composition of BrowseSafe++. We breaks down the 38,675 attacked pages by website type, injection placement, attacker goal, and other characteristics. Dark bars show injections observed on production webpages, while light bars show those retained from BrowseSafe.

BrowseSafe-Adapt iteratively executes the target agent on the current page and uses the resulting feedback to rewrite the injection. This process continues until the attack goal is achieved or a maximum number of iterations is reached.

Our contributions are:

• A benchmark of injections observed in the wild. BrowseSafe++ contains 38,675 attack/control page pairs, including 32,187 built from injections found on production websites. Each pair includes four page views, a user task, its expected outcome, and an attack goal.

• A multi-view evaluation of detection and resistance. We evaluate sixteen models for detecting prompt injections using the three text-based views: HTML, Markdown, and accessibility trees. We also use fifteen of them as agents carrying out user tasks, and test four image-capable models for detection using screenshots. Even the highest-scoring prompted detector falsely flags 13.82–15.10% of benign pages. We also find that while some models can recognize prompt injections when asked to detect them, they still follow those same injections when carrying out a task. These results show that detection performance alone does not tell us how well an agent resists prompt injection.

• BrowseSafe-Guard, compact detectors trained on the pairs. We train two 0.8B detectors, a text detector for the three text views and a multi-modal detector. In training, we add a pairwise ranking loss between each attacked page and its control to the usual classification loss. The text detector reaches 92.98–98.29 F1 at 1.35–7.40% benign FPR, compared with 19.13–21.21% for GPT-5.5, and the multi-modal detector reaches 93.32 F1 at 6.08% FPR.

• BrowseSafe-Adapt, an adaptive attack framework seeded by the benchmark. BrowseSafe-Adapt uses each benchmark entry to seed an adaptive attacker and iteratively revises the observed injection using feedback from the target agent if the attack fails. The revised injections reach an average attack success rate of 78.79% across target agents.

References (72)