Skip to content

WAInjectBench systematically evaluates prompt injection detection methods for web agentsWAInjectBench: Benchmarking Prompt Injection Detections for Web Agents

Paper Tracker· arXiv:2510.01354· Yinuo Liu, Xilong Wang, Ruohan Xu, Yuqi Jia, Neil Zhenqiang Gong·Indexed by this site · 2026-10-09· Originally publishedEvaluation

Quick read

Evaluation and benchmarks

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

The authors evaluate 12 detectors with WAInjectBench: explicit instructions or visible perturbations can be partially detected, but most fail when there are no explicit instructions or when perturbations are invisible.

Questions
Web agents must process untrusted web content, and malicious content can cause them to execute attacker-specified actions. General prompt injection detectors have not yet been systematically evaluated in this scenario.
Methods
The authors propose WAInjectBench: they classify six attacks by attacker, capability, knowledge, and poisoned observation, construct malicious and benign text and image sets, and compare 12 detectors by modality and usage.
Experiments and results
With explicit instructions or visible page modifications, some detectors have high TPR; without explicit instructions or with imperceptible perturbations, TPR is often close to 0. Ensembles that classify as malicious on any alarm increase TPR while also increasing FPR.
Limitations and future work
The evaluation only covers sample-level TPR/FPR for single-step text segments and images, without accounting for latency or computational cost, and does not assess adaptive attacks optimized against the detectors. The authors state that webpage-level FPR can be higher; benign emails and SMS messages may not resemble real observations.
Experimental setupMistral-7B-Instruct-v0.1、GPT-4o et al. · WAInjectBench、Visual Web Arena et al. · TPR、FPR et al.
Evaluated models
Mistral-7B-Instruct-v0.1GPT-4oall-MiniLM-L6-v2Llama-Prompt-Guard-2-86MDataSentinelLLaVA-1.5-7BMiniGPT-4CLIP ViT-B/32
Benchmarks
WAInjectBenchVisual Web ArenaWeb ArenaMind2WebSpam Email DatasetSMS Spam Collection DatasetCOCO 2017 validation set
Metrics
TPRFPRAUROC
AI summaryThe paper proposes WAInjectBench, calling it the first systematic benchmark study of prompt injection detection for web agents. The authors give a fine-grained taxonomy of such attacks by threat model, and construct a dataset containing malicious and benign samples, covering malicious text from different attack generations, four types of benign text, malicious images from attack generation, and two types of benign images. The study then systematically reviews text-based and image-based detection methods, and evaluates their performance across multiple scenarios. The main finding is that some detectors can identify attacks relying on explicit text instructions or visible image perturbations with medium-to-high accuracy, but largely fail on attacks that omit explicit instructions or use imperceptible perturbations. The dataset and code are publicly released.

The paper proposes WAInjectBench, calling it the first systematic benchmark study of prompt injection detection for web agents. The authors give a fine-grained taxonomy of such attacks by threat model, and construct a dataset containing malicious and benign samples, covering malicious text from different attack generations, four types of benign text, malicious images from attack generation, and two types of benign images. The study then systematically reviews text-based and image-based detection methods, and evaluates their performance across multiple scenarios. The main finding is that some detectors can identify attacks relying on explicit text instructions or visible image perturbations with medium-to-high accuracy, but largely fail on attacks that omit explicit instructions or use imperceptible perturbations. The dataset and code are publicly released.

Related events and news

0 events · 1 news mentions

News that mentions this paper

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Prompt injection detection on web agents has not been systematically evaluated; the authors use WAInjectBench to do this.

    Whether prompt injection on web agents can be detected by existing detectors has not been systematically evaluated.

    • Scenario: Users delegate high-level tasks to web agents driven by multimodal large models, which browse, extract, and execute multi-step actions. The authors argue that users must trust both the agent and the web pages it reads; existing attacks use malicious web content to make the agent execute attacker-chosen target actions.
    • Existing gaps: Work exists on prompt injection for web agents, general text or image prompt injection detection, and defenses such as runtime monitoring and agent isolation. The authors state that detection for web agents still lacks systematic evaluation.
    • This paper's approach: The authors propose WAInjectBench. It classifies attacks by threat model, constructs malicious and benign text segments and images, and categorizes and compares detectors by modality and usage. The authors claim this is the first comprehensive benchmark of its kind. The abstract states that these attacks achieve ASR as high as 70–100% in several settings.
    • Threat model:
      • Goal: The attacker is a website owner or malicious user who modifies page content to make the agent follow attacker-chosen target actions rather than the original task trajectory. Consequences mentioned in the paper include click fraud, downloading malware, or leaking sensitive information.
      • Knowledge: White-box has access to MLLM parameters, system prompts, and observation types; black-box does not know the MLLM, system prompts, user prompts, captioning model, or observation types.
      • Capabilities: Owners can add pop-ups, inject HTML with malicious instructions, or modify raw pixels. Malicious users can upload perturbed images or post comments with embedded malicious instructions.
      • Victim system: Web agent. Observations can include screenshots, screenshots with Set-of-Marks, images and captions, SoM text, a11y tree, and raw HTML.
  2. What related research exists?

    The introduction groups by agents, attacks, defenses, and general detection, and states that detection evaluation for this scenario remains missing.

    The introduction divides related work into web agents, prompt injection against them, agent defenses, and general detection. The authors state that the last category has not yet been systematically evaluated on web agents.

    Web agents

    • Web Arena and Visual Web Arena: Zhou et al. (2023) and Koh et al. (2024) provide environments for agents to autonomously complete web tasks.
    • Mind2Web: Deng et al. (2023) targets general web agents and provides web task data.

    Attacks against web agents

    • Six classified attacks: VWA-Adv (Wu et al., 2024), EIA (Liao et al., 2024), Pop-up (Zhang et al., 2024), WASP (Evtimov et al., 2025), WebInject (Wang et al., 2025), VPI (Cao et al., 2025). The paper discusses attackers, capabilities, knowledge, and poisoned observations, and relays the ASR from the original works.
    • General definition: Liu et al. (2024) define prompt injection as inserting malicious instructions into input so that the output serves the attacker's task. The authors adapt this to a web agent version: after a website is modified, the observation is poisoned and the agent outputs the target action.

    Web agent defenses

    • Monitoring, isolation, and same-origin policy: Ning et al. (2026) perform runtime monitoring; Kim et al. (2025) discuss prompt flow integrity; Wang et al. (2026) discuss same-origin policy for agent browsers. The paper lists these as proposed defenses.

    General prompt injection detection

    • Text: KAD (Nakajima, 2022; formalized by Liu et al., 2024), embedding classifiers (Ayub and Majumdar, 2024), Llama Guard (Inan et al., 2023), DataSentinel (Liu et al., 2025), PromptArmor (Shi et al., 2025). In the experiments, PromptGuard uses Llama-Prompt-Guard-2-86M (Meta, 2025).
    • Images: JailGuard (Zhang et al., 2023) detects prompt-based attacks. The authors state that image prompt injection detection is less common than text and is related to image adversarial example detection (Carlini and Wagner, 2017).

    Evaluation targets and data

    • Baselines: The paper does not propose a new detector. The compared methods are existing ones from Table 4. Samples come from Visual Web Arena, Web Arena, Mind2Web, Spam Email Dataset, and SMS Spam Collection.

    The authors' positioning is that both attacks and general detectors already exist, but they have not yet been compared together under the web agent threat model and with text and image observations.

  3. How does the paper address this problem?

    Six attacks are classified by threat model, text and image sets are built, and 12 detectors are compared by modality and usage.

    The authors use WAInjectBench to compare attacks, data, and detectors under the same taxonomy, rather than proposing a new detector.

    Problem Setting

    An agent generates an action at each step based on the observation, user prompt, system prompt, and optional history. After an attacker modifies a website, the observation is poisoned, the agent outputs the target action, and may continue executing a sequence of attacker-chosen actions. The target action is at′ = f(ot′, pu, ps, [Ht]), i.e., the action under the poisoned observation. Observations can be screenshots, screenshots with SoM, images with captions, SoM text, a11y tree, or raw HTML.

    Attack Taxonomy

    • Table dimensions: Table 1 lists six attacks by attacker, capability, background knowledge, and poisoned observation. VPI's attacker is written as the website owner in the text, but as Mali. user in the table; the classification follows the table.
    • Malicious user: WASP posts or issues, black-box, paper reports ASR up to 97.6%. VWA-Adv perturbs product images, with white-box and black-box variants for captioning models, ASR up to 67%. VPI's capabilities include pop-ups, malicious emails, and messages, black-box, ASR up to 100%.
    • Owner and black-box: EIA injects low-opacity HTML that does not appear in the SoM text, ASR up to 70%. Pop-up injects pop-ups and modifies the a11y tree, ASR is 86%; the authors change the original attack's direct screenshot modification to modifying the website source code.
    • WebInject: owner, white-box, pixel perturbations optimized against the agent MLLM, delivered via HTML injection, triggered by screenshots. ASR up to 99.9%. The abstract also states ASR as high as 70–100% under several settings.

    Datasets

    • Malicious text: 991 segments, of which 601 contain explicit instructions (EI, Table 2). Both annotators must agree to label EI. Except for some VWA-Adv and EIA, all contain EI; these two categories can change context or model behavior without explicit instructions.
    • Benign text: 2707 segments, categories aligned with the malicious side. Comments and issues 806, emails and messages 173, captions 226, UI text 1502. Sources are VWA, Web Arena, Mind2Web, Spam Email ham bodies, and SMS Spam Collection; captions generated by LLaVA-1.5-7B.
    • Malicious images: 2022 total (Table 3). VWA-Adv embedded images 298; 15 failed rendering, so screenshots 283. EIA texts without EI do not affect screenshots, so omitted; each segment with EI is inserted at 8 positions, yielding 496 images. WebInject is 500 images, collected as screenshot-only. The remaining screenshots mainly have SoM.
    • Benign images: 948, including embedded images 226 and screenshots 722. Screenshots come from 361 clean pages of VWA and Mind2Web and their SoM versions. Figure 1 says 2,023 malicious screenshots, inconsistent with Table 3; the table prevails. The authors state that category alignment is to make low FPR reflect attack-related patterns rather than distribution differences. Appendix D gives examples, whose injected statements are not referenced here.

    Detectors

    Detectors first split text and images, then group by how they use LLM or MLLM (Table 4). The authors state that an agent can inspect observations, and if any observation is flagged as poisoned, it stops interacting.

    • Text: KAD appends the test text to an instruction containing a random secret key known only to the detector; if the model cannot reproduce the key, it is judged malicious. PromptArmor has a detection LLM judge whether it contains malicious instructions. Embedding-T trains a binary classifier on embeddings. PromptGuard fine-tunes a detection LLM into a Yes/No classifier. DataSentinel performs game-theoretic minimax fine-tuning on KAD, requiring only benign samples, and can also be used when malicious samples are available.
    • Image: GPT-4o-Prompt and LLaVA-1.5-7B-Prompt use system prompts to judge whether an image contains injection. JailGuard generates multiple image variants and uses KL divergence to see if MLLM responses are inconsistent. Embedding-I trains a classifier on image encoder embeddings. LLaVA-1.5-7B-FT uses LoRA to fine-tune a detection MLLM into a binary classifier.
    • Ensembles: In Ensemble-T and Ensemble-I, any detector alarming means malicious; the MV variants require a majority alarm. The authors state the former increases coverage and may increase false positives, while the latter reduces false positives and also reduces coverage. The paper does not separately list the ensemble members.
    • Prompt provenance: Figure 3 gives the full prompts for KAD, PromptArmor, and the two image prompt detectors. The text says PromptArmor outputs Yes or No, while Figure 3 requires outputting only 0 or 1.

    Training and Decision

    • Out-of-domain training: In the main experiments, detectors requiring training are by default not trained on web agent attacks; the authors state this is for fair comparison with prompt-based methods that do not train. PromptGuard and DataSentinel use models already trained by their authors on general prompt injection.
    • Specific settings: KAD uses Mistral-7B-Instruct-v0.1, PromptArmor uses GPT-4o. Embedding-T uses all-MiniLM-L6-v2 with logistic regression, trained on 500 benign and 500 malicious samples collected by DataSentinel. PromptGuard uses Llama-Prompt-Guard-2-86M. DataSentinel uses the large detection LLM publicly released by its authors. JailGuard uses MiniGPT-4 to describe variants, threshold 0.025. Embedding-I uses CLIP ViT-B/32, threshold 0.93. LLaVA-1.5-7B-FT's LoRA is rank 16, α 32, dropout 0.05; it and Embedding-I are trained on 1,000 benign images from the COCO 2017 validation set and 1,000 malicious images from JailGuard.
    • Decision: Metrics are sample-level TPR and FPR, not whether the agent executed the target action. Cross-attack experiments split malicious and benign samples from a given attack 50/50.
  4. What experiments did the paper conduct?

    When explicit instructions or visible modifications are present, some detectors have relatively high TPR; with no explicit instructions or invisible perturbations, most are near 0.

    Experimental Setup

    • Detectors: Text: KAD, PromptArmor, Embedding-T, PromptGuard, DataSentinel, Ensemble-T, plus Ensemble-T-MV. Image: GPT-4o-Prompt, LLaVA-1.5-7B-Prompt, JailGuard, Embedding-I, LLaVA-1.5-7B-FT, Ensemble-I, plus Ensemble-I-MV. Any alarm means malicious; MV requires majority alarm.
    • Data: Malicious text 991 segments (601 with EI), benign text 2707 segments (Table 2); malicious images 2022, benign images 948 (Table 3). WebInject only in the image set. EI requires agreement from two annotators.
    • Metrics: TPR is the proportion of malicious inputs judged malicious, FPR is the proportion of benign inputs misjudged. Threshold-based methods also report AUROC. The paper does not report the number of repetitions, nor does it use a separate review model. The calculation of Average is not explained in the paper.
    • Text models: KAD is Mistral-7B-Instruct-v0.1; PromptArmor is GPT-4o; Embedding-T is all-MiniLM-L6-v2 plus logistic regression, trained on 500+500 out-of-domain samples; PromptGuard is Llama-Prompt-Guard-2-86M; DataSentinel is the authors' released large detection LLM.
    • Image models: Prompt detection uses GPT-4o and LLaVA-1.5-7B. JailGuard uses MiniGPT-4, threshold 0.025. Embedding-I uses CLIP ViT-B/32, threshold 0.93. LLaVA-1.5-7B-FT's LoRA is rank 16, α 32, dropout 0.05, trained with Embedding-I on 1,000+1,000 out-of-domain images.
    • Main protocol: Detectors requiring training default to general prompt injection data. The authors state they were not trained on web agent attacks.

    Main Results

    Average TPR, FPR from Tables 5–7. Text detectors have no image results, image detectors have no text results.

    Swipe horizontally to read the table

    DetectorModalityAverage TPRAverage FPRSource
    KADText0.00000.0011Table 5, 7a
    Embedding-TText0.00000.0000Table 5, 7a
    PromptArmorText0.27650.0011Table 5, 7a
    DataSentinelText0.18160.0108Table 5, 7a
    Ensemble-TText0.30780.0170Table 5, 7a
    LLaVA-1.5-7B-PromptImage0.00000.0000Table 6, 7b
    GPT-4o-PromptImage0.38130.0021Table 6, 7b
    Ensemble-IImage0.49750.1382Table 6, 7b
    • Omissions and author interpretation: Not listed are PromptGuard, Ensemble-T-MV, JailGuard, Embedding-I, LLaVA-1.5-7B-FT, Ensemble-I-MV. Average TPR/FPR are 0.0928/0.0041, 0.0585/0.0000, 0.0678/0.0454, 0.0287/0.0032, 0.2082/0.0928, 0.0124/0.0000 respectively. The authors state that PromptArmor and DataSentinel are the text individual detectors with high TPR and low FPR; on EIA (w/ EI), PromptGuard is 1.0000, higher than PromptArmor's 0.9194. The authors state JailGuard has the highest FPR; in Table 7b, LLaVA-1.5-7B-FT is 0.0928, higher than JailGuard's 0.0454.
    • Text by attack: The authors state that interface text with explicit instructions has TPR close to 1, while TPR for no explicit instructions or Pop-up is between 0 and 0.08. In Table 5, PromptArmor for VPI Web text (w/ EI) is 0.9561, for EIA (w/ EI) is 0.9194, for Pop-up is 0.0093, and for both w/o EI types is 0.0000. KAD and Embedding-T are 0.0000 in all columns. WASP has only 84 samples; PromptArmor's 0.6071 is given by the authors with an approximate 95% interval [0.50, 0.71].
    • Image and modality: The authors state that TPR for visible modification screenshots is 0.84–1.00, while VWA-Adv and WebInject are only 0.12–0.29. These two intervals correspond to Table 6's Ensemble-I (EIA 0.8407, Pop-up 0.8472, WASP 1.0000, VPI 0.9517; VWA-adv embedded image 0.2886, screenshot 0.1201, WebInject 0.1280), not GPT-4o-Prompt (Pop-up 0.7546, WebInject 0.0000). The authors state that Pop-up text is undetectable, but the image side can identify 75% of screenshots containing pop-ups; in the table, Ensemble-T is 0.0139, GPT-4o-Prompt is 0.7546. The authors state that VWA-adv and WebInject without EI fail on both sides, due to imperceptible perturbations.

    Cross-Attack Generalization

    • Setup: Each attack's malicious and benign samples are split 50/50. Training uses that attack's malicious training set plus benign training set. The paper reports Embedding-T and Embedding-I (Figure 2, Table 8).
    • Text: The authors state that performance improves for the training attack but is poor when transferred to other attacks. In Figure 2a, WASP training gives TPR of 0.90 for WASP, and 0.00 for other columns; in Table 5 out-of-domain setting, Embedding-T for WASP is 0.0000. The authors write this 0.00 as Table 7a, but Table 7a is FPR. The VPI Email training row is all 0.00, and VWA-adv (w/ EI) training gives only 0.06 for that column. Table 8a's benign FPRs are all 0.0000.
    • Image: Figure 2b diagonal TPR is 0.9167–1.0000. EIA training transfers to WASP at 0.8810 and VPI at 0.7260. In Table 8b, VWA-adv-S training has benign screenshot FPR of 0.2022, which the authors write as 0.20. WASP, WebInject, and VPI training have screenshot FPRs of 0.0305, 0.0000, 0.0194, and most off-diagonal TPRs are 0.0000.

    Adaptive Rewriting

    • What was tested: Manually rewrote injected text on WASP, removing explicit instructions while preserving attack intent, reporting only PromptArmor.
    • Results: The authors state TPR dropped from 0.7024 to 0.3571, and state that detection heavily relies on explicit instructions. In Table 5, the same detector for WASP (w/ EI) is 0.6071; the paper does not explain the difference between 0.7024 and that number.
    • Relation to Section 7: This rewriting is not the adaptive attack specifically optimized against detectors as described in Section 7.

    Other Ablations and Analyses

    • Table 9 AUROC: Embedding-T 0.5207, Embedding-I 0.6054, JailGuard 0.5341, LLaVA-1.5-7B-FT 0.6062. The text states fixed FPRs of 0.5%, 1%, 5%, while the table header is 0.5%, 0.1%, 0.01%; columns do not align, so these TPRs are not cited. The authors believe poor performance is not solely due to threshold selection.
    • Table 10: After regenerating benign captions with BLIP-2-T5XL, the listed text detectors still have FPR of 0.0000; benign captions generated by LLaVA-1.5-7B also have FPR of 0.0000.
    • Section 7: Comment & Issue has 120 web pages, 806 segments, average 6.717 segments/page. Under an independent false alarm assumption, the authors approximate Ensemble-T's page-level FPR as 0.155, compared to sample-level 0.0248.
    • Figure 2a: When training on EIA (w/o EI), TPR for that column is 1.00, and 0.00 for all other columns.
  5. What are some points that can be further explored?

    The authors point out that evaluation stops at single-step samples, does not account for latency, and does not include adaptive attacks optimized against the detector.

    Limitations and future directions noted by the authors

    • Single-step detection: The evaluation covers step-level detection of individual text segments and images, without modeling full multi-step agent-environment interaction (Section 7).
    • User-side cost: Mainly measures TPR and FPR, without considering latency or computational overhead (Section 7).
    • Metric granularity: Reports sample-level rather than webpage-level TPR/FPR. When a page has multiple segments, a false positive on any segment makes the whole page a false positive, so webpage-level FPR can be higher (Section 7).
    • Benign emails and SMS: Although from public datasets, they may not reflect real web agent observations (Section 7).
    • Optimized adaptive attacks: Does not evaluate adaptive attacks specifically optimized against the detectors (Section 7). The manual removal of explicit instructions in Section 6 is a separate experiment.

    The paper has no separate Future Work section. The Conclusion states that the results can serve as a reference for future attacks and defenses, without listing specific follow-up experiments.

    Experimental coverage

    • Samples: Malicious text comes from VWA-Adv, EIA, Pop-up, WASP, and VPI, totaling 991 segments; malicious images additionally include WebInject, totaling 2022 images. Benign text has 2707 segments, and benign images have 948 (Table 2, Table 3, Section 4).
    • Detectors: Section 6 reports the 6 text detectors and 6 image detectors from Table 4, plus Ensemble-T-MV and Ensemble-I-MV.
    • Training: In the main results, detectors requiring training use out-of-domain general prompt injection data by default. Cross-attack results only report Embedding-T and Embedding-I, split 50/50 (Section 5.4, Section 6).
    • Judgment: Detectors output whether the content is malicious themselves. The paper does not report a separate review model, number of repetitions, or number of queries. The adaptive experiment on WASP is a single manual rewrite, reporting only PromptArmor's TPR (Section 6).
    • Annotation: EI requires agreement between two annotators (Section 4.1). The paper does not report an agreement coefficient.
  6. Summarize the main content of the paper

    WAInjectBench compares prompt injection detection for web agents: explicit cues can be partially detected, while covert attacks are mostly missed.

    WAInjectBench is a benchmark for prompt injection detection in web agents. The authors examine whether existing detectors can find such attacks: an attacker modifies a webpage so that the agent performs a target action instead of the user's task. The authors claim this is the first comprehensive benchmark of its kind.

    • Problem setting: The attacker can be a website owner or a malicious user, with knowledge divided into white-box and black-box. Six attacks are listed in Table 1 by identity, capability, knowledge, and poisoned observations. The main text describes the VPI attacker as the website owner, while the table lists a malicious user.
    • Data and methods: 991 malicious text segments, of which 601 contain explicit instructions, and 2707 benign text segments; 2022 malicious images and 948 benign images. 12 detectors are grouped by text or image, and by prompt, embedding, or fine-tuning, with two ensembles: any-alarm and majority voting. The main results default to out-of-domain data, with metrics being sample-level TPR and FPR.
    • Explicit cues: PromptArmor on VPI Web text (with EI) has a TPR of 0.9561; PromptGuard on EIA (with EI) is 1.0000 (Table 5). GPT-4o-Prompt on VPI screenshots is 0.9379 (Table 6).
    • Covert attacks: KAD and Embedding-T have TPRs of 0.0000 in each column of Table 5. Pop-up text-side Ensemble-T is 0.0139. GPT-4o-Prompt on WebInject screenshots is 0.0000. The authors attribute failures to missing explicit instructions or imperceptible perturbations.
    • Ensembles and generalization: Ensemble-T has an average TPR of 0.3078 and an average FPR of 0.0170; Ensemble-I has an average TPR of 0.4975 and an average FPR of 0.1382. Majority voting reduces the average FPR on both sides to 0.0000, with average TPRs dropping to 0.0585 and 0.0124. After training on a single attack, Embedding-T's TPR on other attacks is mostly 0.00.

    The authors conclude that attacks relying on explicit text instructions or visible image modifications can be partially detected; attacks that omit explicit instructions or use imperceptible perturbations are mostly undetected. On the same attack, text detectors and image detectors can yield different results. The authors state that this benchmark can serve as a reference for future attack and defense design.

Related papers

Both use: Mind2Web
Show 3 more papers
Read originalarxiv.org