HarmonyGuard: Toward Safety and Utility in Web Agents via Adaptive Policy Enhancement and Dual-Objective Optimization
Abstract
HarmonyGuard is a multi-agent framework that enhances policy compliance and task completion in web environments by adaptively updating security policies and optimizing dual objectives of safety and utility.
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.
Community
We proposes HarmonyGuard , a multi-agent collaborative framework designed to address the critical challenge of jointly optimizing safety and utility for LLM-based web agents in dynamic open environments. Recognizing the limitations of prior work that focused on single-objective optimization or single-turn scenarios, HarmonyGuard introduces two key innovations: (1) The Policy Agent dynamically extracts, structures, and updates security policies through adaptive enhancement mechanisms (e.g., semantic similarity filtering and tiered bounded queues), and (2) The Utility Agent employs second-order Markovian evaluation strategies and metacognitive capabilities to achieve real-time trade-off optimization between safety (policy compliance) and utility (task alignment).
Our code is available here: github.com/YurunChen/HarmonyGuard
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- SafeMobile: Chain-level Jailbreak Detection and Automated Evaluation for Multimodal Mobile Agents (2025)
- DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents (2025)
- MobileUse: A GUI Agent with Hierarchical Reflection for Autonomous Mobile Operation (2025)
- SwarmAgentic: Towards Fully Automated Agentic System Generation via Swarm Intelligence (2025)
- Uncertainty-Aware GUI Agent: Adaptive Perception through Component Recommendation and Human-in-the-Loop Refinement (2025)
- Agent Safety Alignment via Reinforcement Learning (2025)
- GoalfyMax: A Protocol-Driven Multi-Agent System for Intelligent Experience Entities (2025)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment:
@librarian-bot
recommend
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper