本地LLM智能体作为脆弱运行时:智能体运行时层的源代码审计 Local LLM Agents as Vulnerable Runtimes:A Source-Code Audit of the Agent Runtime Layer 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-06-19
👁️ 预览文献
💡 AI 中文简介
本地LLM智能体(如OpenClaw、Nanobot)直接运行在用户机器上,能操作shell、文件系统、浏览器和凭证,实际上已成为特权软件运行时。以往研究多关注提示注入或黑盒评估,却忽视了实现层(提示构建、解析器、工具调度、权限门等)这一安全边界。本文提出CLAWAUDIT静态审计框架,基于STRIDE构建五类漏洞分类,编写47条Semgrep规则和30条CodeQL查询,在446条OpenClaw源码级安全公告上评估。在留出测试集上,Semgrep召回率从21.7%提升至66.8%,CodeQL从13.8%提升至75.1%,且训练/测试差距在4个百分点内,表明规则具有泛化能力。
领域软件安全 / 静态程序分析 / LLM智能体安全
适合谁读需要一定专业背景(软件安全、静态分析、LLM智能体)
核心贡献1. 首次系统性地对本地LLM智能体运行时层进行源代码级安全审计,提出基于STRIDE的五类漏洞分类法。2. 开发了针对智能体特有模式的静态分析规则(47条Semgrep规则和30条CodeQL查询),在留出测试集上显著提升漏洞召回率,并验证了规则的泛化性。
关键数据在446条OpenClaw安全公告(229训练/217测试)上,Semgrep召回率从21.7%提升至66.8%,CodeQL从13.8%提升至75.1%;训练/测试差距在4个百分点内;初步实时代码审计表明规则需人工筛选。
推荐理由如果你关心AI智能体的安全,这篇论文首次深入代码层揭示了本地智能体运行时的脆弱性,并给出了可落地的静态审计方案,数据提升显著,值得一读。
关键词["本地LLM智能体", "运行时安全", "静态分析", "漏洞审计", "STRIDE威胁模型", "源代码审计"]

原文摘要

查看英文原文摘要

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.