Do Users Write More Insecure Code with AI Assistants?

Neil Perry, Megha Srivastava, Deepak Kumar, Dan Boneh
11/7/2022
cs.CR

Official code: NeilAPerry/Do-Users-Write-More-Insecure-Code-with-AI-Assistants (13 stars, JavaScript, MIT, last commit 2024-04-11).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

Repository containing the UI and anonymized participant data for "Do Users Write More Insecure Code with AI Assistants?"

136JavaScript, PythonSep 6, 20232 years agoMIT

Similar Papers

Cite this paper

@article{perry2022users,
  title  = {Do Users Write More Insecure Code with AI Assistants?},
  author = {Neil Perry and Megha Srivastava and Deepak Kumar and Dan Boneh},
  year   = {2022},
  eprint = {2211.03622},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.03622}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2211.03622.svg)](https://codeofpaper.com/paper/2211.03622)

Discussion