发现本地大模型代理运行时存在严重安全漏洞,提出可检测的审计框架。
Local LLM Agents as Vulnerable Runtimes:A Source-Code Audit of the Agent Runtime Layer

- 构建针对代理运行时组件的静态审计框架,识别五类安全缺陷。
- 在446个代码漏洞上测试,检出率从21.7%提升至66.8%(Semgrep)。
- 适用于开发者、安全研究人员,用于排查本地AI代理代码风险。
本地大模型代理(如OpenClaw、Nanobot)在用户设备上运行,通过自然语言指令操作系统资源(终端、文件系统、浏览器等),已成为连接用户意图与系统动作的特权运行时。现有研究多关注提示注入或黑盒评估,但其核心实现层——提示构建器、解析器、工具调度器、技能加载器、记忆写入器、网络客户端和权限门控等组件——长期未被安全审计。本文提出CLAWAUDIT,一种基于STRIDE的五类漏洞分类体系,设计47条Semgrep YAML规则与30条CodeQL查询,针对代理特有模式进行分析。在包含446个源码级漏洞的OPENCLAWBENCH基准上,测试集召回率由基线21.7%(Pro)提升至66.8%(Semgrep),CodeQL从13.8%提升至75.1%。训练与测试间差距均小于4个百分点,表明规则具备良好泛化能力。初步现场审计显示需人工筛选,建议部署前加入语义过滤。
原文摘要 · Abstract (English)
Local LLM agents such as OpenClaw and Nanobot run on end-user machines and act on host resources - the shell, filesystem, browser, stored credentials, and messaging applications - through natural-language goals. These agents have become privileged software runtimes that mediate between user intent, model outputs, and host-level actions. Existing research characterizes the landscape through prompt injection, malicious skills, marketplace risks, or black-box evaluation of agents. But the implementation layer that performs this mediation, the prompt builder, parser, tool dispatcher, skill loader, memory writer, network client, and permission gate, has remained an unexamined safety boundary. To our knowledge, no prior work has examined the agent's source tree to audit these components for implementation-level security weaknesses. We present CLAWAUDIT, a static auditing framework for measuring vulnerability exposure in local LLM agent runtimes. CLAWAUDIT derives a five-category vulnerability taxonomy from STRIDE and develops custom static-analysis rules that target agent-specific patterns absent from established rule sets for vulnerability analysis. We instantiate the taxonomy in two backends, 47 Semgrep YAML rules and 30 CodeQL queries, and evaluate on OPENCLAWBENCH, a benchmark of 446 source-code-level advisories from the OpenClaw repository and split temporally into 229 rule-derivation (train) and 217 held-out (test) advisories. On the held-out test, CLAWAUDIT raises Semgrep recall from 21.7% (Pro baseline) to 66.8%, and CodeQL recall from 13.8% (security-extended) to 75.1%. Train/test gaps remain within 4 percentage points for all four configurations, indicating that the rules generalize to vulnerabilities unseen during rule writing. A preliminary live-code audit shows that these recall-oriented rules require manual triage, motivating semantic filtering before production deployment.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。