English

Security of LLM-generated Code: A Comparative Analysis

Software Engineering 2026-05-25 v1 Artificial Intelligence Cryptography and Security

Abstract

The majority of software developers use or are planning to use Artificial Intelligence (AI) tools in their development processes. Their top reasons include improving productivity and faster learning. In fact, Large Language Model (LLM)-generated code is currently in production, including in major tech companies. However, concerns were raised about the risks associated with the use of AI tools to generate code. In this paper, we focus our attention on the risks to software security. We empirically evaluate the security of code generated by seven popular LLMs. We build upon previous work to mimic the behaviours of developers when using LLMs to generate code. Our results show that all seven LLMs that we have evaluated generate code that contains vulnerabilities, the majority of which are of critical or high severity.

Keywords

Cite

@article{arxiv.2605.23091,
  title  = {Security of LLM-generated Code: A Comparative Analysis},
  author = {Srivathsan G Morkonda and Mahmoud Selim and Hala Assal},
  journal= {arXiv preprint arXiv:2605.23091},
  year   = {2026}
}