paper-with-me

Papers

SecureForge: Finding and Preventing Vulnerabilities in LLM-Generated Code via Prompt Optimization

2026-05-08 · Houjun Liu, Lisa Einstein, John Yang, Joachim Baumann, Duncan Eddy, Christopher D. Manning, Mykel Kochenderfer, Diyi Yang arxiv

LLM coding agents now generate code at an unprecedented scale, yet LLM-generated code introduces cybersecurity vulnerabilities into codebases without human involvement. Even when frontier models are explicitly asked to write secure production code with relevant weaknesses to avoid in context, we find that they still produce verifiable vulnerabilities on average 23% of the time across a corpus of 250 benign coding prompts. We introduce SecureForge, an automated pipeline that both audits security risks of frontier models and produces auditing-informed secure system prompts that reduce output security vulnerabilities while maintaining unit test performance. SecureForge first identifies benign prompts that produce statically detectable vulnerabilities, and then amplifies them into a large synthetic prompt corpus of diverse scenarios using a Markovian sampling technique to jointly maintain error rates and prompt diversity. This corpus is then used to iteratively optimize the system prompts to reduce output security vulnerabilities. On frontier models, SecureForge yields a statistically significant Pareto improvement in both unit test success and output security, with output vulnerabilities reduced by up to 48%. The resulting system prompts transfer zero-shot to in-the-wild coding agent prompts, without any exposure to real user prompt distributions during optimization.

📄 PDF Abstract BibTeX arXiv:2605.08382

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Just another copy and paste? Comparing the security vulnerabilities of ChatGPT generated code and StackOverflow answers

2024-03-22 · Sivana Hamer, Marcelo d'Amorim, Laurie Williams

Sonatype's 2023 report found that 97% of developers and security leads integrate generative Artificial Intelligence (AI), particularly Large Language Models (LLMs), into their development process. Concerns about the secu…

LLM-CSEC: Empirical Evaluation of Security in C/C++ Code Generated by Large Language Models

2025-11-24 · Muhammad Usman Shahid, Chuadhry Mujeeb Ahmed, Rajiv Ranjan arxiv

The security of code generated by large language models (LLMs) is a significant concern, as studies indicate that such code often contains vulnerabilities and lacks essential defensive programming constructs. This work f…

Code Generation

Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Software

2026-02-02 · Tomer Kordonsky, Amit LeVi, Maayan Yamin, Noam Benzimra 외 arxiv

LLMs are increasingly used for code generation, but their outputs often follow recurring templates that can induce predictable vulnerabilities. We study vulnerability persistence in LLM-generated software and introduce F…

Code Generation

Just-in-Time Detection of Silent Security Patches

2023-12-02 · Xunzhu Tang, Zhenghan Chen, Kisub Kim, Haoye Tian 외

Open-source code is pervasive. In this setting, embedded vulnerabilities are spreading to downstream software at an alarming rate. While such vulnerabilities are generally identified and addressed rapidly, inconsistent m…

Contrastive LearningData AugmentationRepresentation Learning

Taught by the Flawed: How Dataset Insecurity Breeds Vulnerable AI Code

2025-11-13 · Catherine Xia, Manar H. Alalfi arxiv

AI programming assistants have demonstrated a tendency to generate code containing basic security vulnerabilities. While developers are ultimately responsible for validating and reviewing such outputs, improving the inhe…