paper-with-me

Papers

SecRepoBench: Benchmarking LLMs for Secure Code Generation in Real-World Repositories

2025-04-29 · Connor Dilgren, Purva Chiniya, Luke Griffith, Yu Ding, Yizheng Chen

This paper introduces SecRepoBench, a benchmark to evaluate LLMs on secure code generation in real-world repositories. SecRepoBench has 318 code generation tasks in 27 C/C++ repositories, covering 15 CWEs. We evaluate 19 state-of-the-art LLMs using our benchmark and find that the models struggle with generating correct and secure code. In addition, the performance of LLMs to generate self-contained programs as measured by prior benchmarks do not translate to comparative performance at generating secure and correct code at the repository level in SecRepoBench. We show that the state-of-the-art prompt engineering techniques become less effective when applied to the repository level secure code generation problem. We conduct extensive experiments, including an agentic technique to generate secure code, to demonstrate that our benchmark is currently the most difficult secure coding benchmark, compared to previous state-of-the-art benchmarks. Finally, our comprehensive analysis provides insights into potential directions for enhancing the ability of LLMs to generate correct and secure code in real-world repositories.

📄 PDF Abstract BibTeX arXiv:2504.21205

Code (0)

등록된 구현이 없습니다.

Tasks

BenchmarkingCode GenerationPrompt Engineering

Similar Papers 제목 키워드 기반

DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents

2025-11-24 · Rupam Patir, Keyan Guo, Suvadra Barua, Abhijeet Pathak 외 arxiv

Large language models (LLMs) and LLM-based coding agents are now used to generate code from natural-language specifications, yet ensuring such code is both functionally correct and secure remains a challenge. We present …

Code Generation

Constrained Decoding for Secure Code Generation

2024-04-30 · Yanjun Fu, Ethan Baker, Yu Ding, Yizheng Chen

Code Large Language Models (Code LLMs) have been increasingly used by developers to boost productivity, but they often generate vulnerable code. Thus, there is an urgent need to ensure that code generated by Code LLMs is…

Code Generation

SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forward

2026-06-23 · Rupam Patir, Keyan Guo, Haipeng Cai, Hongxin Hu arxiv

The increasing use of AI systems for code generation raises a central security question: what can today's models and coding agents actually do to produce secure code, where do they still fail, and what would move the fie…

Reinforcement LearningCode Generation

PromSec: Prompt Optimization for Secure Generation of Functional Source Code with Large Language Models (LLMs)

2024-09-19 · Mahmoud Nazzal, Issa Khalil, Abdallah Khreishah, NhatHai Phan

The capability of generating high-quality source code using large language models (LLMs) reduces software development time and costs. However, they often introduce security vulnerabilities due to training on insecure ope…

Code GenerationContrastive LearningGraph Neural Network

Prompting Techniques for Secure Code Generation: A Systematic Investigation

2024-07-09 · Catherine Tony, Nicolás E. Díaz Ferreyra, Markus Mutas, Salem Dhiff 외

Large Language Models (LLMs) are gaining momentum in software development with prompt-driven programming enabling developers to create code from natural language (NL) instructions. However, studies have questioned their …

Code GenerationSystematic Literature Review