HarmonyGuard: Toward Safety and Utility in Web Agents via Adaptive Policy Enhancement and Dual-Objective Optimization
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
Large language models enable agents to autonomously perform tasks in open web environments. However, as hidden threats within the web evolve, web agents face the challenge of balancing task performance with emerging risks during long-sequence operations. Although this challenge is critical, current research remains limited to single-objective optimization or single-turn scenarios, lacking the capability for collaborative optimization of both safety and utility in web environments. To address this gap, we propose HarmonyGuard, a multi-agent collaborative framework that leverages policy enhancement and objective optimization to jointly improve both utility and safety. HarmonyGuard features a multi-agent architecture characterized by two fundamental capabilities: (1) Adaptive Policy Enhancement: We introduce the Policy Agent within HarmonyGuard, which automatically extracts and maintains structured security policies from unstructured external documents, while continuously updating policies in response to evolving threats. (2) Dual-Objective Optimization: Based on the dual objectives of safety and utility, the Utility Agent integrated within HarmonyGuard performs the Markovian real-time reasoning to evaluate the objectives and utilizes metacognitive capabilities for their optimization. Extensive evaluations on multiple benchmarks show that HarmonyGuard improves policy compliance by up to 38% and task completion by up to 20% over existing baselines, while achieving over 90% policy compliance across all tasks. Our project is available here: https://github.com/YurunChen/HarmonyGuard.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 25 of its 28 references that are in the map. First posted on arXiv 6 Aug 2025.
Builds on
25 of 28 references.
Closest ancestors · 14
Same direction, newest first
- 2025Think Twice Before You Act: Enhancing Agent Behavioral Safety with Thought Correction16 May
- 2025LlamaFirewall: An open source guardrail system for building secure AI agents6 May
- 2025WASP: Benchmarking Web Agent Security Against Prompt Injection Attacks22 Apr
- 2025ShieldAgent: Shielding Agents via Verifiable Safety Policy Reasoning26 Mar
- 2025Evaluating the Robustness of Multimodal Agents Against Active Environmental Injection Attacks18 Feb
- 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents21 Dec
- 2024Attacking Vision-Language Computer Agents via Pop-ups4 Nov
- 2024Refusal-Trained LLMs Are Easily Jailbroken As Browser Agents11 Oct
- 2024ST-WebAgentBench: A Benchmark for Evaluating Safety and Trustworthiness in Web Agents9 Oct
- 2024EIA: Environmental Injection Attack on Generalist Web Agents for Privacy Leakage17 Sep
- 2024AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases17 Jul
- 2024Dissecting Adversarial Robustness of Multimodal LM Agents18 Jun
2 more
Other references · 11
- 2024GPT-4o System Cardcited by 4,588
- 2023Qwen Technical Reportcited by 3,344
- 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 2,006
- 2023Instruction Tuning for Large Language Models: A Surveycited by 623
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 493
- 2024Robust Prompt Optimization for Defending Language Models Against Jailbreaking Attackscited by 156
- 2025InfiGUI-R1: Advancing Multimodal GUI Agents from Reactive Actors to Deliberative Reasonerscited by 140
- 2025InfiGUIAgent: A Multimodal Generalist GUI Agent with Native Reasoning and Reflectioncited by 67
- 2023Metacognitive Prompting Improves Understanding in Large Language Modelscited by 58
- 2024Feedback-Guided Extraction of Knowledge Base from Retrieval-Augmented LLM Applicationscited by 37
- 2025Can We Predict Alignment Before Models Finish Thinking? Towards Monitoring Misaligned Reasoning Modelscited by 17
Built on by
Citing papers per year: 2025: 4; 2026: 6.
10 papers.
- 2026MemEye: A Visual-Centric Evaluation Framework for Multimodal Agent Memorycited by 14
- 2026SafePred: A Predictive Guardrail for Computer-Using Agents via World Modelscited by 12
- 2025ColorBench: Benchmarking Mobile Agents with Graph-Structured Framework for Complex Long-Horizon Taskscited by 10
- 2025GUI-PRA: Process Reward Agent for GUI Taskscited by 9
- 2025Graph2Eval: Automatic Multimodal Task Generation for Agents via Knowledge Graphscited by 7
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden Statescited by 7
- 2026SnapGuard: Lightweight Prompt Injection Detection for Screenshot-Based Web Agentscited by 4
- 2025Learning Efficient Guardrails for Compliancecited by 2
- 2026SkillHarness: Harnessing Safe Skills for Computer-Use Agentscited by 2
- 2026Policy Compliance of User Requests in Natural Language for AI Systemscited by 0
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden States1 Aug 2026
- 2026SkillHarness: Harnessing Safe Skills for Computer-Use Agents2 Jun 2026
- 2026MemEye: A Visual-Centric Evaluation Framework for Multimodal Agent Memory14 May 2026
- 2026SnapGuard: Lightweight Prompt Injection Detection for Screenshot-Based Web Agents28 Apr 2026
- 2026Policy Compliance of User Requests in Natural Language for AI Systems27 Feb 2026
- 2026SafePred: A Predictive Guardrail for Computer-Using Agents via World Models2 Feb 2026
- 2025ColorBench: Benchmarking Mobile Agents with Graph-Structured Framework for Complex Long-Horizon Tasks16 Oct 2025
- 2025Learning Efficient Guardrails for Compliance3 Oct 2025
- 2025Graph2Eval: Automatic Multimodal Task Generation for Agents via Knowledge Graphs1 Oct 2025
- 2025GUI-PRA: Process Reward Agent for GUI Tasks27 Sep 2025
Similar, not cited
Close in wording, no citation either way
- 2025WebGuard: Building a Generalizable Guardrail for Web Agents
- 2026HazardAuditor: From Executable Threats to Safer Computer-Use Agents
- 2026SafeAgent: A Runtime Protection Architecture for Agentic Systems
- 2026WebAgentGuard: A Reasoning-Driven Guard Model for Detecting Prompt Injection Attacks in Web Agents
- 2026BraveGuard: From Open-World Threats to Safer Computer-Use Agents
- 2026Prismata: Confining Cross-Site Prompt Injection in Web Agents
- 2026AgentDoG 1.5: A Lightweight and Scalable Alignment Framework for AI Agent Safety and Security
- 2024AgentMonitor: A Plug-and-Play Framework for Predictive and Secure Multi-Agent Systems