Can LLM Agents Program Model Safety? Exploring Autonomous Safety Control in Weight Space
Can LLM Agents Program Model Safety? Exploring Autonomous Safety Control in Weight Space
Junchi Chen, Changtao Miao, Zhenchao Jin, Yuxiao Xiang, Kaichao Jiang, Haojie Yuan, Qi Chu, Tao Gong, Nenghai Yu
AbstractSafety alignment in large language models remains fragile under parameter changes. While existing weight interventions rely on researcher-designed procedures, open weights and code execution enable LLM agents to autonomously explore target-specific edits. We investigate whether general-purpose agents can autonomously modify a model's safety behavior via gradient-free weight interventions while preserving normal task capabilities. We propose Autonomous Safety Control, a reusable framework built around a closed-loop hypothesize-experiment-analyze-decide cycle in weight space. Guided by development and validation feedback, agents formulate testable hypotheses, select parent checkpoints across a branching candidate lineage, construct targeted edits alongside matched random controls, and iteratively revise strategies before freezing a final candidate. We evaluate our framework across multiple agent harnesses, editing LLMs, and target models on standard safety and utility benchmarks. Applied to safety-alignment weakening on Qwen3.5-2B, our framework raises HarmBench harmfulness from 8.81% to 85.53% with only a 0.85% mean capability drop, outperforming static baselines, while process ablations confirm closed-loop iteration surpasses open-loop editing and matched random controls. The same workflow weakens alignment on the masked-diffusion LLM LLaDA-8B-Instruct, compromises adversarial concept erasure on Stable Diffusion v1.4, and restores safety on weakened models without original weights or edit diffs, demonstrating effective bidirectional safety control with limited capability loss.