RedCodeAgent:针对多样化代码智能体的自动红队智能体
RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agents
AI总结:
针对代码智能体存在的安全风险及现有静态基准和红队工具的不足,提出首个自动化红队智能体RedCodeAgent,通过自适应记忆模块利用越狱知识,动态选择工具,在模拟沙箱中评估,优于现有方法,暴露真实世界代码助手漏洞。
摘要:
代码智能体因其强大的代码生成能力及与代码解释器的集成而被广泛采用,具备动态执行、调试和交互式编程能力。尽管这些进步简化了复杂工作流程,但也带来了严重的安全风险。当前静态安全基准和红队工具不足以识别新兴的现实世界风险场景,因为它们未能覆盖某些边界条件,例如不同越狱工具的组合效应。在这项工作中,我们提出了RedCodeAgent,这是第一个旨在系统地发现多样化代码智能体中漏洞的自动化红队智能体。通过自适应记忆模块,RedCodeAgent可以利用现有的越狱知识,针对给定的输入查询动态选择定制工具箱中最有效的红队工具,从而识别出可能被忽视的漏洞。为了进行可靠的评估,我们开发了模拟沙箱环境来额外评估代码智能体的执行结果,减轻仅依赖静态代码的基于LLM的评判者的潜在偏见。通过对多个最先进的代码智能体、多样化的风险场景和各种编程语言的广泛评估,RedCodeAgent持续优于现有的红队方法,以高效率实现更高的攻击成功率和更低的拒绝率。我们进一步在真实世界的代码助手(如Cursor和Codeium)上验证了RedCodeAgent,暴露了以前未被发现的安全风险。通过自动化和优化红队流程,RedCodeAgent实现了对代码智能体的可扩展、自适应和有效的安全评估。
英文摘要:
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. Our code and data are available at https://github.com/1mocat/RedCodeAgent.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。