acceptodds
Under review as a conference paper at ICLR 2027

AHEAD: Attention Heads for Adversarial Detection for GUI Agents

Abstract

Graphical-user-interface (GUI) agents rely on grounding models to translate screenshots and element descriptions into interaction coordinates, making grounding a point of exposure to visual adversarial attacks. Existing detectors require adversarial fitting examples or repeated inference, motivating detection using signals available during grounding inference. We observe that visual attacks alter how attention is distributed over screenshot regions during coordinate prediction, producing measurable changes in attention entropy. Motivated by this observation, we propose AHEAD (Attention HEads for Adversarial Detection), which jointly measures head-wise entropy deviations from a clean reference. AHEAD extracts its features during a single grounding inference and uses Mahalanobis distance with a threshold calibrated on clean inputs, requiring no adversarial fitting examples or additional model inferences. Across four grounding models, two interface datasets, and three attack settings, AHEAD achieves a mean AUROC of and a mean true positive rate of at a matched false positive rate (TPR@FPR), with the lowest overhead compared to the baselines. AHEAD also transfers from mobile to web interfaces and vice versa using only clean inputs from the new domain, achieving a mean TPR@FPR in both directions. Overall, AHEAD provides a lightweight safeguard between visual perception and action execution, enabling intervention before unintended interactions and supporting safer deployment of GUI agents.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
GUI agent, visual grounding, vision-language model, adversarial attack detection

Reviews

Among:
Shape:
1234this paper, Top 15%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.00 over 3 reviews, above 85% of the others.
Reviewer_9GpVOpenReview ↗
Rating
3
Confidence
3
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper proposes AHEAD, a lightweight adversarial detector for GUI grounding models. It uses head-wise attention entropy and Mahalanobis distance to detect abnormal screenshots without adversarial training data or additional model inference.

Critical strengths
  • I find the problem timely and practically relevant to GUI agent security.
  • The experiments are extensive, covering four models, two datasets, and three attack types, with strong detection results and low overhead.
  • I appreciate the ablation studies, cross-domain adaptation experiments, and adaptive attack evaluation.
Critical weaknesses
  • Attention entropy has been explored for detecting abnormal VLM behavior [1], and related attention-based detection methods already exist [2, 3]. Mahalanobis scoring is also well established. I see the contribution mainly as combining existing techniques, rather than introducing a fundamentally new detection method.
  • Although the features are extracted from coordinate-answer tokens, the algorithm does not explicitly model GUI geometry, element relationships, coordinate semantics, or execution behavior.
  • Entropy loses spatial information: attention can shift to a completely different GUI element while keeping the same entropy. Visual attention sinks [4] may also influence the statistics without reflecting meaningful grounding behavior. I think these are inherent limitations of the representation.
  • The method requires internal attention access, making it unsuitable for black-box APIs. More importantly, zero-shot cross-domain transfer gives 100% FPR in both directions with source-calibrated thresholds. Performance recovers with 50 clean target samples, but this requires domain-specific adaptation. Cross-model transfer is not evaluated, and the method has not been validated in complete multi-step agent workflows.

[1] Backdoor Cleaning without External Guidance in MLLM Fine-tuning. NeurIPS 2025.

[2] Devils in Middle Layers of Large Vision-Language Models: Interpreting, Detecting and Mitigating Object Hallucinations via Attention Lens. CVPR 2025.

[3] VADE: Visual Attention Guided Hallucination Detection and Elimination. Findings of ACL 2025.

[4] See What You Are Told: Visual Attention Sink in Large Multimodal Models. ICLR 2025.

Questions for authors
  • Could the authors compare AHEAD with a layer-wise attention entropy baseline inspired by [1], using the same Mahalanobis scoring and calibration? I would like to understand how much improvement specifically comes from the head-wise representation.
  • Have the authors examined whether attention sinks affect detection? Could they report results after excluding sink-dominated heads or tokens, or discuss cases where attention moves spatially without significant entropy changes?
  • Does AHEAD generalize to unseen models without rebuilding the clean reference? Could the authors clarify the distinction between zero-shot transfer and the reported 50-sample adaptation?
  • The adaptive evaluation assumes that the attacker does not know the exact detector head subset. How would AHEAD perform against an attacker who knows the selected heads? Could the authors further clarify this?
7 comments
AuthorsOpenReview ↗

Response to Reviewer 9GpV (1/4)

We thank the reviewer for highlighting the practical importance of GUI agent security and for suggesting a direct comparison with layer-wise entropy. We also examine attention sinks, shifts in attention that leave entropy nearly unchanged, and attacks that target the exact heads AHEAD uses.

New experiments

  • [W1, Q1] Detection with head-wise and layer-wise attention entropy
  • [W2, W3, Q2] Effects of sink tokens and sink-dominated heads on detection, and spatial shifts with little change in entropy
  • [W4, Q3] False alarms on unseen apps, after changes in resolution, display mode, or visual-token grid shape, and over complete AndroidWorld tasks
  • [Q4] Adaptive attacks on the exact detector heads, transfer across head subsets, and comparisons with baselines

[W1, Q1] Contribution of head-wise attention entropy

Head-wise versus layer-wise entropy. To measure what is gained by retaining individual head entropies, we compared AHEAD with a layer-wise baseline based on [1]. Both use the same coordinate-answer tokens, clean data splits, Mahalanobis score, covariance regularization, and threshold calibration. We changed only how we summarized entropy. As the table below shows, keeping 300 individual head entropies raised mean TPR@3%FPR from 88.4% to 99.0%, a gain of 10.6 percentage points.

Entropy representationMean TPR at 3% FPR (%)
Mean within each layer88.4
Mean and standard deviation within each layer92.9
Individual head entropies (AHEAD, 300 random heads)99.0

Across 24 settings, AHEAD outperformed the layer mean in 18 and tied it in six. Under attack, some heads focus their attention on fewer screenshot regions while others spread it more widely. A layer mean can hide these opposing changes. We use the established Mahalanobis score to measure those changes. We will add this comparison to Section 6.5.

[1] Backdoor Cleaning without External Guidance in MLLM Fine-tuning. NeurIPS, 2025.

AuthorsOpenReview ↗

Response to Reviewer 9GpV (2/4)

[W2, W3, Q2] Attention sinks, and spatial information

Kang et al. [1] found that masking visual sink tokens had little effect on task performance and that redistributing some of their attention to other visual tokens improved performance. In our grounding experiments, sink tokens also provided a useful detection cue because visual attacks changed how much image attention the model assigned to them. AHEAD also detected attacks using only the attention entropies of sink-dominated heads. These results support keeping such heads in the pool from which AHEAD randomly samples.

We tested UI-Venus-1.5-2B on AMEX and UGround-V1-2B on Mind2Web. We report TPR at 3% FPR for the sink analyses. A dagger (†) marks follow-up analyses.

Sink tokens. To test whether AHEAD relies on sink tokens, we identified them using the criterion in [1] (ϕ≥20\phi \geq 20), removed them, and renormalized attention over the remaining image tokens before computing entropy. We then refit the clean reference and recalibrated the threshold. In each of 20 draws, we used the same 300 heads in both conditions and averaged TPR across the three attacks. The table reports the median across draws.

Model / datasetImage tokens marked as sinksTPR with all image tokensTPR after removing sinks
UI-Venus / AMEX79%100.0%99.9%
UGround / Mind2Web29%99.8%99.3%

The share of image attention assigned to sinks alone yielded 81.1–99.7% TPR†. Removing sink tokens reduced AHEAD’s TPR by at most 0.5 percentage points. Attacks therefore affect both the share of attention on sinks and how attention is distributed over the remaining tokens.

Sink-dominated heads. To test whether AHEAD relies on heads that attend mostly to sinks, we classified a head as sink-dominated if it assigned at least half of its image attention to sinks on clean fitting screens. We ran AHEAD on each group separately.

Heads used by AHEADUI-Venus / AMEXUGround / Mind2Web
Sink-dominated heads only†100.0% (363 heads)83.7% (85 heads)
All other heads84.7% (85 heads)98.7% (249 heads)

On UGround, the 85 sink-dominated heads performed within the range of random 85-head subsets†. On UI-Venus, 85 random heads reached 99.7% TPR†, compared with 84.7% for the 85 heads remaining after exclusion. Sink-dominated heads can detect attacks on their own.

Spatial shifts. Entropy measures attention concentration and discards location. To test how often a head shifts focus with little change in entropy, we compared each clean screen with its redirect, disrupt, and patch versions†. We defined a head’s clean focus region as the smallest set of image tokens receiving at least half of its clean image attention, together with their neighbors. We counted a shift when that region retained less than half of its original attention after the attack. We treated an entropy change as small if its magnitude was below one clean standard deviation for that head.

Spatial-shift measureRange across settings
Share of all screen–head pairs with a shift and a small entropy change3.4–10.1%
Share of shifted pairs with a small entropy change25–42%
Median number of heads per screen with both properties8–31 of 300
Share of pairs that shifted under redirect or disrupt9–39%
Share of pairs that shifted under random noise at the same budget (±16/255\pm 16/255)0.3–0.4%

At its decision threshold, AHEAD detected every redirect and disrupt attack in this paired analysis and every UI-Venus patch attack. On UGround, it detected 58% of patch attacks overall. Detection was 67% on screens with the most heads that shifted focus with little entropy change and 55% on the remaining screens (95% CI for the difference, −2 to +25 percentage points). The reviewer’s concern holds for individual heads. AHEAD can still detect an attack when other heads change their attention concentration, and we found no evidence that UGround patches were harder to detect on screens with more such shifts.

[1] See What You Are Told: Visual Attention Sink in Large Multimodal Models. ICLR, 2025.

AuthorsOpenReview ↗

Response to Reviewer 9GpV (3/4)

[W4, Q3] Unseen models and clean target-domain adaptation

Model access and transfer. AHEAD requires a new clean reference for each grounding model. Each feature measures the entropy of a specific head, and we have not established that heads at the same index behave alike across models. We designed AHEAD for operators who run an open-weight GUI model and can read its attention during inference. Such models are competitive on grounding benchmarks. On ScreenSpot-Pro, UI-Venus-1.5-8B achieved 68.4% accuracy, compared with 64.3% for Seed1.8 (Table 1 in [1]). We thank the reviewer for raising the black-box setting. We plan to study detection for APIs that expose only the model’s output.

Zero-shot transfer and 50-screen adaptation. For a fixed grounding model, we use zero-shot transfer when the source reference and threshold keep the false-alarm rate within the operator’s tolerance. When the visual-token grid changes shape or the agent moves to a new platform, we check the source threshold on clean target screens. If the false-alarm rate exceeds that tolerance, we adapt AHEAD using 50 clean target screens.

Clean evaluation conditionVisual-token grid (UI-Venus)Mean FPR at τ\tau across four models (%)
Original AMEX screens19×422.3
Lower resolution19×422.3
Simulated dark mode19×422.8
Unseen apps19×424.3
AMEX screens cropped from 9:19 to 9:1621×3826.8
AMEX screens padded to match Mind2Web31×26100.0
Mind2Web31×26100.0

The table shows when the original AMEX thresholds worked across four models. Mean FPR ranged from 2.3% to 4.3% across conditions that preserved the grid shape, including seven unseen apps. Cropping and padding changed the grid shape. Mean FPR rose to 26.8% after cropping and 100% after padding. Appendix E describes how we use the 50 screens to update the reference mean and covariance and set a new threshold from held-out scores using five-fold cross-fitting.

Evaluation on multi-step agent workflows. To measure how often an alarm would interrupt a multi-step agent task, we used an oracle planner to select target elements in AndroidWorld [2] and UI-Venus-1.5-2B to predict where to click. The agent completed 101 of 112 runs. We fit and calibrated AHEAD on other task types, then scored all 675 grounding steps in the 101 completed runs. The table shows how many runs would still have finished if the agent had stopped at the first alarm. Percentages are relative to the 101 runs completed without AHEAD.

Grounding steps per runRunsTask completion at 3% target step FPRTask completion at 1% target step FPR
1–98680/86 (93.0%)81/86 (94.2%)
10–191010/10 (100%)10/10 (100%)
20–2455/5 (100%)5/5 (100%)
All10195/101 (94.1%)96/101 (95.0%)

At a target step FPR of 3%, AHEAD flagged 17 of 675 clean steps (2.5%). Those alarms occurred in six runs (5.9%). All 15 runs with 10–24 grounding steps would have finished at either threshold.

[1] UI-Venus-1.5 Technical Report. arXiv, 2026.

[2] AndroidWorld: A Dynamic Benchmarking Environment for Autonomous Agents. ICLR, 2025.

Reviewer_T5DhOpenReview ↗
Rating
3(+1)
Confidence
2(−1)
Informativeness
1
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies how to detect visual adversarial attacks at the grounding stage of GUI agents, where a grounding model maps a screenshot and an element description to click coordinates and an attacker can induce wrong coordinates by modifying the screenshot. Existing detectors either require adversarial examples (NEARSIDE) or repeated inference on mutated inputs (JailGuard), so the authors seek a signal that can be fitted on clean data alone and obtained within a single grounding inference. They observe that attacks change the entropy of answer-to-image attention (from coordinate-answer tokens to image tokens), with directions that differ across heads, and that detection becomes insensitive to head choice once enough random heads are used. Based on this, they propose AHEAD, which builds a vector of attention entropies from 300 random heads, scores inputs by Mahalanobis distance from a clean reference (fitted on 1,000 clean samples), and sets the threshold on 250 separate clean samples, requiring no adversarial examples or extra inference. Across 4 grounding models (2B to 4B), 2 datasets (AMEX and Mind2Web), and 3 attacks (patch, redirect, disrupt) at ε = 16/255, AHEAD achieves a mean AUROC of 0.997 and TPR@3%FPR of 0.990 with about 7% to 9% latency overhead, outperforming both baselines; it reaches 0.907 TPR@3%FPR in cross-domain transfer after adapting with 50 clean target samples, limits adaptive attacks (unaware of the head subset) to end-to-end ASRs of 11.0%, 1.5%, and 27.5%, and ablations confirm the advantages of attention entropy and full-covariance Mahalanobis scoring.

Critical strengths
  1. Practical deployment assumptions. The detector is fitted on clean data only and requires no prior knowledge of the attack type. Its features are extracted during the existing grounding inference without an additional forward pass, adding only about 7% to 9% latency. This matters for agents that invoke grounding at every step.

  2. Careful experimental controls that rule out several confounds and convincing ablations. At matched dimensionality, the paper compares attention entropy, attention mass, and hidden states (random coordinates, PCA, and full-dimensional Ledoit-Wolf), as well as a progression of scoring rules from mean entropy to full Mahalanobis distance. Each step of improvement holds across all 10 paired draws.

  3. Fairly honest reporting of adaptive attacks. The evaluation uses 20 detectors unseen by the attacker, reports the full λ sweep, and acknowledges that the trade-off between attack success and evasion does not hold uniformly across all λ values.

Critical weaknesses
  1. Limited novelty. Attention-based detection (e.g., Lookback Lens) and Mahalanobis-based OOD/adversarial detection are both established techniques; the paper mainly combines them for GUI grounding. It neither cites nor compares against classic Mahalanobis-feature detectors or other clean-only detectors such as LID and feature squeezing. In its own ablation, all-layer hidden states with Mahalanobis scoring already reach 0.896 (0.954 with full-dimensional Ledoit-Wolf), suggesting that most of the gain comes from the generic "internal features + clean-distribution modeling" framework, with a relatively small increment from attention entropy itself.

  2. High sensitivity to distribution shift, with deployment risk understated. Table 3 shows that without adaptation, the source threshold yields an FPR@τ of 1.000 on the target domain, flagging every clean input. The detector is thus tightly bound to the interface distribution, while real deployments face app updates, new apps, dark mode, and changes in language or resolution. The paper tests only AMEX↔Mind2Web transfer and mild modifications (brightness ×1.1, noise, banners), without evaluating natural within-domain shift (e.g., unseen apps, theme changes) or providing a mechanism for deciding when re-adaptation is needed.

  3. Weak adaptive attack, with security partly relying on secrecy of the head subset. The attacker uses only 4 random surrogates and does not know the head subset. A stronger and more natural attacker could penalize the Mahalanobis distance over all heads, which should cover any subset, but this is not tested. The adaptive experiment also uses a single model, 100 screenshots, and the same iteration budget as the non-adaptive setting. Even so, patch already reaches 27.5% end-to-end ASR with 67% evasion.

  4. Narrow threat model. All three attacks are white-box, gradient-optimized perturbations with relatively large budgets (ε = 16/255 or 8/255), and detection results are nearly saturated. The paper does not probe smaller budgets (e.g., 2/255, 4/255) to find where detection breaks, nor does it cover the more realistic non-optimized attacks implied by its motivating example, such as ads disguised as buttons, environmental injection, or pop-ups with misleading text. Table 15 shows natural banners are not flagged, which helps FPR but also places such semantic deception outside the detector's scope.

  5. Per-step FPR accumulates over trajectories. A 3% per-step FPR implies roughly a 46% chance of at least one false alarm over a 20-step task. The authors acknowledge that full trajectories are not evaluated, but this directly affects usability, and no post-detection handling strategy is proposed.

  6. Few, adapted baselines. Only NEARSIDE and JailGuard are compared, both originally designed for jailbreak/VLM settings and adapted to coordinate outputs. HiddenDetect is discussed in related work but not compared. This weakens the claim of outperforming the baselines.

  7. Limited scope of applicability. Only 2B–4B open-source grounding models are evaluated, with no larger VLMs or general-purpose models used for grounding. The method requires reading attention weights, which typically conflicts with efficient implementations such as FlashAttention, and the main text does not clarify whether the reported latency overhead is measured with an implementation that explicitly outputs attention.

Questions for authors
  1. If the attacker directly penalizes the Mahalanobis score over all heads (K = all) or increases the number of surrogates and optimization iterations, what end-to-end ASR is achieved? To what extent does AHEAD's security depend on keeping the head subset secret?

  2. Without adaptation, the source threshold yields an FPR@τ of 1.000. Within the same dataset, how does FPR change for unseen apps, dark mode, or different resolutions? In deployment, how would one decide when re-adaptation is needed?

  3. How does detection perform at ε = 2/255 or 4/255? Could you provide curves of attack success rate and detection rate as a function of ε to identify where detection breaks down?

  4. Can AHEAD detect visual deception that is not gradient-optimized, such as disguised buttons, pop-ups with misleading text, or environmental injection? If not, should the paper more explicitly delimit its scope?

  5. Could you add classic Mahalanobis-feature adversarial/OOD detectors, LID, and other clean-only methods as baselines? Is the gain of attention entropy over all-layer hidden states with Ledoit-Wolf (0.954) stable?

  6. What is the cumulative false-alarm rate over full task trajectories, and how much do false alarms reduce task completion? Have you considered cross-step aggregation or lower-FPR operating points?

  7. Does extracting attention weights require disabling FlashAttention/SDPA? Relative to which attention implementation is the reported 7% to 9% latency overhead measured, and how does the overhead scale to larger models?

  8. Does the finding that "300 random heads suffice" hold for grounding models of 7B and above or for general-purpose VLMs? Should K be scaled with the total number of heads?

7 comments
AuthorsOpenReview ↗

Response to Reviewer T5Dh (1/5)

We thank the reviewer for recognizing the value of detecting attacks within a single grounding call and for suggesting stronger baselines and adaptive attacks. We compare head-wise entropy with hidden-state features and evaluate AHEAD under interface changes, over complete tasks, and on larger models.

New experiments

  • [W1] Cross-platform transfer and false alarms on clean grounding errors
  • [W6, Q5] Full hidden-state and clean-only detector comparisons
  • [W2, Q2] False alarms on unseen apps and after changes in resolution, display mode, or visual-token grid shape
  • [W3, Q1] Adaptive attacks with and without knowledge of the deployed heads
  • [W4, Q3] Attack success and detection at budgets down to ϵ=2/255\epsilon = 2/255
  • [W4, Q4] Clicks and false alarms after adding a non-optimized pop-up
  • [W5, Q6] False alarms over complete AndroidWorld tasks
  • [W7, Q7] FlashAttention support and latency on 2B and 8B models
  • [W7, Q8] Head counts on 7B–8B grounding models and a general-purpose VLM

[W1] Contribution & Novelty

Contribution. We find that visual attacks change the entropy of answer-to-image attention differently across heads (Sec. 4.2), and we build an adversarial detector on this useful signal. Beyond needing no adversarial supervision and no additional model inference, the detector performs well under conditions that real deployments face:

  • Across platforms. After adaptation with the same 50 clean target screens, AHEAD achieved 90.7% mean TPR at 3% FPR across mobile-to-web and web-to-mobile transfer, compared with 82.9% for the full hidden-state detector [W6, Q5].
  • Within a platform. On AMEX, FPR stayed at 1–4% after we lowered the resolution or inverted luminance. On seven unseen apps, FPR was 4.0–4.7% without per-app calibration [W2, Q2].
  • False alarms on wrong clicks. On clean Mind2Web screens where the model clicked the wrong element, AHEAD incorrectly classified 4.4% of cases, compared with 10.7–11.8% for the hidden-state detectors [W6, Q5].

Novelty. Our novelty lies in measuring the entropy of each head’s answer-to-image attention to detect visual attacks on GUI grounding. Compared with hidden-state features, head-wise attention entropy yielded fewer false alarms on clean grounding errors, higher mean detection rates on successful attacks, and higher TPR after cross-domain adaptation. While hidden states combine information across heads, AHEAD keeps each head separate and uses the pattern we observed under attack (Sec. 4.2): some heads focus more sharply while others spread their attention more widely. We hypothesize that this head-wise pattern helps AHEAD achieve the following results:

  • Fewer false positives on incorrect clicks. On clean Mind2Web screens where the agent clicked the wrong element, AHEAD’s false-positive rate was 4.4%, less than half the rates of the 300-dimensional (10.7%) and full hidden-state detectors (11.8%).
  • Fewer false negatives on attacked screens. At ϵ=16/255\epsilon = 16/255 and 3% FPR, AHEAD missed 0.6% of successful disrupt attacks and 2.4% of successful patch attacks on average. The full hidden-state detector missed 5.5% and 8.3%, respectively.
  • Better cross-domain adaptation. With the same 50 clean target screens, AHEAD achieved 90.7% mean TPR at 3% FPR across both transfer directions, exceeding the full hidden-state detector by 7.8 percentage points and the 300-dimensional detector by 11.9 points.

We report the experimental setup and full comparisons in [W6, Q5].

AuthorsOpenReview ↗

Response to Reviewer T5Dh (2/5)

[W6, Q5] Comparison with hidden states and other clean-only detectors

1. Attack detection. To test whether the gain holds when the detector uses all hidden-state dimensions, we fitted three detectors on the same clean splits and kept each fixed across two attack budgets. AHEAD used 300 heads. One hidden-state detector used 300 dimensions and the same covariance estimator as AHEAD. The other used all dimensions with Ledoit–Wolf shrinkage. The table reports TPR (%) at 3% FPR.

Attack budget ϵ\epsilonDetectorRedirectDisruptPatchMean
16/255AHEAD, 300 heads100.099.497.699.0
16/255Hidden states, 300 dimensions100.089.680.490.0
16/255Hidden states, all dimensions100.094.591.795.4
8/255AHEAD, 300 heads100.098.399.899.4
8/255Hidden states, 300 dimensions100.085.980.588.8
8/255Hidden states, all dimensions100.091.092.894.6

At 3% FPR, AHEAD achieved higher mean TPR than the full hidden-state detector at both perturbation budgets (99.0% vs. 95.4% at ϵ=16/255\epsilon = 16/255 and 99.4% vs. 94.6% at ϵ=8/255\epsilon = 8/255). At ϵ=16/255\epsilon = 16/255, all ten random draws of 300 heads outperformed the full hidden-state detector when averaged across the three attacks. These results indicate that AHEAD’s head-wise entropy signal generalizes across the three attack types defined in our threat model (redirect, disrupt, and patch) at both evaluated perturbation budgets.

2. Cross-domain adaptation. To evaluate how well each feature transfers with few clean screens, we adapted each detector from AMEX to Mind2Web and in the reverse direction using the same target samples. The table reports mean TPR (%) at 3% FPR across both directions. AHEAD had the highest mean TPR at all three sample sizes.

Clean target screensAHEADHidden states, 300 dimensionsHidden states, all dimensions
5090.778.882.9
10093.581.586.3
30097.085.390.2

3. False positives on clean grounding errors. When the model clicked the wrong element on a clean Mind2Web screen, AHEAD was less than half as likely as either hidden-state detector to classify the screen as an attack. The false positive rate was 4.4% for AHEAD, 10.7% for the 300-dimensional hidden-state detector, and 11.8% for the full hidden-state detector.

Click on a clean screenAHEAD FPR (%)Hidden states, 300 dimensions, FPR (%)Hidden states, all dimensions, FPR (%)
Incorrect4.410.711.8

Other clean-only detectors. We excluded HiddenDetect [1] because it relies on a refusal signal that has no direct counterpart in our grounding models’ click-coordinate outputs. At the reviewer’s suggestion, we compared AHEAD with the Mahalanobis feature detector [2], the local intrinsic dimensionality (LID) detector [3], and the k-nearest-neighbor (kNN) distance detector [4].

  • Experimental setup. We fitted and calibrated the detectors using only clean screens and evaluated them in the same 24 settings as in Table 1. To adapt LID to this clean-only setting, we standardized each layer’s LID score using clean calibration screens and summed the standardized scores across layers.
  • Results. At 3% FPR, AHEAD achieved 99.0% mean TPR, outperforming the strongest baseline, clean-only Mahalanobis (95.7%), by 3.3 percentage points. AHEAD exceeded LID (75.1%) by 23.9 points and kNN distance (64.4%) by 34.6 points.
DetectorMean TPR at 3% FPR (%)
AHEAD99.0
Clean-only Mahalanobis [2]95.7
Clean-only kNN-LID [3]75.1
kNN distance [4]64.4

We will add these comparisons to the main text and describe how we fitted each baseline in the appendix.

[1] HiddenDetect: Detecting Jailbreak Attacks against Multimodal Large Language Models via Monitoring Hidden States. ACL, 2025.

[2] A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks. NeurIPS, 2018.

[3] Characterizing Adversarial Subspaces Using Local Intrinsic Dimensionality. ICLR, 2018.

[4] Out-of-Distribution Detection with Deep Nearest Neighbors. ICML, 2022.

AuthorsOpenReview ↗

Response to Reviewer T5Dh (3/5)

[W2, Q2] Distribution shift and when to re-adapt

False alarms across input conditions. To test which changes could reproduce the 100% FPR on Mind2Web, we cropped or padded clean AMEX screens to change the shape of the visual-token grid. We also tested lower resolution, simulated dark mode, and seven unseen AMEX apps, all of which preserved the grid shape in UI-Venus. For each condition, the table reports the UI-Venus grid dimensions after resizing (width × height in image tokens) and the mean FPR across four models at their original AMEX thresholds.

Clean evaluation conditionVisual-token grid (UI-Venus)Mean FPR at τ\tau across four models (%)
Original AMEX screens19×422.3
Lower resolution19×422.3
Simulated dark mode19×422.8
Unseen apps19×424.3
AMEX screens cropped from 9:19 to 9:1621×3826.8
AMEX screens padded to match Mind2Web31×26100.0
Mind2Web31×26100.0

False alarms under deployment changes. At the original AMEX thresholds, mean FPR remained at 2.3% when we lowered the screen resolution and rose to 2.8% when we simulated dark mode. On seven unseen apps, FPR was 4.3% without per-app recalibration. The largest increases in FPR occurred when cropping or padding changed the grid shape. Cropping to 9:16 raised mean FPR to 26.8%, even though the grid retained the same number of tokens. Padding AMEX screens to match the Mind2Web grid raised FPR to 100% on all four models.

When to update. We recommend checking the current threshold when the visual-token grid changes shape or the agent moves to a new platform. Before rollout, the operator can collect trusted clean screens under human supervision and update the detector if FPR exceeds the deployment’s tolerance. We will add the results for different grid shapes and the calibration procedure to Section 6.3, with details in Appendix E.


[W3, Q1] Adaptive attacks and knowledge of the deployed heads

Attacker’s knowledge of the deployed heads. AHEAD randomly selects 300 heads for each deployment. On KV-Ground-4B (AMEX, ϵ=16/255\epsilon = 16/255), we measured how often an attack both achieved its grounding objective and evaded AHEAD. Without access to the deployed subset, an attacker who optimized over 4 surrogate subsets reached 13.3% mean end-to-end ASR across the three attack types, and one who optimized over 16 reached 26.3%. Penalizing the Mahalanobis distance over all heads, as the reviewer suggested, reached 15.5%. As stated in our defender assumption (Section 6.4), if the defender keeps the selected heads private, the exact subset cannot be read from the public model weights alone. When the attacker knew the exact 300 deployed heads, mean end-to-end ASR was 41.7% across the three attacks.

Attacker’s optimization targetRedirect ASR (%)Disrupt ASR (%)Patch ASR (%)Mean ASR (%)
4 surrogate subsets11.01.527.513.3
16 surrogate subsets46.52.530.026.3
All heads21.52.023.015.5
Exact deployed subset of 300 heads78.010.237.041.7

Dependence on head-subset secrecy. To assess how much AHEAD’s security depends on keeping its selected heads secret, we tested whether an attacker who learns the exact subset can reuse the same adversarial images after the defender replaces some or all of those heads. We optimized each attack against the original 300-head detector and used its end-to-end ASR as the full-overlap baseline. We then evaluated the same images on new 300-head detectors that retained 200, 100, or none of the original heads. For each overlap level, we report the median end-to-end ASR for each attack across 20 refitted detectors. The final column gives the mean of the three attack-specific rates.

Shared heads (out of 300)Redirect ASR (%)Disrupt ASR (%)Patch ASR (%)Mean ASR (%)
300 (original detector)78.010.237.041.7
2004.51.027.511.0
1000.00.018.56.2
00.00.010.53.5

Replacing 100 of the 300 targeted heads reduced mean ASR from 41.7% to 11.0%. With no shared heads, median ASR fell to 0.0% for redirect and disrupt and to 10.5% for patch. Overall, a defender who suspects that the subset is exposed can therefore draw new heads and refit the detector on clean screens.

Comparison with other detectors under full attacker knowledge. We also evaluated NEARSIDE and JailGuard against an attacker who knew each detector in full. AHEAD had the lowest mean ASR at 41.7%, against 47.5% for JailGuard and 66.3% for NEARSIDE. AHEAD had the lowest ASR for disrupt and patch, and JailGuard had the lowest for redirect. We will add these results to Section 6.4 and state the risk that remains for redirect when the attacker knows the heads.

Deployed detectorRedirect ASR (%)Disrupt ASR (%)Patch ASR (%)Mean ASR (%) ↓
AHEAD (exact head subset known)78.010.237.041.7
NEARSIDE94.016.089.066.3
JailGuard59.017.765.747.5
Reviewer_L4m3OpenReview ↗
Rating
3
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper proposes AHEAD, a detector for visual adversarial attacks against GUI grounding models. The method extracts attention from generated coordinate tokens to screenshot tokens and represents each input using the attention entropies of a fixed random subset of heads. A clean reference distribution is estimated from benign inputs, and adversarial inputs are identified through their Mahalanobis distance from this reference. Across four grounding models, two datasets, and three attack settings, AHEAD achieves strong detection performance with modest inference overhead. The paper also evaluates cross-domain adaptation using 50 clean target inputs and detector-aware attacks.

Critical strengths
  1. The paper identifies head-specific changes in answer-to-image attention entropy as an effective feature for detecting the evaluated attacks.
  2. AHEAD does not require adversarial fitting examples, avoiding dependence on a predefined collection of attacks.
  3. Features are extracted during the existing grounding call, with average latency increases of approximately 7–9% in the reported settings.
  4. The comparisons among entropy, attention mass, hidden states, and alternative scoring rules substantiate the proposed feature representation and covariance-based scoring.
Critical weaknesses
  1. The central assumption is that deployment inputs remain sufficiently close to a fitted clean attention distribution. Real GUI environments vary across applications, websites, layouts, devices, and rendering conditions. The 100% cross-domain false positive rates without adaptation provide direct evidence that benign changes can invalidate the detector. This raises the concern that AHEAD may detect distributional novelty alongside adversarial manipulation, without reliably distinguishing the two.
  2. Few-shot adaptation does not resolve the deployment problem. In an open deployment environment, domain boundaries may be unclear and new interfaces may appear continuously. The paper does not establish how to identify when adaptation is needed, obtain trustworthy calibration inputs, or maintain calibration across mixed and changing domains.
Questions for authors
  1. How would the detector obtain trusted clean adaptation samples during deployment, and determine when its reference distribution needs updating?
  2. What explains the 100% false positive rates under direct cross-domain transfer? Which benign factors most strongly affect the entropy features and detection scores?
2 comments
AuthorsOpenReview ↗

Response to Reviewer L4m3

We thank the reviewer for highlighting AHEAD’s low overhead and its use of clean data alone to fit the detector. We examine which changes to clean screens raise false alarms and explain how operators can collect trusted screens and decide when to update the reference.

New experiments

  • [W1, Q2] False alarms on unseen apps and after changes in resolution, display mode, or visual-token grid shape

[W1, Q2] Benign screen changes that reproduce the 100% FPR

False alarms across input conditions. To test which changes could reproduce the 100% FPR on Mind2Web, we cropped or padded clean AMEX screens while keeping the mobile apps the same. We also tested lower resolution, simulated dark mode, and seven held-out apps. For each condition, the table reports the mean FPR across four models at their original AMEX thresholds. For UI-Venus, we report the shape of the visual-token grid after resizing (width × height in image tokens).

Clean evaluation conditionVisual-token grid (UI-Venus)Mean FPR at τ\tau across four models (%)
Original AMEX screens19×422.3
Lower resolution19×422.3
Simulated dark mode19×422.8
Unseen apps19×424.3
AMEX screens cropped from 9:19 to 9:1621×3826.8
AMEX screens padded to match Mind2Web31×26100.0
Mind2Web31×26100.0

False alarms under deployment changes. Mean FPR was 2.3% on both the original and lower-resolution AMEX screens, 2.8% with simulated dark mode, and 4.3% on seven held-out apps without per-app recalibration. Cropping the same 100 AMEX screens from 9:19 to 9:16 raised mean FPR to 26.8%, even though UI-Venus retained 798 image tokens. Padding AMEX screens to match the Mind2Web grid reproduced the 100% FPR on all four models. The largest increases in FPR occurred when the visual-token grid changed shape. We will add this comparison to Section 6.3.

Benign banners and noise. To test how often benign changes trigger false alarms, we used banners that matched the optimized patches in size and position, and uniform noise at the same perturbation budget as the full-image attacks (±16/255\pm 16/255). AHEAD’s false-positive rate was at most 4% on screens with benign banners (Table 15) and 3.5% on screens with uniform noise (Table 14).


[W2, Q1] When and how to update the clean reference

When to update. A change in the visual-token grid shape or platform is a reason to check the current threshold. Interfaces can also change while the grid stays the same. For deployments that span several apps or sites, we suggest periodically replaying representative tasks and checking the false-alarm rate for each interface. We recommend updating the reference when the rate on trusted clean screens exceeds the operator’s tolerance.

How to obtain trusted screens. An operator can replay these tasks on a verified app build or a test site under their control and capture the screenshot and instruction through the same pipeline used in deployment. This gives the operator a known source for each screen and requires no labels for whether the model clicked correctly. In our cross-platform experiments, we used 50 clean target screens in total to update the reference and recalibrate the threshold through five-fold cross-fitting (Appendix E). We evaluated this procedure for transfer between AMEX and Mind2Web (Table 3).

AuthorsOpenReview ↗

Gentle reminder before the discussion period ends

Dear Reviewer L4m3,

As the discussion period nears its close, we wanted to send a gentle reminder and kindly ask whether our responses have addressed your concerns.

Briefly, we have addressed (1) false alarms under benign screen changes [W1, Q2] and (2) when and how to update the clean reference [W2, Q1].

We deeply appreciate your effort and time in reviewing our manuscript, and for your careful and positive assessment. If any concern remains unresolved, we would welcome the chance to address it with further clarification or experiments

Best regards,

The Authors

Comments on the paper

1 comment
AuthorsOpenReview ↗

Official Comment by Authors

Dear Area Chair,

Thank you for your time and effort. We summarize our contributions and responses below.


1. Motivation

We propose AHEAD, a practical detector for visual attacks on GUI agents that requires no adversarial supervision or additional model inference.

Security risks in GUI grounding

  • GUI agents locate interface elements and execute actions across apps and websites.
  • Attacker-controlled visual content can redirect these actions, potentially causing financial loss or disclosure of private information.
  • Detection enables intervention before unintended actions.

Need for practical detection

  • Existing methods either require adversarial fitting examples that may not represent deployment-time attacks or repeated inference at each step.
  • AHEAD uses clean inputs alone and extracts its features during the existing grounding call. L4m3 and T5Dh highlighted these advantages.

2. Contributions

  • A head-specific detection signal. Our analysis identifies distinct changes in answer-to-image attention entropy across heads under visual attacks (Sec. 4.2).
  • A practical, clean-only detector. AHEAD jointly measures these head-wise deviations from a clean reference using Mahalanobis distance without adversarial fitting examples or additional model inference (Sec. 5).
  • Strong detection with low overhead. Across four models, two datasets, and three attacks, AHEAD achieves 0.997 AUROC and 99.0% TPR@3%FPR, with 7–9% latency overhead. Adaptation with 50 clean target inputs achieves 90.7% TPR@3%FPR in both transfer directions (Tables 1, 4, 22).

3. Discussions

We addressed the reviewers’ concerns through additional experiments and clarifications, summarized below. Manuscript locations follow the revised PDF. † marks additional evidence available in discussion.

CommentsL4m3T5Dh9GpVManuscriptResponse
Baseline Comparisons✔✔Sec. 6.5, Apps. C, G + †A
Benign Screen Changes✔✔✔Sec. 6.3, Table 5B
Adaptation Criteria✔✔✔Sec. 6.3, App. EC
Agent Trajectory-level Evaluation✔✔Sec. 6.2, Table 3 + †D
Adaptive Attacks✔✔Sec. 6.4, App. FE
Smaller Attack Budgets✔App. CF
Attention Sinks✔Discussion†G
SDPA & Larger Models✔App. D + †H

TPR denotes TPR@3%FPR.

ResponseDiscussion locationSummary
AT5Dh W1/W6/Q5, 9GpV W1/Q1To address baseline concerns, we compared layer-wise entropy, hidden states, and clean-only detectors and showed higher mean detection with head-wise entropy. AHEAD also yields fewer false alarms on clean web errors and better equal-budget adaptation than hidden states†.
BL4m3 W1/Q2, T5Dh W2/Q2, 9GpV W4/Q3For benign shifts, we varied resolution, display mode, apps, and framing and showed that grid-shape changes warrant calibration checks, while other tested changes retain low FPR. These tests also change framing, so they do not isolate geometry.
CL4m3 W2/Q1, T5Dh W2/Q2, 9GpV W4/Q3To clarify adaptation criteria, we evaluated mobile–web transfer and showed that 50 clean target inputs recover strong detection and low FPR. We recommend checks after grid or platform changes, with adaptation when clean FPR exceeds tolerance.
DT5Dh W5/Q6, 9GpV W4/Q3To address cumulative false alarms, we evaluated AHEAD on AndroidWorld, a benchmark for multi-step tasks in real-world Android apps. Alarms cluster in a few runs: alarms stop 5.9% of 101 otherwise successful runs, below 14.9% expected under independent step alarms†.
ET5Dh W3/Q1, 9GpV Q4To address adaptive robustness, we evaluated full-knowledge attacks on KV-Ground/AMEX and showed that AHEAD has lower mean end-to-end ASR than both baselines. Head replacement further reduces transfer of fixed attack images.
FT5Dh W4/Q3To address reliance on large perturbations, we evaluated smaller budgets and showed that strong detection persists, with over 94% TPR on successful redirects and disruptions at ε = 2/255
G9GpV W2/W3/Q2To address attention sinks, we evaluated token removal and separate head groups and showed that AHEAD remains effective without sink tokens. Both head groups provide signals, although excluding sink-dominated heads can reduce performance.
HT5Dh W7/Q7–Q8For efficiency and scaling, we traced one screen each on UI-Venus-2B/8B and evaluated three 7B–8B models, showing that AHEAD retains SDPA’s FlashAttention backend in traced calls with 300 heads effective on the tested larger models.
  • T5Dh raised their score to 3 following the additional experiments.
  • 9GpV confirmed that their concerns were addressed and reaffirmed support for acceptance.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.