RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agents
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 1 more
Abstract (arXiv)
Code agents have gained widespread adoption due to their strong code generation capabilities and integration with code interpreters, enabling dynamic execution, debugging, and interactive programming capabilities. While these advancements have streamlined complex workflows, they have also introduced critical safety and security risks. Current static safety benchmarks and red-teaming tools are inadequate for identifying emerging real-world risky scenarios, as they fail to cover certain boundary conditions, such as the combined effects of different jailbreak tools. In this work, we propose RedCodeAgent, the first automated red-teaming agent designed to systematically uncover vulnerabilities in diverse code agents. With an adaptive memory module, RedCodeAgent can leverage existing jailbreak knowledge, dynamically select the most effective red-teaming tools and tool combinations in a tailored toolbox for a given input query, thus identifying vulnerabilities that might otherwise be overlooked. For reliable evaluation, we develop simulated sandbox environments to additionally evaluate the execution results of code agents, mitigating potential biases of LLM-based judges that only rely on static code. Through extensive evaluations across multiple state-of-the-art code agents, diverse risky scenarios, and various programming languages, RedCodeAgent consistently outperforms existing red-teaming methods, achieving higher attack success rates and lower rejection rates with high efficiency. We further validate RedCodeAgent on real-world code assistants, e.g., Cursor and Codeium, exposing previously unidentified security risks. By automating and optimizing red-teaming processes, RedCodeAgent enables scalable, adaptive, and effective safety assessments of code agents.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 39 of its 48 references that are in the map. First posted on arXiv 2 Oct 2025.
Builds on
39 of 48 references.
Closest ancestors · 9
Same direction, newest first
- 2025RedTeamCUA: Realistic Adversarial Testing of Computer-Use Agents in Hybrid Web-OS Environments28 May
- 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct
- 2024EIA: Environmental Injection Attack on Generalist Web Agents for Privacy Leakage17 Sep
- 2024RedAgent: Red Teaming Large Language Models with Context-aware Autonomous Language Agent23 Jul
- 2024AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases17 Jul
- 2024LLM Agents can Autonomously Exploit One-day Vulnerabilities11 Apr
- 2024R-Judge: Benchmarking Safety Risk Awareness for LLM Agents18 Jan
- 2023Testing Language Model Agents Safely in the Wild17 Nov
- 2023Identifying the Risks of LM Agents with an LM-Emulated Sandbox25 Sep
Other references · 30
- 2023GPT-4 Technical Reportcited by 18,396
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Qwen Technical Reportcited by 3,344
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
- 2023The Rise and Potential of Large Language Model Based Agents: A Surveycited by 1,439
- 2023AgentBench: Evaluating LLMs as Agentscited by 1,267
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 785
- 2024Executable Code Actions Elicit Better LLM Agentscited by 564
18 more
- 2023GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Promptscited by 560
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 364
- 2024OpenCodeInterpreter: Integrating Code Generation with Execution and Refinementcited by 247
- 2024Jailbreak Attacks and Defenses Against Large Language Models: A Surveycited by 230
- 2024AmpleGCG: Learning a Universal and Transferable Generative Model of Adversarial Suffixes for Jailbreaking Both Open and Closed LLMscited by 172
- 2024AdvPrompter: Fast Adaptive Adversarial Prompting for LLMscited by 156
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 155
- 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 138
- 2024CyberSecEval 2: A Wide-Ranging Cybersecurity Evaluation Suite for Large Language Modelscited by 89
- 2024JailbreakZoo: Survey, Landscapes, and Horizons in Jailbreaking Large Language and Vision-Language Modelscited by 70
- 2023TrojanPuzzle: Covertly Poisoning Code-Suggestion Modelscited by 60
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 59
- 2023CodeLMSec Benchmark: Systematically Evaluating and Finding Security Vulnerabilities in Black-Box Code Language Modelscited by 55
- 2022CodeAttack: Code-Based Adversarial Attacks for Pre-trained Programming Language Modelscited by 53
- 2024HAICOSYSTEM: An Ecosystem for Sandboxing Safety Risks in Human-AI Interactionscited by 44
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 33
- 2024RMCBench: Benchmarking Large Language Models' Resistance to Malicious Codecited by 28
Built on by
Citing papers per year: 2025: 2; 2026: 7.
9 papers.
- 2026MUZZLE: Adaptive Agentic Red-Teaming of Web Agents Against Indirect Prompt Injection Attackscited by 21
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025Your Harness is Not Secure: Benchmarking Real-world Threat of Command Line Interface Agentcited by 5
- 2026Proteus: A Self-Evolving Red Team for Agent Skill Ecosystemscited by 2
- 2026Trust No Tool: Evaluating and Defending LLM Agents under Untrusted Tool Feedbackcited by 2
- 2026AJAR: Adaptive Jailbreak Architecture for Red-teamingcited by 1
- 2026Model-Agnostic Lifelong LLM Safety via Externalized Attack-Defense Co-Evolutioncited by 0
- 2026Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Codecited by 0
- 2026RedEvoAgent: Automatic Red-Teaming Agent with Experience-Driven Skill Evolutioncited by 0
- 2026RedEvoAgent: Automatic Red-Teaming Agent with Experience-Driven Skill Evolution27 Aug 2026
- 2026Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Code10 Jun 2026
- 2026Trust No Tool: Evaluating and Defending LLM Agents under Untrusted Tool Feedback17 May 2026
- 2026Model-Agnostic Lifelong LLM Safety via Externalized Attack-Defense Co-Evolution13 May 2026
- 2026Proteus: A Self-Evolving Red Team for Agent Skill Ecosystems12 May 2026
- 2026MUZZLE: Adaptive Agentic Red-Teaming of Web Agents Against Indirect Prompt Injection Attacks9 Feb 2026
- 2026AJAR: Adaptive Jailbreak Architecture for Red-teaming16 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Your Harness is Not Secure: Benchmarking Real-world Threat of Command Line Interface Agent8 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2024RedCode: Risky Code Execution and Generation Benchmark for Code Agents
- 2025Red-Teaming Coding Agents from a Tool-Invocation Perspective: An Empirical Security Assessment
- 2025BlueCodeAgent: A Blue Teaming Agent Enabled by Automated Red Teaming for CodeGen AI
- 2026Execution-Grounded Security Testing for Coding Agents in Software Engineering Pipelines
- 2025RedCoder: Automated Multi-Turn Red Teaming for Code LLMs
- 2026MonitoringBench: Semi-Automated Red-Teaming for Agent Monitoring
- 2026REDAgentBench: Executable Red Teaming and Faithful Measurement of LLM Agent Systems
- 2026Agent Hacks Agent: Autoresearch for Production-Agent Red-Teaming