Code Red! On the Harmfulness of Applying Off-the-shelf Large Language Models to Programming Tasks
Not on the map. Why?
Abstract (arXiv)
Nowadays, developers increasingly rely on solutions powered by Large Language Models (LLM) to assist them with their coding tasks. This makes it crucial to align these tools with human values to prevent malicious misuse. In this paper, we propose a comprehensive framework for assessing the potential harmfulness of LLMs within the software engineering domain. We begin by developing a taxonomy of potentially harmful software engineering scenarios and subsequently, create a dataset of prompts based on this taxonomy. To systematically assess the responses, we design and validate an automatic evaluator that classifies the outputs of a variety of LLMs both open-source and closed-source models, as well as general-purpose and code-specific LLMs. Furthermore, we investigate the impact of models size, architecture family, and alignment strategies on their tendency to generate harmful content. The results show significant disparities in the alignment of various LLMs for harmlessness. We find that some models and model families, such as Openhermes, are more harmful than others and that code-specific models do not perform better than their general-purpose counterparts. Notably, some fine-tuned models perform significantly worse than their base-models due to their design choices. On the other side, we find that larger models tend to be more helpful and are less likely to respond with harmful information. These results highlight the importance of targeted alignment strategies tailored to the unique challenges of software engineering tasks and provide a foundation for future work in this critical area.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 29 of its 56 references that are in the map. First posted on arXiv 2 Apr 2025.
Builds on
29 of 56 references.
References · 29
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
- 2019Optuna: A Next-generation Hyperparameter Optimization Frameworkcited by 2,501
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
- 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,055
- 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Datasetcited by 860
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2022Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learnedcited by 729
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
- 2023Large Language Model Alignment: A Surveycited by 243
17 more
- 2020Auto-Sklearn 2.0: Hands-free AutoML via Meta-Learningcited by 174
- 2025Emergent Misalignment: Narrow finetuning can produce broadly misaligned LLMscited by 172
- 2020Toward Trustworthy AI Development: Mechanisms for Supporting Verifiable Claimscited by 165
- 2023From ChatGPT to ThreatGPT: Impact of Generative AI in Cybersecurity and Privacycited by 143
- 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 138
- 2022Efficient Few-Shot Learning Without Promptscited by 137
- 2024ALERT: A Comprehensive Benchmark for Assessing Large Language Models' Safety through Red Teamingcited by 98
- 2023Use of LLMs for Illicit Purposes: Threats, Prevention Measures, and Vulnerabilitiescited by 82
- 2023The Art of Defending: A Systematic Evaluation and Analysis of LLM Defense Strategies on Safety and Over-Defensivenesscited by 67
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 50
- 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?cited by 42
- 2024Language Models for Code Completion: A Practical Evaluationcited by 39
- 2024What are human values, and how do we align AI to them?cited by 32
- 2023Extending Source Code Pre-Trained Language Models to Summarise Decompiled Binariescited by 26
- 2023Uncovering and Quantifying Social Biases in Code Generationcited by 25
- 2023The (ab)use of Open Source Code to Train Large Language Modelscited by 10
- 2024Hyperparameter Importance Analysis for Multi-Objective AutoMLcited by 9
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026AgentHazard: A Benchmark for Evaluating Harmful Behavior in Computer-Use Agentscited by 18
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistantscited by 4
- 2026Do Agents Dream of Root Shells? Partial-Credit Evaluation of LLM Agents in Capture the Flag Challengescited by 3
- 2026Model See, Model Do? Exposure-Aware Evaluation of Bug-vs-Fix Preference in Code LLMscited by 1
- 2026Refused in Chat, Written in Code: Workflow-Level Jailbreak Construction in IDE Coding Agentscited by 0
- 2026CIT-CAD: Constraint Intent Tree-based CAD Code Generation and Verificationcited by 0
- 2026CIT-CAD: Constraint Intent Tree-based CAD Code Generation and Verification7 Sep 2026
- 2026Refused in Chat, Written in Code: Workflow-Level Jailbreak Construction in IDE Coding Agents4 Jul 2026
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistants29 May 2026
- 2026Do Agents Dream of Root Shells? Partial-Credit Evaluation of LLM Agents in Capture the Flag Challenges21 Apr 2026
- 2026AgentHazard: A Benchmark for Evaluating Harmful Behavior in Computer-Use Agents3 Apr 2026
- 2026Model See, Model Do? Exposure-Aware Evaluation of Bug-vs-Fix Preference in Code LLMs15 Jan 2026
Similar, not cited
Close in wording, no citation either way
- 2024RMCBench: Benchmarking Large Language Models' Resistance to Malicious Code
- 2024Software Vulnerability and Functionality Assessment using LLMs
- 2025Automated Harmfulness Testing for Code Large Language Models
- 2025When Code Crosses Borders: A Security-Centric Study of LLM-based Code Translation ↗
- 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation
- 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASML
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security
- 2026The Poisoned Chalice of LLM Evaluation Report ↗