TAP: Learning to Safely Execute Real-World Tasks via Tail-Aware Post-TrainingTAP: Learning to Execute Real-World Tasks Safely through Tail-Aware Post-training
The authors propose tail-aware post-training TAP: on three open-source models, GRPO all increases the harm rate, while TAP is all lower than the untrained model.
- In benign tool tasks, direct execution is usually time-saving and successful, yet rare hidden dangers cause irreversible harm. The authors argue that GRPO's mean reward dilutes such tail failures, causing agents to skip checks.
- TAP replaces GRPO's mean objective with the certainty equivalent of user satisfaction under exponential utility: it first standardizes rewards within the group, then uses entropic-risk weights to concentrate updates on the worst rollout, with risk aversion strength fixed.
- On the three models on SafeTask and CAPE-Bench, GRPO's Harm is all higher than Base, and TAP is all lower than Base and GRPO; Qwen3-8B on τ-bench retail shows the same trend, and task completion and general capabilities are largely preserved.
- The authors propose adjusting risk aversion by user or task, studying dangers that unfold over multiple steps, and real-user deployment. τ-bench evaluates only Qwen3-8B; except for SafeTask TAP for Qwen3-8B, which uses three seeds, all other configurations are single runs.
- Threat model
- User requests are always benign, with no malicious attacker; agents perform multi-turn tool tasks such as executing code and files, and hidden environment states make irreversible harm from direct execution possible with small probability. A safe path must first verify, request permission or confirm, and incurs extra call cost.
- Evaluated models
- Qwen3-8BOLMo-3-7B-InstructGemma-3-4B-it
- Metrics
- HarmHarm@16 (H@16)CompletionIFEval accuracyBFCL v4 accuracyP(T-bill)P(best)
The researchers propose a tail-aware post-training method, TAP. In evaluations on SafeTask and CAPE-Bench across three open-source models, it reduces agent harm below that of untrained models and GRPO, while largely preserving task completion and general capabilities. The paper's starting point is that when agents execute code and operate the file system, a single harmful tool call takes effect immediately and often cannot be undone, and harm mostly occurs in the course of executing benign requests; safety failures are tail events, and post-training methods such as GRPO that maximize mean reward average out such failures, making agents overly aggressive, and larger penalties cannot correct this. TAP instead maximizes the certainty equivalent of user satisfaction under exponential utility, standardizes rewards within groups and uses entropic-risk weighting to concentrate updates on the worst trajectories, keeping risk aversion constant throughout, and can directly replace GRPO. The researchers also construct the SafeTask benchmark, consisting of benign tool-use tasks with hidden hazards; the evaluation also shows that after GRPO training every agent is less safe than before training.
Related events and news
1 events · 0 news mentions
- This event's paper
研究者提出TAP:尾部感知后训练减少智能体有害工具调用
Paper analysis
What problem does this paper attempt to solve?
The work studies rare irreversible harm in benign tool tasks; the authors argue that mean-reward post-training encourages skipping safety checks.
Core question: how to make an agent executing benign real tasks check first under rare hidden dangers and avoid irreversible harm, while maintaining task completion ability.
- Problem setting: The agent can execute code, email, and file operations, and a single harmful tool call takes effect immediately and is often irreversible. The authors focus on harm in long tasks that arises from how the task is executed rather than from malicious requests.
- Shortcomings of existing methods: The authors state that many safety benchmarks, guardrails, and post-training approaches center on unsafe users, injection, or jailbreak, requiring identification and refusal of malicious inputs; in benign tasks, refusal is not safe behavior, and the agent should still complete the task.
- Core observation: Direct execution usually has higher reward, while checking incurs an extra cost every time; rare disasters are diluted by the mean. The authors use Jensen's inequality to argue that mean reward overestimates the satisfaction of risk-averse users with any risky policy.
- Proposed content: Proposes Tail-Aware Post-training (TAP), which replaces the GRPO mean objective with the certainty equivalent of satisfaction under exponential utility; also constructs SafeTask, a benign tool benchmark containing hidden dangers.
- Threat model: This is a benign execution risk setting, and the paper does not posit a malicious attacker.
- Goal: Complete the user's task while avoiding disasters, violations, or writes the user has rejected caused by hidden dangers.
- Knowledge and capabilities: The agent cannot see the hidden world state and can call verification, mitigation, and execution tools; the request, context, and tool descriptions are identical in both worlds.
- Victim system: A simulated business tool environment; SafeTask's dangers include ten categories such as hidden dependencies, wildcard overmatching, and wrong target environments.
What related research exists?
The authors position the work within benign execution risk and distinguish TAP from risk-sensitive objectives in reasoning tasks that mainly redistribute the learning signal.
Agent safety and alignment
- Christiano et al. (2017), Ouyang et al. (2022), Bai et al. (2022a;b), Mu et al. (2024), Zhang et al. (2026): training harmless models with human, AI or rule feedback. The authors summarize the main scenario of these works as the input already exposing danger, and the model learning to recognize and refuse.
- Perez et al. (2022), Wei et al. (2023), Zou et al. (2023), Hughes et al. (2025): red teaming, jailbreaks and Best-of-N attacks, testing the performance of safety training against adversarial inputs.
- AgentDojo, AgentHarm, GuardAgent, AgentDog, RUBAS, etc.: covering prompt injection, harmful tool tasks, guardrails and agent RL safety training; Ruan et al. (2024), OpenAgentSafety and CAPE-Bench involve risks in executing benign requests.
Risk-sensitive reinforcement learning
- Howard & Matheson (1972), Föllmer & Schied (2002), Shen et al. (2014), Chow et al. (2015): replacing expected return with risk measures such as entropic risk and CVaR, providing the basis for TAP's objective.
- RS-GRPO, SoftmaxGRPO, RiskPO and Yuksekgonul et al. (2026): respectively used to alleviate the exploration dilemma, replace z-score with softmax advantage, and emphasize hard prompts or test-time exploration. Appendix G states that under binary verifiable rewards, these objectives and the mean share the optimal solution on each prompt, and mainly change the update weight of each prompt.
- Chaudhary et al. (2024), Girgis et al. (2026): the former suppresses rare toxic generation with risk-averse fine-tuning, the latter constrains expected cost with constrained GRPO; the authors argue that multi-level rewards and per-rollout hidden states in benign tasks cause mean and risk objectives to select different policies.
User modeling and experimental comparisons
- von Neumann & Morgenstern (2004), Tversky & Kahneman (1992), Pratt (1964): providing the basis for expected utility, risk aversion to rare losses and concave utility. The authors accordingly interpret β as user risk aversion, rather than merely a knob tuned for task metrics.
- Baselines and benchmarks: Base, Cautious Prompting, GRPO, Lagrangian GRPO and TAP are compared; the main evaluations are SafeTask and CAPE-Bench, with τ-bench retail, IFEval and BFCL v4 also used.
The authors state that TAP only changes GRPO's advantage computation and can be combined with GRPO improvements and agentic RL pipelines; its distinction is directly optimizing the policy that risk-averse users would choose in deployment scenarios.
How does the paper address this problem?
TAP first normalizes rewards within the group, then uses softmin weights to concentrate updates on the worst rollout, keeping the risk-aversion strength fixed at β.
The overall idea is to replace GRPO's mean reward with the certainty equivalent of risk-averse user satisfaction. TAP retains group sampling and the policy gradient procedure, changing only the advantage: first z-score, then apply exponential weights to low-reward trajectories.
Problem setting and objective
- Each episode hides a sampled safe world or risky world; direct execution makes few calls and has higher mean reward, while the checking path pays more cost but avoids harm. On average, 12.4% of SafeTask episodes are risky worlds, and the deployment rate for CAPE-Bench and τ-bench is set to 10%.
- User satisfaction is written as the expected utility of reward, with utility strictly increasing and strictly concave. From Jensen's inequality, the authors obtain the overestimation of satisfaction by the mean, and decompose the mean into the certainty equivalent CE and a non-negative risk premium RP.
- Under exponential utility, optimizing CE is equivalent to optimizing entropic risk: Rβ(x)=1/βlog 𝔼y∼πθ(·|x)[eβ r(y)], where β<0 indicates risk aversion.
Risk-sensitive advantage and standardization
- The within-group trajectory weights are proportional to e to the power of βr; when β<0 this forms a softmin, and the lower the reward, the larger the negative advantage, concentrating updates on the worst trajectory in the group.
- The authors derive that the tilt strength under raw rewards is βσ rather than β alone; as policy convergence lowers the within-group standard deviation σ, risk aversion decays and approaches GRPO.
- TAP first computes r̃=(r−group mean)/(σ+ϵ), then takes wi=eβr̃i/∑j eβr̃j, Âi=1−Gwi. After standardization, the tilt strength is fixed at β, and all experiments uniformly use β=−2; as β→0 it returns to GRPO.
Training procedure and reward
- Each request samples G=32 episodes, computes the within-group advantage, and applies it to every token generated by the agent; tool-returned tokens are masked, advantages are not clipped, and groups are not filtered.
- The unified reward consists of task score, harm cost, tool call cost, verification cost, and idle penalty. In SafeTask, a catastrophe overrides the remaining reward; the verification cost is calibrated so that the expected reward of direct execution remains higher than that of the safe path.
- During CAPE-Bench and τ-bench training, risky worlds are sampled at 40%, then importance weights of risky 0.25 and safe 1.5 are used, so that group statistics and TAP weights correspond to a 10% deployment rate.
- GRPO and TAP share data, sampling, optimizer, and hyperparameters; SafeTask/CAPE-Bench/τ-bench are trained for 40/20/20 steps, respectively, with a learning rate of 10⁻⁶; see Table 4 for details.
Benchmark construction and success determination
- SafeTask contains 1,295 tasks, 64 business domains, and ten categories of harm mechanisms, with 918 training and 377 test tasks; test tasks reuse domains and mechanisms but use new scenarios.
- Claude Sonnet generates tasks according to fixed templates, and Claude Opus reviews them against nine criteria; scripts precisely check reward conditions and replay two reference paths. Of 1,279 drafts in the training batch, 764 pass review and 752 pass the final step; of 640 drafts in the test batch, 377 are retained.
- Harm is the proportion of risky-world episodes with harm; Completion is the proportion of safe-world episodes meeting the target; Harm@16 is the probability of at least one harm when the same request is repeated 16 times. SafeTask rewards are computed by rules from simulated environment states, with no LLM judge.
What experiments did the paper conduct?
On three models and two main benchmarks, GRPO increases Harm in all cases, and TAP is lower than both Base and GRPO in all cases; most configurations are run only once.
Experimental Setup
- Models evaluated: Qwen3-8B (non-thinking), OLMo-3-7B-Instruct, Gemma-3-4B-it text weights; all three are trained and evaluated on SafeTask and CAPE-Bench, and only Qwen3-8B is tested on τ-bench retail.
- Benchmark scale: SafeTask has 918 training and 377 test tasks; CAPE-Bench filters templates by untrained policy, with 135 training/32 test pairs for Qwen3-8B and 237/56 pairs for each of the other two models; τ-bench has 238 training and 104 test tasks.
- Comparison methods: Base, Cautious Prompting, GRPO, Lagrangian GRPO, TAP; on CAPE-Bench, Base, GRPO, and TAP for OLMo and Gemma all start from a model warm-started on Qwen3-8B's 941 safe episodes.
- Metrics and determination: Harm, H@16, and Completion are defined in Table 1; CAPE-Bench uses official violation labels and replays calls to check the final state, SafeTask uses rule-based rewards, with no LLM judge.
- Sample size: SafeTask runs 16 times per test task, for a total of 6,032 episodes and about 750 risky-worlds; CAPE-Bench runs 16 times per test pair, and H@16 additionally uses deployment runs.
- Number of repetitions: SafeTask TAP for Qwen3-8B reports the mean over seeds 0, 1, 2; all other configurations are single runs with seed 0. The paper does not report confidence intervals or statistical significance tests.
Main Results
According to Table 1, all values are in %; Compl. is safe-world Completion.
Swipe horizontally to read the table
Model Method SafeTask Harm SafeTask H@16 SafeTask Compl. CAPE Harm CAPE H@16 CAPE Compl. Qwen3-8B Base 91.6 81.2 96.7 31.2 38.0 64.8 Qwen3-8B GRPO 99.7 87.0 99.7 86.3 73.9 85.9 Qwen3-8B TAP 66.5 59.8 99.0 0.0 0.0 94.9 OLMo-3-7B Base 84.8 80.4 88.2 34.4 39.5 66.3 OLMo-3-7B GRPO 99.3 86.5 98.9 86.1 73.4 84.6 OLMo-3-7B TAP 81.6 77.7 94.1 27.9 30.4 74.6 Gemma-3-4B Base 78.9 72.1 95.9 50.6 50.6 85.0 Gemma-3-4B GRPO 99.0 86.7 99.5 98.6 83.0 98.7 Gemma-3-4B TAP 56.9 54.4 94.8 25.4 20.9 96.1 - Few exceptions to the mean objective: In the six model–benchmark combinations, GRPO's Harm and H@16 are both higher than Base; Lagrangian GRPO also does not change this overall direction, and the full values are in Table 1.
- TAP's direction is consistent: In all six groups, TAP's Harm and H@16 are both lower than Base and GRPO; Cautious Prompting lowers Harm on SafeTask, but on CAPE-Bench all three models are higher than their respective Base.
- Completion is not fully preserved: The authors state that TAP's Completion is within about five points of GRPO except for OLMo-3-7B on CAPE-Bench; on CAPE-Bench, TAP is higher than GRPO for Qwen3-8B.
τ-bench Transfer
- Setup and results: Qwen3-8B is trained on the retail domain, where the customer may withdraw the request at confirmation. In Table 5, Harm for Base/GRPO/TAP is 51.2%/55.2%/3.1%, H@16 is 51.2%/55.4%/3.9%, and Completion is 16.3%/13.7%/20.0%.
- Authors' interpretation: The authors state that the trend is consistent with the main benchmarks; all three have low completion rates because retail tasks are long and difficult for an 8B model, and TAP completes more tasks than GRPO.
Ablations and Increasing the Penalty
- Removing z-score: In Table 2, SafeTask Harm on Qwen3-8B/OLMo-3-7B/Gemma-3-4B is 71.9%/90.8%/99.6%, respectively; the latter two are no longer lower than Base, and Qwen3-8B is still higher than the full TAP's 66.5%.
- Increasing the GRPO penalty: After multiplying the negative reward by 4 or 8, Harm across the six model–multiplier combinations is still 94.3%–99.3% (Table 2). The authors explain this as within-group normalization causing the advantage to approach a limit determined by group size as the penalty increases.
- Failure cases: Among the ten Qwen3-8B examples in Appendix H, in tasks where risky episodes occur, Base, GRPO, and TAP all cause harm in all of these episodes; some tasks have no risky episode in 16 runs.
General Capabilities and Controlled Bandit
- IFEval: In Table 3, from Base→TAP, Qwen3-8B is 0.830→0.824, OLMo-3-7B is 0.823→0.828, and Gemma-3-4B is 0.728→0.741; the authors state that TAP's decrease relative to Base is no more than 0.6 points.
- BFCL v4: The authors state that TAP is broadly close to Base on the single-turn function-calling category for Qwen3-8B and OLMo-3-7B; for Gemma-3-4B, live irrel. drops from Base 0.570 to TAP 0.424, and GRPO is 0.697 (Table 3).
- Real-outcome-data bandit: Table 7 reports means over 100 seeds; on Finance, P(T-bill) for GRPO/TAP is 0.004/0.998 and expected return is 12.2%/3.3%; on DSSAT planting, P(best) for the two is 0.988/0.995 and yield is 4143/4147 kg/ha.
Other Ablations and Analyses
- Figure 3a labels the single-run risky-world Harm of untrained models on SafeTask: Qwen3-8B 92%, OLMo-3-7B 85%, Gemma-3-4B 79%.
- Figure 5b labels the weight of harmful episodes in the mean objective: SafeTask/CAPE/τ-bench is 10%/2%/4%, and TAP is 69%/26%/29%.
- The two-choice bandit in Figure 1 is averaged over 30 seeds; the risky choice has a disaster probability of 0.1, and the authors state that GRPO turns to risk only when it usually has a benefit.
- In the analytical example in Appendix E.4, with Δ=1.5, κ=2, p=0.1, δ=0.3, direct execution has a mean benefit of 0.15, a user satisfaction loss of 0.234, and a risk premium of 0.384.
What are some points that can be further explored?
The authors list risk-averse personalization, multi-step danger and real deployment as directions; most experimental configurations use a single seed, and τ-bench tests only one model.
Limitations and future directions noted by the authors
- Fixed risk aversion: The Conclusion proposes that future work could make the degree of risk aversion depend on the user or task; currently all models and benchmarks uniformly use β=−2.
- Temporal structure of danger: The Conclusion proposes studying dangers that gradually unfold across multiple steps in long-horizon tasks; the current setting focuses mainly on hidden states and checking paths.
- Real deployment: The Conclusion proposes evaluating risk-averse post-training in live deployments with real users.
- τ-bench model scope: Appendix C explicitly states that only Qwen3-8B is evaluated, leaving other models for future work.
Experimental coverage
- Models and benchmarks: The main tables cover three models, Qwen3-8B, OLMo-3-7B-Instruct, and Gemma-3-4B-it, and SafeTask and CAPE-Bench; τ-bench retail covers only Qwen3-8B (Table 1, Table 5).
- Training repetitions: SafeTask TAP for Qwen3-8B uses three training seeds and reports the mean; every other configuration is a single run with seed 0 (Appendix B.3).
- CAPE-Bench filtering: For each model, only templates for which its untrained policy reaches the specified careful-path and safe-outcome thresholds are retained, resulting in 4 or 7 templates; OLMo and Gemma additionally undergo warm-starting (Appendix A.1, A.3).
- Determination method: SafeTask rewards are computed by rules from simulated environment states, with no LLM judge; CAPE-Bench uses official violation labels, and the authors correct five checker labels and rewrite one ambiguous tool response (Appendix A.1, H.1).
- Statistical reporting: The paper does not report confidence intervals, statistical significance tests, or training query costs for the main results; Table 4 gives training steps, sampling, and optimization hyperparameters.
Summarize the main content of the paper
TAP replaces the mean advantage with a fixed-strength tail-risk weighting, reducing harm on the authors' benchmarks while largely preserving completion capability.
This is a risk-sensitive post-training study for tool agents, focusing on scenarios where requests are benign but hidden environment states cause direct execution to produce rare irreversible harm.
- Problem: Checking is like an insurance premium paid every time, and direct execution usually yields higher reward. The authors argue that GRPO maximizing the mean dilutes catastrophes and overestimates the satisfaction of risk-averse users, thereby training agents to take shortcuts.
- Method: TAP optimizes the certainty equivalent of satisfaction under exponential utility, i.e., entropic risk; it first applies within-group z-score, then uses softmin weights to concentrate updates on low-reward rollouts, avoiding the decay of risk aversion under raw rewards as within-group variance shrinks.
- Main results: In the six groups of three models and two benchmarks in Table 1, GRPO's Harm is higher than Base in all, and TAP's is lower than both Base and GRPO in all; for Qwen3-8B on CAPE-Bench, TAP's Harm and H@16 are both 0.0%.
- Transfer and cost: For Qwen3-8B on τ-bench retail, TAP's Harm is 3.1%, while Base and GRPO are 51.2% and 55.2%, respectively (Table 5). On SafeTask, TAP's Completion is 94.1%–99.0%, but OLMo-3-7B is lower than GRPO on CAPE-Bench.
- Ablation and capability: After removing z-score, OLMo and Gemma are no longer safer than Base on SafeTask; multiplying GRPO's negative reward by 4 or 8 still yields 94.3%–99.3% Harm (Table 2). On IFEval, TAP's decrease relative to Base does not exceed 0.6 points, but Gemma's BFCL live irrel. decreases.
- Authors' conclusion: Agent safety depends not only on what the reward penalizes but also on how the objective aggregates rare outcomes; future work can study user- or task-specific risk aversion, multi-step dangers, and real-user deployment.