Saved in:
| Main Authors: | , , , , , , , , , |
|---|---|
| Format: | Preprint |
| Published: |
2025
|
| Subjects: | |
| Online Access: | https://arxiv.org/abs/2510.03204 |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1866918153866444800 |
|---|---|
| author | Kerboua, Imene Shayegan, Sahar Omidi Thakkar, Megh Lù, Xing Han Boisvert, Léo Caccia, Massimo Espinas, Jérémy Aussem, Alexandre Eglin, Véronique Lacoste, Alexandre |
| author_facet | Kerboua, Imene Shayegan, Sahar Omidi Thakkar, Megh Lù, Xing Han Boisvert, Léo Caccia, Massimo Espinas, Jérémy Aussem, Alexandre Eglin, Véronique Lacoste, Alexandre |
| contents | Web agents powered by large language models (LLMs) must process lengthy web page observations to complete user goals; these pages often exceed tens of thousands of tokens. This saturates context limits and increases computational cost processing; moreover, processing full pages exposes agents to security risks such as prompt injection. Existing pruning strategies either discard relevant content or retain irrelevant context, leading to suboptimal action prediction. We introduce FocusAgent, a simple yet effective approach that leverages a lightweight LLM retriever to extract the most relevant lines from accessibility tree (AxTree) observations, guided by task goals. By pruning noisy and irrelevant content, FocusAgent enables efficient reasoning while reducing vulnerability to injection attacks. Experiments on WorkArena and WebArena benchmarks show that FocusAgent matches the performance of strong baselines, while reducing observation size by over 50%. Furthermore, a variant of FocusAgent significantly reduces the success rate of prompt-injection attacks, including banner and pop-up attacks, while maintaining task success performance in attack-free settings. Our results highlight that targeted LLM-based retrieval is a practical and robust strategy for building web agents that are efficient, effective, and secure. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2510_03204 |
| institution | arXiv |
| publishDate | 2025 |
| record_format | arxiv |
| spellingShingle | FocusAgent: Simple Yet Effective Ways of Trimming the Large Context of Web Agents Kerboua, Imene Shayegan, Sahar Omidi Thakkar, Megh Lù, Xing Han Boisvert, Léo Caccia, Massimo Espinas, Jérémy Aussem, Alexandre Eglin, Véronique Lacoste, Alexandre Computation and Language Web agents powered by large language models (LLMs) must process lengthy web page observations to complete user goals; these pages often exceed tens of thousands of tokens. This saturates context limits and increases computational cost processing; moreover, processing full pages exposes agents to security risks such as prompt injection. Existing pruning strategies either discard relevant content or retain irrelevant context, leading to suboptimal action prediction. We introduce FocusAgent, a simple yet effective approach that leverages a lightweight LLM retriever to extract the most relevant lines from accessibility tree (AxTree) observations, guided by task goals. By pruning noisy and irrelevant content, FocusAgent enables efficient reasoning while reducing vulnerability to injection attacks. Experiments on WorkArena and WebArena benchmarks show that FocusAgent matches the performance of strong baselines, while reducing observation size by over 50%. Furthermore, a variant of FocusAgent significantly reduces the success rate of prompt-injection attacks, including banner and pop-up attacks, while maintaining task success performance in attack-free settings. Our results highlight that targeted LLM-based retrieval is a practical and robust strategy for building web agents that are efficient, effective, and secure. |
| title | FocusAgent: Simple Yet Effective Ways of Trimming the Large Context of Web Agents |
| topic | Computation and Language |
| url | https://arxiv.org/abs/2510.03204 |