测试编码代理能否自动推断最小权限,发现其常要么权限不足要么过度授权。
Do Coding Agents Understand Least-Privilege Authorization?

- 通过任务模拟生成权限策略,再逐项审核权限合理性
- 模型越推理越一致,但常陷入权限过宽或过严的固定错误模式
- 新方法分解权限生成与审计,显著提升敏感任务成功率
随着编码代理获得对终端、仓库和用户文件的访问权限,最小权限授权成为安全部署的前提:代理应仅获完成任务所必需的权限,避免暴露敏感面。为研究当前模型是否能自主推断这一边界,我们提出权限边界推理任务,即根据任务指令和终端环境生成文件级读/写/执行策略,并构建AuthBench基准,包含120个真实终端任务,配有经人工审核的权限标签和可执行验证器以评估任务成功率与攻击后果。结果显示,权限分配并非简单的保守与宽松之间的权衡问题:前沿模型常遗漏执行链所需权限,同时授予未使用或敏感的访问权限。增加推理时间无法解决此偏差。相反,各模型趋向于自身特有的权限吸引子:更多推理使其更一致地维持自身的失败模式——要么权限过广而暴露,要么权限过紧而脆弱。这表明直接生成策略是瓶颈,因单次生成需同时发现所有必要访问并拒绝所有冗余访问。为此,我们提出充分性-紧致性分解:先通过前向模拟生成覆盖导向策略,再逐一审计每个授予权限的合理性与敏感性。在多个测试模型上,该方法使紧致性偏误模型在敏感任务上的成功率最高提升15.8%,同时降低所有模型的攻击成功率。
原文摘要 · Abstract (English)
As coding agents gain access to shells, repositories, and user files, least-privilege authorization becomes a prerequisite for safe deployment: an agent should receive enough authority to complete the task, without unnecessary authority that exposes sensitive surfaces. To study whether current models can infer this boundary themselves, we first introduce permission-boundary inference, where a model maps a task instruction and terminal environment to a file-level read/write/execute policy, and AuthBench, a benchmark of 120 realistic terminal tasks with human-reviewed permission labels and executable validators for utility and attack outcomes. AuthBench shows that authorization is not a simple conservative-versus-permissive calibration problem: frontier models often omit permissions required by the execution chain while also granting unused or sensitive accesses. Increasing inference-time reasoning does not resolve this mismatch. Instead, each model moves toward a model-specific authorization attractor: more reasoning makes it more consistent in its own failure mode, whether broad-but-exposed or tight-but-brittle. This suggests that direct policy generation is the bottleneck, because a single generation must both discover all necessary accesses and reject all unnecessary ones. We therefore propose Sufficiency-Tightness Decomposition, which first generates a coverage-oriented policy by forward-simulating the task and then audits each granted entry for grounding and sensitivity. Across tested models, this decomposition improves sensitive-task success by up to 15.8% on tightness-biased models while reducing attack success across all evaluated models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。