STELP: 保障LLM生成程序的编译与执行
STELP: Secure Transpilation and Execution of LLM-Generated Programs
AI总结:
STELP通过安全编译和执行LLM生成的代码,解决生产环境中的安全性和可靠性问题,提升代码执行的安全性与准确性。
摘要:
大语言模型(LLM)的快速演进在推理、规划和功能调用能力方面取得了重大进展。利用此类LLM的多智能体协作框架使其成为解决软件开发相关任务(如代码生成)的核心。然而,直接在生产软件开发系统中使用LLM生成的代码存在问题。代码可能不稳定或有错误,包含数据中毒、恶意攻击和幻觉等漏洞,可能导致广泛系统故障。这禁止了LLM生成代码在生产AI系统中的应用,因为人类代码审查和传统安全测试工具不切实际或不可信。本文讨论了LLM生成代码执行的安全性和可靠性问题,并提出了一种安全的LLM生成程序编译器和执行器(STELP),能够以受控和安全的方式执行LLM生成的代码。STELP保障涉及代码生成的自主生产AI系统,填补了传统安全测试方法不实际或限制的空白。这包括无头代码生成-执行和LLM生成可执行代码片段作为行动计划以实时执行的应用。我们贡献了一个经过人类验证的不安全代码片段数据集,并在公开可用的数据集上基准测试我们的方法,以正确性、安全性和延迟为标准。我们的结果表明,我们的方法在安全执行危险代码片段方面显著优于现有方法。警告:本文包含恶意代码片段,应谨慎运行。
英文摘要:
Rapid evolution of Large Language Models (LLMs) has achieved major advances in reasoning, planning, and function-calling capabilities. Multi-agentic collaborative frameworks using such LLMs place them at the center of solving software development-related tasks such as code generation. However, direct use of LLM generated code in production software development systems is problematic. The code could be unstable or erroneous and contain vulnerabilities such as data poisoning, malicious attacks, and hallucinations that could lead to widespread system malfunctions. This prohibits the adoption of LLM generated code in production AI systems where human code reviews and traditional secure testing tools are impractical or untrustworthy. In this paper, we discuss safety and reliability problems with the execution of LLM generated code and propose a Secure Transpiler and Executor of LLM-Generated Program (STELP), capable of executing LLM-generated code in a controlled and safe manner. STELP secures autonomous production AI systems involving code generation, filling the critical void left by the impracticality or limitations of traditional secure testing methodologies and human oversight. This includes applications such as headless code generation-execution and LLMs that produce executable code snippets as an action plan to be executed in real time. We contribute a human-validated dataset of insecure code snippets and benchmark our approach on publicly available datasets for correctness, safety, and latency. Our results demonstrate that our approach outperforms an existing method by a significant margin, particularly in its ability to safely execute risky code snippets. Warning: This paper contains malicious code snippets that should be run with caution.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。