Turning Shields into Swords: Leveraging Safety Policies for LLM Safety Testing
Xiaoyue Lu, XIANGLIN YANG, Haijun Liu, Kuntai Cai, Meiyi An, Jun Yuan, Yan XIAO, Jin Song Dong
ICLR 2026 submission
Abstract. The widespread integration of Large Language Models (LLMs) necessitates robust safety evaluation. However, current paradigms like manual red-teaming and static benchmarks are expensive, non-systematic, and fail to provide verifiable coverage of safety policies. To address these limitations, we introduce a novel framework that brings the rigor of specification-based software testing to AI safety. Our approach systematically generates harmful test cases by first compiling natural-language safety policies into a formal, first-order logic expression. This formal structure is used to construct a semantic graph where violation scenarios manifest as traversable subgraphs. By employing graph sampling, we systematically discover a diverse range of policy violations. These abstract scenarios are then instantiated into concrete, natural language queries using a generator LLM, a process that is automatic and flexibly adaptive to new domains. We demonstrate through experiments that our framework achieves higher policy coverage and generates more effective and interpretable test cases compared to established red-teaming baselines. By bridging formal methods and AI safety, our work provides a principled, scalable, and automated approach to ensuring LLMs adhere to safety-critical policies.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperadd · history
Loading the discussion…