CmdNeedle: 衡量AI智能体命令黑名单的不完备性
One Goal, Many Commands: Characterizing Denylist Fragility in AI Agents
AI总结:
针对终端AI智能体命令黑名单的脆弱性问题,提出LLM驱动的检测流水线CmdNeedle,发现69.0-98.6%的黑名单存在可绕过漏洞。
摘要:
AI智能体的采用正在迅速增加。终端AI智能体,即在终端环境中运行的AI智能体,是广泛使用的一类AI智能体。终端AI智能体严重依赖shell命令执行来与主机系统交互。它们采用三列表命令门控机制来减轻命令执行引入的安全风险,其中黑名单作为承重组件。然而,现代操作系统通常附带大量且不断扩展的shell命令,功能复杂。我们的观察是,即使是Claude Code内置的黑名单(由开发者精心维护),也可能忽略使其失效的绕过命令。这种疏忽导致脆弱的命令黑名单甚至无法阻止从业者期望其阻止的操作。本文首次系统性地描述了终端AI智能体中命令黑名单的脆弱性。本文形式化了命令黑名单脆弱性问题,并提出了一种LLM驱动的流水线CmdNeedle来检测此类脆弱性。它提示LLM提出可能的绕过方法,并使用验证器在沙箱中执行这些方法后的反馈进行迭代修复。在评估中,我们将CmdNeedle应用于从GitHub收集的1,709个真实世界命令黑名单(包含13,332条黑名单规则)。评估显示了几项关键发现,包括69.0-98.6%的黑名单是脆弱的,这种脆弱性在项目和智能体之间一致出现,以及这种脆弱性的几个可能根本原因的有效性。我们的流水线和发现有望促进未来关于AI智能体使用的命令黑名单的研究和实践。
英文摘要:
The adoption of AI agents is increasing rapidly. Terminal AI agents, i.e., AI agents that run in terminal environments, are a widely used type of AI agents. Terminal AI agents rely heavily on shell command execution to interact with the host systems. They adopt a three-list command-gating mechanism to mitigate security risks introduced by command execution, with denylists serving as the load-bearing component. However, modern operating systems often ship a large, ever-expanding set of shell commands with complex functionalities. Our observation is that even a built-in denylist of Claude Code, well-maintained by its developers, can overlook bypass commands that invalidate its effectiveness. Such negligence leads to fragile command denylists that cannot even block operations that practitioners expect them to block. This paper presents the first systematic characterization of command denylist fragility in terminal AI agents. The paper formalizes the command denylist fragility problem and proposes an LLM-driven pipeline, ShellSieve, to detect such fragility. It prompts the LLM to propose possible bypasses and iteratively repairs them using feedback from a validator that executes them in a sandbox. In the evaluation, we applied ShellSieve to 1,709 real-world command denylists (containing 13,332 denylist rules) collected from GitHub. The evaluation shows several key findings, including that 69.0--98.6% of the denylists are fragile, that this fragility occurs consistently across projects and agents, and the validity of several possible root causes for this fragility. Our pipeline and findings will hopefully facilitate future research and practice regarding the command denylists used by AI agents.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。