RedCoder: Automated multi-turn red teaming for code large language modelsRedCoder: Automated Multi-Turn Red Teaming for Code LLMs
The researchers propose RedCoder, an automated red-teaming agent that induces code large language models to generate vulnerable code through multi-turn dialogue. The method first uses a multi-agent game process to simulate adversarial interactions, obtaining prototype dialogues and a reusable library of attack strategies, then fine-tunes a large language model as the backbone on the prototype dialogues; after deployment, RedCoder autonomously conducts multi-turn dialogues with the target model, dynamically retrieves relevant strategies, and steers the dialogue toward outputs that produce vulnerable code. Experiments on multiple code large language models show that the method outperforms existing single-turn and multi-turn red-teaming methods in inducing vulnerable code generation, and can serve as a scalable tool for evaluating the security boundaries of modern code generation systems.