CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generation
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have significantly aided developers by generating or assisting in code writing, enhancing productivity across various tasks. While identifying incorrect code is often straightforward, detecting vulnerabilities in functionally correct code is more challenging, especially for developers with limited security knowledge, which poses considerable security risks of using LLM-generated code and underscores the need for robust evaluation benchmarks that assess both functional correctness and security. Current benchmarks like CyberSecEval and SecurityEval attempt to solve it but are hindered by unclear and impractical specifications, failing to assess both functionality and security accurately. To tackle these deficiencies, we introduce CWEval, a novel outcome-driven evaluation framework designed to enhance the evaluation of secure code generation by LLMs. This framework not only assesses code functionality but also its security simultaneously with high-quality task specifications and outcome-driven test oracles which provides high accuracy. Coupled with CWEval-bench, a multilingual, security-critical coding benchmark, CWEval provides a rigorous empirical security evaluation on LLM-generated code, overcoming previous benchmarks' shortcomings. Through our evaluations, CWEval reveals a notable portion of functional but insecure code produced by LLMs, and shows a serious inaccuracy of previous evaluations, ultimately contributing significantly to the field of secure code generation. We open-source our artifact at: https://github.com/Co1lin/CWEval .
Key facts. Cited by 55 papers in the map (data through 7 Oct 2026). Builds on 19 of its 24 references that are in the map. First posted on arXiv 14 Jan 2025.
Builds on
19 of 24 references.
References · 19
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
- 2022Practical Program Repair in the Era of Large Pre-trained Language Modelscited by 133
- 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 130
- 2023Learning Performance-Improving Code Editscited by 103
7 more
- 2024CyberSecEval 2: A Wide-Ranging Cybersecurity Evaluation Suite for Large Language Modelscited by 84
- 2020Code Prediction by Feeding Trees to Transformerscited by 70
- 2024Evaluating Language Models for Efficient Code Generationcited by 69
- 2024Instruction Tuning for Secure Code Generationcited by 63
- 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
- 2020Fast and Memory-Efficient Neural Code Completioncited by 38
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
Built on by
Citing papers per year: 2025: 26; 2026: 29.
55 papers.
Sort:
By area:
- 2026Qwen3-Coder-Next Technical Reportcited by 60
- 2025BaxBench: Can LLMs Generate Correct and Secure Backends?cited by 38
- 2025The Scales of Justitia: A Comprehensive Survey on Safety Evaluation of LLMscited by 24
- 2025Is Vibe Coding Safe? Benchmarking Vulnerability of Agent-Generated Code in Real-World Taskscited by 18
- 2025SafeGenBench: A Benchmark Framework for Security Vulnerability Detection in LLM-Generated Codecited by 17
- 2025PurpCode: Reasoning for Safer Code Generationcited by 17
- 2025SecRepoBench: Benchmarking Code Agents for Secure Code Completion in Real-World Repositoriescited by 14
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 12
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarioscited by 11
- 2025Rethinking the Evaluation of Secure Code Generationcited by 10
- 2025Teaching an Old LLM Secure Coding: Localized Preference Optimization on Distilled Preferencescited by 10
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generationcited by 9
38 more
- 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
- 2025RESCUE: Retrieval Augmented Secure Code Generationcited by 7
- 2026CyberGym-E2E: Scalable Real-World Benchmark for AI Agents' End-to-End Cybersecurity Capabilitiescited by 6
- 2026HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generationcited by 5
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistantscited by 4
- 2025EditLord: Learning Code Transformation Rules for Code Editingcited by 4
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflowscited by 4
- 2025Evaluating LLM Generated Detection Rules in Cybersecuritycited by 4
- 2025Benchmarking Correctness and Security in Multi-Turn Code Generationcited by 4
- 2025AutoBaxBuilder: Bootstrapping Code Security Benchmarkingcited by 4
- 2026Secure Code Generation via Online Reinforcement Learning with Vulnerability Reward Modelcited by 4
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistantscited by 3
- 2025Secure-Instruct: An Automated Pipeline for Synthesizing Instruction-Tuning Datasets Using LLMs for Secure Code Generationcited by 2
- 2026Learning to Generate Secure Code via Token-Level Rewardscited by 2
- 2025Large Language Models for IT Automation Tasks: Are We There Yet?cited by 1
- 2025BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AIcited by 1
- 2025Secure Code Generation at Scale with Reflexioncited by 1
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agentscited by 1
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Softwarecited by 1
- 2026SecCodeBench-V2 Technical Reportcited by 1
- 2026Why LLMs Fail: A Failure Analysis and Partial Success Measurement for Automated Security Patch Generationcited by 1
- 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Modelscited by 1
- 2026SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalizationcited by 1
- 2026Constrained Code Generation with Discrete Diffusioncited by 1
- 2026Enhancing Reliability in LLM-Based Secure Code Generationcited by 1
- 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMscited by 1
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agentscited by 1
- 2025From Model to Breach: Towards Actionable LLM-Generated Vulnerabilities Reportingcited by 0
- 2025TaskEval: Synthesised Evaluation for Foundation-Model Taskscited by 0
- 2026Inference-Time Safety For Code LLMs Via Retrieval-Augmented Revisioncited by 0
- 2026Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanismscited by 0
- 2026A Quasi-Experimental Developer Study of Security Training in LLM-Assisted Web Application Developmentcited by 0
- 2026Activating Latent Security Knowledge through LLM-Guided Risk Analysis for Secure Code Generationcited by 0
- 2026SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forwardcited by 0
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvementscited by 0
- 2026EduPluginBench: Executable Assurance for AI-Generated Educational Pluginscited by 0
- 2026WeSCE: A Benchmark for Measuring Security Drift in LLM-Driven Code Editingcited by 0
- 2026MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaborationcited by 0
50 most cited of 55 All 55 (JSON)
- 2026SecureVibe: Making Vibe Coding More Secure29 Sep 2026
- 2026MobileCybench: Evaluating Agent Vulnerability Discovery via Executable Probes21 Sep 2026
- 2026Reflections on Trusting Trust, Revisited: Contaminating Self-Modifying AI Coding Agents with Poisoned Benchmarks15 Sep 2026
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code11 Sep 2026
- 2026MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaboration26 Aug 2026
- 2026WeSCE: A Benchmark for Measuring Security Drift in LLM-Driven Code Editing15 Aug 2026
- 2026EduPluginBench: Executable Assurance for AI-Generated Educational Plugins1 Aug 2026
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvements29 Jul 2026
- 2026When Passing Tests Hides Vulnerabilities: An Empirical Study of Silent Failures in Agentic Systems25 Jun 2026
- 2026SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forward23 Jun 2026
- 2026Activating Latent Security Knowledge through LLM-Guided Risk Analysis for Secure Code Generation15 Jun 2026
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agents11 Jun 2026
38 more
- 2026CyberGym-E2E: Scalable Real-World Benchmark for AI Agents' End-to-End Cybersecurity Capabilities3 Jun 2026
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistants29 May 2026
- 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMs28 May 2026
- 2026Enhancing Reliability in LLM-Based Secure Code Generation22 May 2026
- 2026Constrained Code Generation with Discrete Diffusion16 May 2026
- 2026A Quasi-Experimental Developer Study of Security Training in LLM-Assisted Web Application Development20 Apr 2026
- 2026SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization4 Apr 2026
- 2026Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanisms11 Mar 2026
- 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Models11 Mar 2026
- 2026Why LLMs Fail: A Failure Analysis and Partial Success Measurement for Automated Security Patch Generation10 Mar 2026
- 2026Inference-Time Safety For Code LLMs Via Retrieval-Augmented Revision2 Mar 2026
- 2026Qwen3-Coder-Next Technical Report28 Feb 2026
- 2026Learning to Generate Secure Code via Token-Level Rewards26 Feb 2026
- 2026SecCodeBench-V2 Technical Report17 Feb 2026
- 2026Secure Code Generation via Online Reinforcement Learning with Vulnerability Reward Model7 Feb 2026
- 2026Extracting Recurring Vulnerabilities from Black-Box LLM-Generated Software2 Feb 2026
- 2026HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generation20 Jan 2026
- 2025AutoBaxBuilder: Bootstrapping Code Security Benchmarking24 Dec 2025
- 2025TaskEval: Synthesised Evaluation for Foundation-Model Tasks4 Dec 2025
- 2025Is Vibe Coding Safe? Benchmarking Vulnerability of Agent-Generated Code in Real-World Tasks2 Dec 2025
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents24 Nov 2025
- 2025From Model to Breach: Towards Actionable LLM-Generated Vulnerabilities Reporting6 Nov 2025
- 2025Secure Code Generation at Scale with Reflexion5 Nov 2025
- 2025RESCUE: Retrieval Augmented Secure Code Generation21 Oct 2025
- 2025BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AI20 Oct 2025
- 2025Benchmarking Correctness and Security in Multi-Turn Code Generation13 Oct 2025
- 2025Secure-Instruct: An Automated Pipeline for Synthesizing Instruction-Tuning Datasets Using LLMs for Secure Code Generation8 Oct 2025
- 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agents2 Oct 2025
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarios26 Sep 2025
- 2025Evaluating LLM Generated Detection Rules in Cybersecurity20 Sep 2025
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Code25 Aug 2025
- 2025PurpCode: Reasoning for Safer Code Generation25 Jul 2025
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflows8 Jun 2025
- 2025The Scales of Justitia: A Comprehensive Survey on Safety Evaluation of LLMs6 Jun 2025
- 2025SafeGenBench: A Benchmark Framework for Security Vulnerability Detection in LLM-Generated Code6 Jun 2025
- 2025Teaching an Old LLM Secure Coding: Localized Preference Optimization on Distilled Preferences31 May 2025
- 2025Large Language Models for IT Automation Tasks: Are We There Yet?26 May 2025
- 2025SecRepoBench: Benchmarking Code Agents for Secure Code Completion in Real-World Repositories29 Apr 2025
50 newest of 55 All 55 (JSON)
- 2026Qwen3-Coder-Next Technical Reportcited by 60
- 2025Is Vibe Coding Safe? Benchmarking Vulnerability of Agent-Generated Code in Real-World Taskscited by 18
- 2025SecRepoBench: Benchmarking Code Agents for Secure Code Completion in Real-World Repositoriescited by 14
- 2025SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarioscited by 11
- 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
- 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflowscited by 4
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistantscited by 3
- 2025BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AIcited by 1
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agentscited by 1
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agentscited by 1
- 2026SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forwardcited by 0
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvementscited by 0
12 most cited of 16 All 16 (JSON)
- 2026MobileCybench: Evaluating Agent Vulnerability Discovery via Executable Probes21 Sep 2026
- 2026Reflections on Trusting Trust, Revisited: Contaminating Self-Modifying AI Coding Agents with Poisoned Benchmarks15 Sep 2026
- 2026MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaboration26 Aug 2026
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvements29 Jul 2026
- 2026When Passing Tests Hides Vulnerabilities: An Empirical Study of Silent Failures in Agentic Systems25 Jun 2026
- 2026SoK: AI Secure Code Generation: Progress, Pitfalls, and Paths Forward23 Jun 2026
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agents11 Jun 2026
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistants29 May 2026
- 2026Qwen3-Coder-Next Technical Report28 Feb 2026
- 2025Is Vibe Coding Safe? Benchmarking Vulnerability of Agent-Generated Code in Real-World Tasks2 Dec 2025
- 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents24 Nov 2025
- 2025BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AI20 Oct 2025
12 newest of 16 All 16 (JSON)
- 2026Constrained Code Generation with Discrete Diffusioncited by 1
- 2026Constrained Code Generation with Discrete Diffusion16 May 2026
- 2025BaxBench: Can LLMs Generate Correct and Secure Backends?cited by 38
- 2025The Scales of Justitia: A Comprehensive Survey on Safety Evaluation of LLMscited by 24
- 2025SafeGenBench: A Benchmark Framework for Security Vulnerability Detection in LLM-Generated Codecited by 17
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 12
- 2025Rethinking the Evaluation of Secure Code Generationcited by 10
- 2026CyberGym-E2E: Scalable Real-World Benchmark for AI Agents' End-to-End Cybersecurity Capabilitiescited by 6
- 2026HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generationcited by 5
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistantscited by 4
- 2025EditLord: Learning Code Transformation Rules for Code Editingcited by 4
- 2025Evaluating LLM Generated Detection Rules in Cybersecuritycited by 4
- 2025Benchmarking Correctness and Security in Multi-Turn Code Generationcited by 4
- 2026Learning to Generate Secure Code via Token-Level Rewardscited by 2
12 most cited of 29 All 29 (JSON)
- 2026SecureVibe: Making Vibe Coding More Secure29 Sep 2026
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code11 Sep 2026
- 2026WeSCE: A Benchmark for Measuring Security Drift in LLM-Driven Code Editing15 Aug 2026
- 2026EduPluginBench: Executable Assurance for AI-Generated Educational Plugins1 Aug 2026
- 2026Activating Latent Security Knowledge through LLM-Guided Risk Analysis for Secure Code Generation15 Jun 2026
- 2026CyberGym-E2E: Scalable Real-World Benchmark for AI Agents' End-to-End Cybersecurity Capabilities3 Jun 2026
- 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMs28 May 2026
- 2026Enhancing Reliability in LLM-Based Secure Code Generation22 May 2026
- 2026A Quasi-Experimental Developer Study of Security Training in LLM-Assisted Web Application Development20 Apr 2026
- 2026Security-by-Design for LLM-Based Code Generation: Leveraging Internal Representations for Concept-Driven Steering Mechanisms11 Mar 2026
- 2026TOSSS: a CVE-based Software Security Benchmark for Large Language Models11 Mar 2026
- 2026Why LLMs Fail: A Failure Analysis and Partial Success Measurement for Automated Security Patch Generation10 Mar 2026
12 newest of 29 All 29 (JSON)