mlsanityData to 14 Oct 2026

Secure Code Generation at Scale with Reflexion

arXiv 2511.03898 ↗First posted 5 Nov 2025cs.CR cs.AI cs.CEcited by 1

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) are now widely used to draft and refactor code, but code that works is not necessarily secure. We evaluate secure code generation using the Instruct Prime, which eliminated compliance-required prompts and cue contamination, and evaluate five instruction-tuned code LLMs using a zero-shot baseline and a three-round reflexion prompting approach. Security is measured using the Insecure Code Detector (ICD), and results are reported by measuring Repair, Regression, and NetGain metrics, considering the programming language and CWE family. Our findings show that insecurity remains common at the first round: roughly 25-33% of programs are insecure at a zero-shot baseline (t0 ). Weak cryptography/config-dependent bugs are the hardest to avoid while templated ones like XSS, code injection, and hard-coded secrets are handled more reliably. Python yields the highest secure rates; C and C# are the lowest, with Java, JS, PHP, and C++ in the middle. Reflexion prompting improves security for all models, improving average accuracy from 70.74% at t0 to 79.43% at t3 , with the largest gains in the first round followed by diminishing returns. The trends with Repair, Regression, and NetGain metrics show that applying one to two rounds produces most of the benefits. A replication package is available at https://doi.org/10.5281/zenodo.17065846.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 24 of its 31 references that are in the map. First posted on arXiv 5 Nov 2025.

Builds on

24 of 31 references.

References · 24

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  2. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  3. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  4. 2023A Survey of Large Language Modelscited by 2,576
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  6. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  7. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  8. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  9. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
  10. 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 138
  11. 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 130
  12. 2024CyberSecEval 2: A Wide-Ranging Cybersecurity Evaluation Suite for Large Language Modelscited by 89
12 more
  1. 2024Can Language Models Solve Olympiad Programming?cited by 72
  2. 2023Evaluating the Code Quality of AI-Assisted Code Generation Tools: An Empirical Study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPTcited by 71
  3. 2023LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluationscited by 62
  4. 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 59
  5. 2023CodeLMSec Benchmark: Systematically Evaluating and Finding Security Vulnerabilities in Black-Box Code Language Modelscited by 55
  6. 2024Constrained Decoding for Secure Code Generationcited by 37
  7. 2024Toward Secure Code Generation: Bridging Correctness and Security via Task-Adaptive Vulnerability Modeling and Execution-Based Benchmarkingcited by 27
  8. 2024Prompting in the Wild: An Empirical Study of Prompt Evolution in Software Repositoriescited by 18
  9. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 10
  10. 2024PromptSet: A Programmer's Prompting Datasetcited by 9
  11. 2024How Propense Are Large Language Models at Producing Code Smells? A Benchmarking Studycited by 6
  12. 2024Rethinking CyberSecEval: An LLM-Aided Approach to Evaluation Critiquecited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.