arXiv:2511.04215cs.CRcs.CL2025-11

破解大模型安全护栏,用强化学习逆向提取其过滤规则。

Black-Box Guardrail Reverse-engineering Attack

  • 用遗传算法生成对抗样本,通过迭代优化逼近护栏决策逻辑。
  • 在三款商用模型上实现超92%规则匹配率,成本低于85美元。
  • 揭示现有安全机制漏洞,适合安全研究人员与模型开发者参考。

大型语言模型(LLMs)越来越多地使用护栏来强制执行伦理、法律及应用特定的输出约束。尽管有效缓解有害响应,这些护栏通过暴露可观察的决策模式引入了新一类漏洞。本文首次研究黑盒大模型护栏逆向工程攻击,提出基于强化学习的护栏逆向攻击(GRA)框架,利用遗传算法驱动的数据增强来近似目标护栏的决策策略。通过迭代收集输入-输出对,优先处理分歧案例,并施加定向突变和交叉操作,该方法逐步逼近高保真度的受害者护栏代理模型。我们在三款广泛部署的商用系统(ChatGPT、DeepSeek、Qwen3)上评估GRA,结果表明其规则匹配率超过0.92,且API成本低于85美元。这些发现证实了护栏提取的实际可行性,凸显当前大模型安全机制的重大风险。研究揭示了现有护栏设计的关键漏洞,强调了在大模型部署中亟需更鲁棒的防御机制。

原文摘要 · Abstract (English)

Large language models (LLMs) increasingly employ guardrails to enforce ethical, legal, and application-specific constraints on their outputs. While effective at mitigating harmful responses, these guardrails introduce a new class of vulnerabilities by exposing observable decision patterns. In this work, we present the first study of black-box LLM guardrail reverse-engineering attacks. We propose Guardrail Reverse-engineering Attack (GRA), a reinforcement learning-based framework that leverages genetic algorithm-driven data augmentation to approximate the decision-making policy of victim guardrails. By iteratively collecting input-output pairs, prioritizing divergence cases, and applying targeted mutations and crossovers, our method incrementally converges toward a high-fidelity surrogate of the victim guardrail. We evaluate GRA on three widely deployed commercial systems, namely ChatGPT, DeepSeek, and Qwen3, and demonstrate that it achieves an rule matching rate exceeding 0.92 while requiring less than $85 in API costs. These findings underscore the practical feasibility of guardrail extraction and highlight significant security risks for current LLM safety mechanisms. Our findings expose critical vulnerabilities in current guardrail designs and highlight the urgent need for more robust defense mechanisms in LLM deployment.

安全攻防逆向工程大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。