arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2409.07368cs.CRcs.AI
收藏

Demo: SGCode:一个用于安全生成代码的灵活提示优化系统

Demo: SGCode: A Flexible Prompt-Optimizing System for Secure Generation of Code

New Jersey Institute of Technology(新泽西理工学院);Kent State University(肯特州立大学);Qatar Computing Research Institute(卡塔尔计算研究所);Microsoft Azure AI(微软 Azure 人工智能)

Khiem Ton, Nhi Nguyen, Mahmoud Nazzal, Abdallah Khreishah, Cristian Borcea, NhatHai Phan, Ruoming Jin, Issa Khalil, Yelong Shen

AI总结:

本文提出SGCode,一个灵活的提示优化系统,通过集成LLMs和提示优化方法生成安全代码,支持安全分析审查与方法切换,实验证明其实用且成本边际。

摘要:

本文介绍了SGCode,一个灵活的提示优化系统,用于利用大型语言模型(LLMs)生成安全代码。SGCode将最近的提示优化方法与LLMs集成在一个统一系统中,可通过前端和后端API访问,使用户能够1)生成无漏洞的安全代码,2)审查和分享安全分析,3)轻松从一种提示优化方法切换到另一种,同时提供关于模型和系统性能的洞察。我们在AWS服务器上部署了SGCode,采用了PromSec方法,该方法通过将LLM和安全工具与轻量级生成对抗图神经网络相结合,来检测和修复生成代码中的安全漏洞,从而优化提示。大量实验表明,SGCode作为一个公共工具是实用的,能够深入了解模型效用、安全代码生成和系统成本之间的权衡。与提示LLMs相比,SGCode仅有边际成本。SGCode可在以下网址获取:https://sgcode.codes/。

英文摘要:

This paper introduces SGCode, a flexible prompt-optimizing system to generate secure code with large language models (LLMs). SGCode integrates recent prompt-optimization approaches with LLMs in a unified system accessible through front-end and back-end APIs, enabling users to 1) generate secure code, which is free of vulnerabilities, 2) review and share security analysis, and 3) easily switch from one prompt optimization approach to another, while providing insights on model and system performance. We populated SGCode on an AWS server with PromSec, an approach that optimizes prompts by combining an LLM and security tools with a lightweight generative adversarial graph neural network to detect and fix security vulnerabilities in the generated code. Extensive experiments show that SGCode is practical as a public tool to gain insights into the trade-offs between model utility, secure code generation, and system cost. SGCode has only a marginal cost compared with prompting LLMs. SGCode is available at: https://sgcode.codes/.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑