BlueCodeAgent: A Blue Teaming Agent Powered by Automated Red Teaming for CodeGen AI
AspireAI community · arXiv
BlueCodeAgent pairs an automated red-teaming stage with a blue-teaming stage for code-generation AI. The red-teaming component generates diverse risky instances that supply edge cases and guidance, and the blue-teaming agent uses them for multi-level defense through constitution summarization and dynamic code analysis. Across four code-related tasks, bias instruction detection, malicious instruction detection, vulnerable code detection and prompt injection detection, the authors report an average F1 improvement of 14.7% over directly prompting the same model, with GPT-4o as the base. They attribute the gain to the summarization of actionable constitutions and to dynamic analysis, and note it reduces false positives on vulnerability detection, where base models tend to be over-conservative. The paper was accepted at ICML 2026 and the code and data are public.
Read the story and explore more from the AspireAI community.
Two sparse-autoencoder analyses have resisted scaling: matching semantically similar features across layers, and compressing large feature circuits into interpretable supernodes. This paper argues both are the same underlying problem, estimating semantic distances between SAE features that sit on different activation manifolds. Its representation treats each feature not as a single decoder vector but as an activation-weighted distribution over the hidden states expressing it, projects those distributions into a shared reference space, and compares them with Wasserstein distance. The representation is proved invariant to activation rescaling and stable under perturbation, and recovers true matches under finite-sample margin conditions. Empirically it outperformed decoder-vector and LLM-based baselines and captured subtle functional distinctions between related features, and it compressed large feature circuits into interpretable supernodes automatically. The limitation is that this is interpretability tooling: the paper demonstrates better feature matching and circuit compression, not that downstream interpretability claims become more accurate.