Skip to main content
QUICK REVIEW

[Paper Review] ToolSafe: Enhancing Tool Invocation Safety of LLM-based agents via Proactive Step-level Guardrail and Feedback

Yutao Mou, Zhangchi Xue|arXiv (Cornell University)|Jan 15, 2026
Security and Verification in ComputingComputer Science0 citations
TL;DR

ToolSafe introduces TS-Bench, TS-Guard, and TS-Flow to enable proactive, step-level safety monitoring of tool invocations in LLM-based agents, reducing harmful calls up to 65% and boosting benign task completion by ~10%.

ABSTRACT

While LLM-based agents can interact with environments via invoking external tools, their expanded capabilities also amplify security risks. Monitoring step-level tool invocation behaviors in real time and proactively intervening before unsafe execution is critical for agent deployment, yet remains under-explored. In this work, we first construct TS-Bench, a novel benchmark for step-level tool invocation safety detection in LLM agents. We then develop a guardrail model, TS-Guard, using multi-task reinforcement learning. The model proactively detects unsafe tool invocation actions before execution by reasoning over the interaction history. It assesses request harmfulness and action-attack correlations, producing interpretable and generalizable safety judgments and feedback. Furthermore, we introduce TS-Flow, a guardrail-feedback-driven reasoning framework for LLM agents, which reduces harmful tool invocations of ReAct-style agents by 65 percent on average and improves benign task completion by approximately 10 percent under prompt injection attacks.

Motivation & Objective

  • Identify step-level signals that indicate unsafe tool invocation before execution.
  • Create TS-Bench as a benchmark for step-level tool invocation safety in LLM agents.
  • Develop TS-Guard as a multi-task RL-trained guardrail for pre-execution safety judgments and interpretable feedback.
  • Propose TS-Flow to provide feedback-driven reasoning to guide safer and more effective tool use.

Proposed method

  • Construct TS-Bench from interaction logs to label step-level safety as safe, controversial, or unsafe across four unsafe patterns (MUR, PI, HT, BTRA).
  • Train TS-Guard via reinforcement learning with a multi-task reward for predicting harmfulness, attack links, and final safety label, plus a brief analysis/reasoning output.
  • Use Group Relative Policy Optimization (GRPO) to optimize TS-Guard with a balanced multi-task reward.
  • Develop TS-Flow as a guardrail-feedback-driven reasoning framework that provides pre-execution feedback instead of aborting tasks.
  • Evaluate guardrails on step-level detection (TS-Bench) and guarded agent performance across multiple benchmarks (AgentDojo, ASB, AgentHarm).
Figure 1: Illustration of two categories of tool invocation security risks considered in this study. (a) Malicious user requests that directly induce unsafe tool invocation. (b) Prompt injection attacks occurring during benign task execution, leading to unintended tool use.
Figure 1: Illustration of two categories of tool invocation security risks considered in this study. (a) Malicious user requests that directly induce unsafe tool invocation. (b) Prompt injection attacks occurring during benign task execution, leading to unintended tool use.

Experimental results

Research questions

  • RQ1What step-level signals in LLM-based agents indicate potentially unsafe tool invocation before execution?
  • RQ2How can we train a generalizable guardrail model to detect step-level unsafe tool invocation before execution?
  • RQ3How can step-level guardrails be integrated into LLM-based agents to improve safety without compromising benign task performance?
  • RQ4How robust are guardrails to prompt injection and related attack vectors in real-world agent scenarios?

Key findings

  • TS-Guard consistently outperforms baselines on TS-Bench across four unsafe patterns.
  • TS-Flow reduces harmful tool invocations by up to 65% on average, while benign task completion improves by ~10%.
  • Guardrail feedback increases agent output entropy in risky steps, promoting safety-aware exploration.
  • Multi-task supervision (harmfulness, attack linkage, safety) improves F1 and reduces false positives.
  • Dynamic guardrail feedback (TS-Flow) yields better safety-utility trade-offs than detect-and-abort approaches.
  • Richer guardrail feedback (full TS-Guard output) further enhances safety and utility compared to using only safety ratings.
Figure 2: Illustration of our proactive step-level guardrail and feedback framework for LLM agents. (a) Input and output format of TS-Guard. (b) TS-Flow feeds guardrail feedback to the agent, enabling safe tool invocation reasoning rather than aborting execution.
Figure 2: Illustration of our proactive step-level guardrail and feedback framework for LLM agents. (a) Input and output format of TS-Guard. (b) TS-Flow feeds guardrail feedback to the agent, enabling safe tool invocation reasoning rather than aborting execution.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.