Authors: Shreyash Shirish Kulkarni, Professor Divya Ashok Rahane
Abstract: Large Language Models (LLMs) are increasingly used to generate code from natural-language prompts, but their outputs may reproduce insecure patterns learned from public repositories and may introduce new weaknesses through incomplete validation, unsafe API use, memory errors, or poor resource handling. This paper presents a literature-based analysis of five supplied studies on the security of AI-generated code. It reviews empirical vulnerability measurements across programming languages, formal verification of large C-code datasets, static analysis of incomplete Python snippets, LLM-assisted vulnerability detection and repair, and binary/runtime analysis. The reviewed evidence reports that 49% of ChatGPT-generated and 55.5% of Bard-generated samples were vulnerable in one multi-language study, while at least 62.07% of programs in the FormAI-v2 C dataset were vulnerable. DeVAIC reported 94% F1-score and accuracy for Python snippet detection, whereas a separate C-code study found that conventional tools missed approximately 53.3% of identified AI-code vulnerabilities. These results are not directly comparable because the datasets, languages, tools, and definitions differ. The paper synthesizes the vulnerability handling lifecycle—detection, localization, and repair—and proposes a layered assessment workflow combining pattern-based static analysis, formal verification, dynamic testing, binary inspection, AI-assisted triage, and human approval. The analysis identifies challenges in false positives, incomplete code, context length, structural variation, repair-induced weaknesses, and reproducibility. It concludes that AI-generated code should be treated as untrusted input and independently verified before deployment. No new experiments are conducted; all numerical findings are attributed to the original studies.