TAP: Learning to Execute Real-World Tasks Safely through Tail-Aware Post-training
Abstract
Language model agents now execute code and operate on file systems, where a single harmful tool call takes effect immediately and often cannot be undone. As agents take on long-horizon tasks, much of this harm arises not from malicious requests but while the agent carries out benign ones. In this setting, safety failures are tail events. Acting directly usually succeeds and only occasionally causes severe harm, so the mean reward that post-training methods such as GRPO maximize averages these failures away and favors the shortcut. We model the user's satisfaction as the expected utility of the reward under a risk-averse utility, and show that the mean reward overstates it for any risky policy, which drives the agent toward overly aggressive behavior that a larger penalty does not correct. We introduce Tail-Aware Post-training (TAP), which maximizes the certainty equivalent of the user's satisfaction under an exponential utility instead of the mean reward. TAP standardizes rewards within each group and applies an entropic-risk weighting that concentrates the update on the worst rollouts, which keeps the risk aversion fixed throughout training. It is a drop-in replacement for GRPO. We build SafeTask, a benchmark of benign tool-use tasks with hidden hazards. Across three open models on SafeTask and CAPE-Bench, GRPO leaves every agent less safe than before training, while TAP lowers harm below both the untrained model and GRPO in every case. Addtionally, TAP largely preserves task completion and general capability.
Create a lesson
Related papers
FrontierCowork: Benchmarking LLM Agents at the Frontier of Real-World Professional Work
Shared title terminologycs.CLZheng Jiang, Fang Niu, Yong Yan et al.
SLAI T-Rex-V2: Full-Stack Post-Training, RL Infrastructure, and Agentic Modeling for Operations Research on Ascend SuperPOD
Shared title terminologycs.CLSLAI AI Training Platform Team, Xuhui Chen, Sihang Chen et al.
Reconciling Conflicting Signals in LLM Post-Training
Shared title terminologycs.CLZhouyang Yu, Shiqi Liu, Zeyu He et al.
Mind the Domain Gap: Post-Training Robustness Is Geometrically Selective
Shared title terminologycs.CLYifan Jiang, Jian Wu, Dongyuan Li et al.
No Reset: Evaluating and Training Persistent Agents on Task Sequences
Shared title terminologycs.CLRomain Froger, Matteo Bettini, Théophile Laurent et al.
DualBO: Diversity-Aware Candidate Generation and Semantics-Behavior Coupled Bayesian Optimization for Prompt Search
Shared title terminologycs.CLRuotian Wu, Ahmad Rashid, Syed Shariyar Murtaza et al.