arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2211.03622cs.CR
收藏

用户使用AI助手时会写出更多不安全的代码吗?

Do Users Write More Insecure Code with AI Assistants?

Neil Perry, Megha Srivastava, Deepak Kumar, Dan Boneh

AI总结:

该研究通过大规模用户实验发现,使用基于codex-davinci-002的AI代码助手的用户写出的代码安全性更低却更自信,而低信任度、优化提示词的用户漏洞更少,同时公开了研究用界面以支持后续相关研究。

摘要:

我们开展了首项大规模用户研究,考察用户如何与AI代码助手交互,以解决不同编程语言下的各类安全相关任务。总体而言,我们发现能使用基于OpenAI的codex-davinci-002模型的AI助手的参与者,写出的代码安全性显著低于无法使用该助手的参与者。此外,能使用AI助手的参与者比无法使用的参与者更倾向于认为自己写出的代码是安全的。进一步而言,我们发现对AI信任度较低、且更多琢磨提示词的语言与格式(例如改写提示、调整temperature参数)的参与者,提交的代码安全漏洞更少。最后,为更好地为未来基于AI的代码助手设计提供参考,我们对参与者的语言使用与交互行为进行了深入分析,同时公开了我们的用户界面,作为未来开展类似研究的工具。

英文摘要:

We conduct the first large-scale user study examining how users interact with an AI Code assistant to solve a variety of security related tasks across different programming languages. Overall, we find that participants who had access to an AI assistant based on OpenAI's codex-davinci-002 model wrote significantly less secure code than those without access. Additionally, participants with access to an AI assistant were more likely to believe they wrote secure code than those without access to the AI assistant. Furthermore, we find that participants who trusted the AI less and engaged more with the language and format of their prompts (e.g. re-phrasing, adjusting temperature) provided code with fewer security vulnerabilities. Finally, in order to better inform the design of future AI-based Code assistants, we provide an in-depth analysis of participants' language and interaction behavior, as well as release our user interface as an instrument to conduct similar studies in the future.

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

↑