“我们该批准吗?”面向自主编码代理的后果感知审批

·

研究论文 · 2026/11/04

编码智能体日益依赖自动审批器来决定是否允许运行提议的shell命令。现有审批器(从基于规则的检查器到护栏模型和已部署的权限分类器)仅基于请求和命令的文本做出决策。然而,命令的行为取决于其调用的代码和工作区状态,而观察文件变化的系统将评估留给智能体或执行后的人工。我们提出Caper,一种后果感知的审批机制,它在快照沙箱中预执行每个命令,向独立审批器提供其观察到的效果的有界报告,提交允许的命令,并回滚被阻止的命令,同时给出智能体可据此行动的原因。与六个现有系统相比,Caper在SABER上实现了最低的有害结果率(6.7% vs 至少14.8%),在我们构建的YoloFS-Ext基准(有害行为隐藏在调用的工具中)上为7.8% vs 至少35.3%,同时在YoloFS-Ext中阻止了1.0%的危险任务的安全孪生任务。

该论文提出了一种新颖的后果感知审批机制,通过预执行命令并观察实际效果来提高编码智能体的安全性,实验结果表明其显著优于现有系统,且误拦率低,对于提升自动编码智能体的安全部署具有重要意义。

Coding agents increasingly rely on automated approvers to decide whether a proposed shell command may run. Existing approvers, from rule-based checkers to guardrail models and deployed permission classifiers, base their decisions on the text of the request and command. Yet a command's behavior depends on the code it invokes and the state of the workspace, and systems that observe file changes leave the assessment to the agent or a human after execution. We present Caper, a consequence-aware approval mechanism that pre-executes each command in a snapshotted sandbox, provides an independent approver with a bounded report of its observed effects, commits allowed commands, and rolls back blocked ones with a reason the agent can act on. Compared with six existing systems, Caper achieves the lowest harmful-outcome rate on SABER (6.7% versus at least 14.8%) and YoloFS-Ext, a benchmark we build in which harmful behavior is hidden inside invoked tools (7.8% versus at least 35.3%), while blocking 1.0% of the safe twins of the dangerous tasks in YoloFS-Ext.

阅读原文

参与讨论