paperbot · PL 论文追踪

全部论文 待读 收藏

SAF: An AI-Agent-Ready and Browser-Accessible Static Analysis Framework for LLVM IR

SAF:面向 AI 智能体、可在浏览器中访问的 LLVM IR 静态分析框架
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026引用 0 inbox
Yuekang Li, Wei Li, Wei Song, Yi Liu, Gelei Deng
crossref: 2026-10-09

AI 速览

一句话:SAF 用 Rust 内核加 Python/WASM 接口、YAML 规格语言与智能体技能,让 AI 编码智能体可端到端构建 LLVM IR 静态检查器。

现有面向 LLVM IR 的全程序分析框架(如 SVF、Phasar、Lotus)只暴露 C++ API,使用者必须继承子类、重新编译并锁定特定 LLVM 版本,上手周期以月计;CodeQL 虽以查询语言替代 C++ API,但同样不是为日益参与软件工程任务的 AI 编码智能体设计的。本文提出 Static Analyzer Factory(SAF):以 Rust 实现分析内核,通过 PyO3 零拷贝绑定暴露给 Python;提供基于 WebAssembly 与 Pyodide 的浏览器 playground,无需安装即可运行同一套 SDK;引入声明式 YAML 函数规格语言,供内置检查器在运行时消费;并发布两个可装入 Claude Code 与 Codex 的编码智能体技能。作为示例,SAF 自带的内存安全检查器即由 Claude Code(Opus 4.6)依此工作流端到端编写。在 NIST Juliet C/C++ 基准上,这些检查器在四类内存安全 CWE 中的三类取得最佳 F1,对比对象为 SVF 与 Lotus 中各自提供对应检查器的实现。

问题
现有 LLVM IR 分析框架依赖 C++ API、子类化与固定 LLVM 版本,学习与集成成本高,且均未针对驱动软件工程任务的 AI 编码智能体设计。
方法
SAF 采用 Rust 内核加 PyO3 零拷贝 Python 绑定、WASM/Pyodide 浏览器 playground、声明式 YAML 函数规格语言,并附带可安装到 Claude Code 与 Codex 的编码智能体技能。
评估
在 NIST Juliet C/C++ 基准上,将 SAF 自带(且由 Claude Code 在 Opus 4.6 上端到端编写)的内存安全检查器与 SVF、Lotus 中提供对应检查器的实现比较,四类内存安全 CWE 中有三类取得最佳 F1。
原文摘要(Abstract)

Static program analysis finds bugs before software ships, and modern checkers for C/C++ depend on whole-program infrastructure: pointer analysis, value-flow tracking, taint analysis, and IFDS-based data flow on top of LLVM. Today’s LLVM-IR frameworks fall short. SVF, Phasar, and Lotus expose their analyses through C++ APIs that require subclassing, recompilation, and pinned LLVM builds; onboarding takes months. CodeQL replaces the C++ API with a domain-specific query language. None is designed for the AI coding agents that increasingly drive software-engineering work. We present the Static Analyzer Factory (SAF), an LLVM-IR analysis framework that combines a Rust kernel exposed to Python through PyO3 zero-copy bindings, a WebAssembly and Pyodide browser playground that runs the same SDK with no install, a declarative YAML language for function specifications that the built-in checkers consume at runtime, and two shipped coding-agent skills installable in Claude Code and Codex. As an illustrative case, SAF’s bundled memory-safety checkers were themselves authored end-to-end through this workflow using Claude Code on the Opus 4.6 model. On the NIST Juliet C/C++ benchmark, these checkers achieve the best F1 on three of four memory-safety CWEs, each measured against whichever of SVF and Lotus ships a corresponding checker. Code: https://github.com/Static-Analyzer-Factory/static-analyzer-factory. Documentation and browser playground: https://static-analyzer-factory.github.io/static-analyzer-factory/. Demo video: https://youtu.be/Cj58VvNCrlw.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot12349,
  title = {SAF: An AI-Agent-Ready and Browser-Accessible Static Analysis Framework for LLVM IR},
  author = {Yuekang Li and Wei Li and Wei Song and Yi Liu and Gelei Deng},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3834597}
}