Learning Efficient Guardrails for Compliance
Abstract
Autonomous web agents are increasingly deployed for long-horizon tasks, yet their ability to adhere to real-world policies remains critically underexplored compared to standard safety objectives. To address this gap, we introduce PolicyGuardBench, a benchmark of 60k policy-trajectory pairs designed to evaluate compliance through both full-trajectory and novel prefix-based violation detection tasks. Using this dataset, we train PolicyGuard, a lightweight guardrail model that achieves strong detection accuracy while maintaining high inference efficiency. Notably, our model demonstrates robust generalization capabilities, preserving high performance even on unseen domains. These contributions establish a comprehensive framework for studying policy compliance, showing that accurate and generalizable guardrails are feasible at small scales.
Lay Summary
Autonomous web agents are AI systems that can browse websites and complete multi-step tasks, such as shopping, scheduling, or managing online workflows. As these agents become more capable, it is not enough for them to simply finish a task; they also need to follow real-world rules and user-specified policies. For example, an agent may successfully place an order but still violate a policy by exceeding a budget or purchasing a restricted item. In this work, we study how to evaluate and improve the policy compliance of web agents. We introduce POLICYGUARDBENCH, a large benchmark containing 60,000 examples that pair agent action trajectories with policies and labels indicating whether the agent violates the policy. The benchmark includes both full-trajectory evaluation and early detection from partial trajectories. Using this benchmark, we train POLICYGUARD-4B, a lightweight guardrail model that can accurately detect policy violations while running efficiently. Our results show that small, specialized guardrails can be both practical and effective for making autonomous agents more reliable.