mlsanityData to 7 Oct 2026

RMCBench: Benchmarking Large Language Models' Resistance to Malicious Code

arXiv 2409.15154 ↗First posted 23 Sep 2024cs.SE cs.AIcited by 27

On the map: LLM safety and security → Jailbreaking

Abstract (arXiv)

The emergence of Large Language Models (LLMs) has significantly influenced various aspects of software development activities. Despite their benefits, LLMs also pose notable risks, including the potential to generate harmful content and being abused by malicious developers to create malicious code. Several previous studies have focused on the ability of LLMs to resist the generation of harmful content that violates human ethical standards, such as biased or offensive content. However, there is no research evaluating the ability of LLMs to resist malicious code generation. To fill this gap, we propose RMCBench, the first benchmark comprising 473 prompts designed to assess the ability of LLMs to resist malicious code generation. This benchmark employs two scenarios: a text-to-code scenario, where LLMs are prompted with descriptions to generate code, and a code-to-code scenario, where LLMs translate or complete existing malicious code. Based on RMCBench, we conduct an empirical study on 11 representative LLMs to assess their ability to resist malicious code generation. Our findings indicate that current LLMs have a limited ability to resist malicious code generation with an average refusal rate of 40.36% in text-to-code scenario and 11.52% in code-to-code scenario. The average refusal rate of all LLMs in RMCBench is only 28.71%; ChatGPT-4 has a refusal rate of only 35.73%. We also analyze the factors that affect LLMs' ability to resist malicious code generation and provide implications for developers to enhance model robustness.

Key facts. Cited by 27 papers in the map (data through 7 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 39 of its 66 references that are in the map. First posted on arXiv 23 Sep 2024.

Builds on

39 of 66 references.

Closest ancestors · 3

Same direction, newest first

  1. 2023GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Prompts19 Sep
  2. 2023Jailbroken: How Does LLM Safety Training Fail?5 Jul
  3. 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Study23 May

Other references · 36

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2022Training language models to follow instructions with human feedbackcited by 15,712
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  5. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  6. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  7. 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
  8. 2021Program Synthesis with Large Language Modelscited by 3,509
  9. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  10. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
  11. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  12. 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,023
24 more
  1. 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Datasetcited by 828
  2. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  3. 2023DecodingTrust: A Comprehensive Assessment of Trustworthiness in GPT Modelscited by 505
  4. 2023Zephyr: Direct Distillation of LM Alignmentcited by 498
  5. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  6. 2023Large Language Model Alignment: A Surveycited by 241
  7. 2023Camels in a Changing Climate: Enhancing LM Adaptation with Tulu 2cited by 227
  8. 2023ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI Conversationcited by 224
  9. 2023Evaluating the Moral Beliefs Encoded in LLMscited by 211
  10. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
  11. 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
  12. 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
  13. 2022GitHub Copilot AI pair programmer: Asset or Liability?cited by 150
  14. 2022Few-shot training LLMs for project-specific code-summarizationcited by 128
  15. 2023Towards an Understanding of Large Language Models in Software Engineering Taskscited by 67
  16. 2024Risk Taxonomy, Mitigation, and Assessment Benchmarks of Large Language Model Systemscited by 63
  17. 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
  18. 2023ICE-Score: Instructing Large Language Models to Evaluate Codecited by 50
  19. 2023Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Studycited by 44
  20. 2024RLCoder: Reinforcement Learning for Repository-Level Code Completioncited by 44
  21. 2023When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We?cited by 42
  22. 2024Identifying Smart Contract Security Issues in Code Snippets from Stack Overflowcited by 8
  23. 2024An Empirical Study on Low-Code Programming using Traditional vs Large Language Model Supportcited by 7
  24. 2024Hyperion: Unveiling DApp Inconsistencies using LLM and Dataflow-Guided Symbolic Executioncited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 15; 2026: 10.

27 papers.

Sort:

By area:

  1. 2025Beyond the Protocol: Unveiling Attack Vectors in the Model Context Protocol (MCP) Ecosystemcited by 17
  2. 2025PurpCode: Reasoning for Safer Code Generationcited by 17
  3. 2025Large Language Model (LLM) for Software Security: Code Analysis, Malware Analysis, Reverse Engineeringcited by 15
  4. 2025An Empirical Study of Agent Developer Practices in AI Agent Frameworkscited by 14
  5. 2024Top General Performance = Top Domain Performance? DomainCodeBench: A Multi-domain Code Generation Benchmarkcited by 13
  6. 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generationcited by 9
  7. 2025LLMs Caught in the Crossfire: Malware Requests and Jailbreak Challengescited by 9
  8. 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
  9. 2025Breaking the Code: Security Assessment of AI Code Agents Through Systematic Jailbreaking Attackscited by 7
  10. 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
  11. 2025MOCHA: Are Code Language Models Robust Against Multi-Turn Malicious Coding Prompts?cited by 5
  12. 2024SeCodePLT: A Unified Platform for Evaluating the Security of Code GenAIcited by 4
15 more
  1. 2025Benchmarking AI Models in Software Engineering: A Review, Search Tool, and Unified Approach for Elevating Benchmark Qualitycited by 3
  2. 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
  3. 2026PhoenixRepair: Rethinking Repair Strategy Exploration in Software Agentscited by 2
  4. 2025Web3 x AI Agents: Landscape, Integrations, and Foundational Challengescited by 1
  5. 2025BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AIcited by 1
  6. 2025Exploring the Security Threats of Retriever Backdoors in Retrieval-Augmented Code Generationcited by 1
  7. 2026Overlooked Safety Vulnerability in LLMs: Malicious Intelligent Optimization Algorithm Request and its Jailbreakcited by 1
  8. 2026Refusal Evaluation in Coding LLMs and Code Agents: A Systematic Review of Thirteen Malicious-Code Prompt Corpora (2023-2025)cited by 1
  9. 2025Amazon Nova AI Challenge -- Trusted AI: Advancing secure, AI-assisted software developmentcited by 0
  10. 2025Designing Empirical Studies on LLM-Based Code Generation: Towards a Reference Frameworkcited by 0
  11. 2026JPU: Bridging Jailbreak Defense and Unlearning via On-Policy Path Rectificationcited by 0
  12. 2026Code as a Weapon: A Consensus-Labeled Prompt Bank for Measuring Coding-Model Compliance with Malicious-Code Requestscited by 0
  13. 2026Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Codecited by 0
  14. 2026CS-Guard: Benchmarking LLM Guardrails for Code Generation Securitycited by 0
  15. 2026Generalization Is Stability, Not Accuracy: Multi-Axis Evaluation of LLMscited by 0