REDCODER: a multi-turn red-team framework that induces vulnerabilities in code models
Start here
2026年11月9日,公众号“为机器立心”介绍论文提出的REDCODER框架:它通过攻击者、防御者、评估者和策略分析师的多智能体博弈生成2098段原型对话,提取可复用攻击策略库,再微调Llama3-8B-Instruct作为红队代理,测试时用RAG按局部交互相似度检索策略引导多轮对话,诱导代码大模型生成含漏洞代码。在覆盖43种CWE漏洞的170个编码任务上,对CodeLlama-7B、CodeGemma-7B等模型开展测试。
Generated by AI from reports · Updated 15 days ago
Progress timeline
- WeChat · Weijiqi LixinREDCODER: multi-turn automated red team testing framework that precisely uncovers security vulnerabilities in code large models
The paper proposes REDCODER, a red team testing agent that conducts multi-turn conversations with code large models and induces them to generate vulnerable code. The framework first uses a multi-agent game involving an attacker, a defender, an evaluator and a strategy analyst to generate 2098 prototype conversations, extracts a reusable attack strategy library, then fine-tunes Llama3-8B-Instruct as the red team agent; at test time, it retrieves strategies by local interaction similarity via RAG to guide the next round of conversation. On 170 coding tasks covering 43 CWE vulnerability types, the vulnerability rates of CodeLlama-7B, CodeGemma-7B, Qwen2.5-Coder-7B and DeepSeek-R1-Distill-Llama-8B range from 39.41% to 65.29%, higher than baselines such as AutoDAN, GCG, CoA-Feedback and ActorAttack. In defense experiments, single-turn guardrails hardly change the attack results, while multi-turn guardrails reduce the vulnerability rates of the first three models to 20.20%, 25.00% and 54.69% respectively.