arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.10156cs.CL
收藏

ToolSafe: 通过主动的步骤级防护和反馈提升基于LLM的代理的工具调用安全性

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

National Engineering Research Center for Software Engineering, Peking University(软件工程国家工程研究中心,北京大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)

Yutao Mou, Zhangchi Xue, Lijun Li, Peiyang Liu, Shikun Zhang, Wei Ye, Jing Shao

AI总结:

ToolSafe通过构建TS-Bench和TS-Guard模型,结合TS-Flow框架,有效减少LLM代理的有害工具调用并提升任务完成率。

摘要:

尽管基于LLM的代理可以通过调用外部工具与环境交互,但其扩展能力也放大了安全风险。实时监控步骤级工具调用行为并在不安全执行前主动干预对于代理部署至关重要,但这一领域仍处于探索阶段。在本工作中,我们首先构建了TS-Bench,一个用于检测LLM代理步骤级工具调用安全性的新型基准。随后,我们开发了TS-Guard模型,采用多任务强化学习构建。该模型通过推理交互历史,主动检测执行前的不安全工具调用行为。它评估请求的有害性及动作-攻击相关性,生成可解释且可推广的安全判断和反馈。此外,我们引入了TS-Flow,一个基于防护-反馈驱动的LLM代理推理框架,该框架在ReAct型代理中将有害工具调用减少了平均65%,并在提示注入攻击下将良性任务完成率提高了约10%。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑