paper-with-me

Papers

Benchmarking Prompt Engineering Techniques for Secure Code Generation with GPT Models

2025-02-09 · Marc Bruni, Fabio Gabrielli, Mohammad Ghafari, Martin Kropp

Prompt engineering reduces reasoning mistakes in Large Language Models (LLMs). However, its effectiveness in mitigating vulnerabilities in LLM-generated code remains underexplored. To address this gap, we implemented a benchmark to automatically assess the impact of various prompt engineering strategies on code security. Our benchmark leverages two peer-reviewed prompt datasets and employs static scanners to evaluate code security at scale. We tested multiple prompt engineering techniques on GPT-3.5-turbo, GPT-4o, and GPT-4o-mini. Our results show that for GPT-4o and GPT-4o-mini, a security-focused prompt prefix can reduce the occurrence of security vulnerabilities by up to 56%. Additionally, all tested models demonstrated the ability to detect and repair between 41.9% and 68.7% of vulnerabilities in previously generated code when using iterative prompting techniques. Finally, we introduce a "prompt agent" that demonstrates how the most effective techniques can be applied in real-world development workflows.

📄 PDF Abstract BibTeX arXiv:2502.06039

Code (0)

등록된 구현이 없습니다.

Tasks

BenchmarkingCode GenerationPrompt Engineering

Methods 이 논문이 사용한 방법론

Refunds@Expedia|||How do I get a full refund from Expedia? “How do I get a full refund from Expedia? How do I get a full refund from Expedia? – Call ☎️ +1-(888) 829 (0881) or +1-805-330-4056 or +1-805-330-4056 for Quick Help &…
{Dispute@FaQ-s}How to file a dispute with Expedia? How to file a dispute with Expedia? To file a complaint against Expedia, first try contacting their customer service directly. You can reach them by phone at…
Attention 설명 없음
Cosine Annealing Cosine Annealing is a type of learning rate schedule that has the effect of starting with a large learning rate that is relatively rapidly decreased to a minimum value before…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Multi-Head Attention 설명 없음
Adam 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

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

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

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…

BenchmarkingCode GenerationPrompt Engineering

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

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

SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarios

2025-09-26 · Junkai Chen, Huihui Huang, Yunbo Lyu, Junwen An 외 arxiv

Large language model-powered code agents are rapidly transforming software engineering, yet the security risks of their generated code have become a critical concern. Existing benchmarks have provided valuable insights, …

A Mixture of Linear Corrections Generates Secure Code

2025-07-13 · Weichen Yu, Ravi Mangal, Terry Zhuo, Matt Fredrikson 외 arxiv

Large language models (LLMs) have become proficient at sophisticated code-generation tasks, yet remain ineffective at reliably detecting or avoiding code vulnerabilities. Does this deficiency stem from insufficient learn…