语言模型代理知道危险却仍会执行,系统通过抽象验证提升安全防护
LM Agents May Fail to Act on Their Own Risk Knowledge
- 用抽象化轨迹让模型更好识别真实场景中的风险
- 模型知风险但难识别实际动作,执行危险操作成功率超74%
- 新验证机制使高危操作减少55.3%,适用于各类大模型
语言模型代理在自动化任务中展现巨大潜力,但在安全关键场景下存在严重风险。本文发现代理的风险认知与安全执行能力间存在显著鸿沟:尽管它们能正确回答如“执行sudo rm -rf /*是否危险”这类问题(准确率>98%),却常在真实行为中无法识别风险或直接执行危险操作(执行成功率<26%)。我们构建了涵盖风险认知、轨迹识别和行为规避三个层次的评估框架,发现性能下降超过23%。这一现象在更强大的模型如DeepSeek-R1中依然存在,表明单纯扩大模型规模无法解决安全问题。为此,我们提出一种独立的风险验证器,将具体执行轨迹抽象为通用描述,使模型更有效识别风险。该系统相比原生提示的代理,使高危操作执行率降低55.3%。
原文摘要 · Abstract (English)
Language model (LM) agents have demonstrated significant potential for automating real-world tasks, yet they pose a diverse array of potential, severe risks in safety-critical scenarios. In this work, we identify a significant gap between LM agents' risk awareness and safety execution abilities: while they often answer "Yes" to queries like "Is executing `sudo rm -rf /*' dangerous?", they will likely fail to identify such risks in instantiated trajectories or even directly perform these risky actions when acting as agents. To systematically investigate this, we develop a comprehensive evaluation framework to examine agents' safety across three progressive dimensions: 1) their knowledge about potential risks, 2) their ability to identify corresponding risks in execution trajectories, and 3) their actual behaviors to avoid executing these risky actions. Our evaluation reveals two critical performance gaps that resemble the generator-validator gaps observed in LMs: while agents demonstrate near-perfect risk knowledge ($>98\%$ pass rates), they fail to apply this knowledge when identifying risks in actual scenarios (with performance dropping by $>23\%$) and often still execute risky actions ($<26\%$ pass rates). Notably, this trend persists across more capable LMs as well as in specialized reasoning models like DeepSeek-R1, indicating that simply scaling model capabilities or inference compute does not inherently resolve safety concerns. Instead, we take advantage of these observed gaps to develop a risk verifier that independently critiques the proposed actions by agents, with an abstractor that converts specific execution trajectories into abstract descriptions where LMs can more effectively identify the risks. Our overall system achieves a significant reduction of risky action execution by $55.3\%$ over vanilla-prompted agents.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。