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 代码助理互动,以解决不同编程语言的各种与安全有关的任务。总的来说,我们发现,根据OpenAI的代码-davinci-002模型获得AI助理帮助的参与者所写的代码安全程度大大低于无法访问的参与者。此外,与无法接触AI 助理的参与者相比,接触AI 助理的参与者更可能认为他们写了安全代码。此外,我们发现,信任AI的参与者较少,他们更多地使用其提示语言和格式(如重新划线、调整温度),他们提供的代码安全性较弱。最后,为了更好地为未来AI 代码助理的设计提供信息,我们对参与者的语言和互动行为进行深入分析,并发布我们的用户界面,作为今后进行类似研究的工具。