paper-with-me

홈 › Papers

RedCode: Risky Code Execution and Generation Benchmark for Code Agents

2024-11-12 · Chengquan Guo, Xun Liu, Chulin Xie, Andy Zhou, Yi Zeng, Zinan Lin, Dawn Song, Bo Li

With the rapidly increasing capabilities and adoption of code agents for AI-assisted coding, safety concerns, such as generating or executing risky code, have become significant barriers to the real-world deployment of these agents. To provide comprehensive and practical evaluations on the safety of code agents, we propose RedCode, a benchmark for risky code execution and generation: (1) RedCode-Exec provides challenging prompts that could lead to risky code execution, aiming to evaluate code agents' ability to recognize and handle unsafe code. We provide a total of 4,050 risky test cases in Python and Bash tasks with diverse input formats including code snippets and natural text. They covers 25 types of critical vulnerabilities spanning 8 domains (e.g., websites, file systems). We provide Docker environments and design corresponding evaluation metrics to assess their execution results. (2) RedCode-Gen provides 160 prompts with function signatures and docstrings as input to assess whether code agents will follow instructions to generate harmful code or software. Our empirical findings, derived from evaluating three agent frameworks based on 19 LLMs, provide insights into code agents' vulnerabilities. For instance, evaluations on RedCode-Exec show that agents are more likely to reject executing risky operations on the operating system, but are less likely to reject executing technically buggy code, indicating high risks. Risky operations described in natural text lead to a lower rejection rate than those in code format. Additionally, evaluations on RedCode-Gen show that more capable base models and agents with stronger overall coding abilities, such as GPT4, tend to produce more sophisticated and effective harmful software. Our findings highlight the need for stringent safety evaluations for diverse code agents. Our dataset and code are available at https://github.com/AI-secure/RedCode.

📄 PDF Abstract BibTeX arXiv:2411.07781

Code (1)

ai-secure/redcode 공식 구현

Methods 이 논문이 사용한 방법론

BASE 설명 없음

Similar Papers 제목 키워드 기반

RedCoder: Automated Multi-Turn Red Teaming for Code LLMs

2025-06-25 · Wenjie Jacky Mo, Qin Liu, Xiaofei Wen, Dongwon Jung 외 arxiv

Large Language Models (LLMs) for code generation (i.e., Code LLMs) have demonstrated impressive capabilities in AI-assisted software development and testing. However, recent studies have shown that these models are prone…

Code GenerationRed Teaming

Retrieval Augmented Code Generation and Summarization

2021-08-26 · Findings (EMNLP) 2021 11 · Md Rizwan Parvez, Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray 외

Software developers write a lot of source code and documentation during software development. Intrinsically, developers often recall parts of source code or code summaries that they had written in the past while implemen…

Code GenerationCode SummarizationRetrieval

STELP: Secure Transpilation and Execution of LLM-Generated Programs

2026-01-09 · Swapnil Shinde, Sahil Wadhwa, Andy Luo, Akshay Gupta 외 arxiv

Rapid evolution of Large Language Models (LLMs) has achieved major advances in reasoning, planning, and function-calling capabilities. Multi-agentic collaborative frameworks using such LLMs place them at the center of so…

Code Generation

Running in CIRCLE? A Simple Benchmark for LLM Code Interpreter Security

2025-07-25 · Gabriel Chua arxiv

As large language models (LLMs) increasingly integrate native code interpreters, they enable powerful real-time execution capabilities, substantially expanding their utility. However, such integrations introduce potentia…

Right Family, Wrong Skill: Benchmarking Risk Exposure in Agent Skill Retrieval

2026-06-09 · Jiandong Ding arxiv

Agent skill libraries are becoming routable software assets: a retrieved skill can contribute instructions, scripts, resource bindings, and execution assumptions to an agent. This makes retrieval failures more specific t…