A single 7B open-weight safeguard, WildGuard, cuts jailbreak attack success on an unaligned chat model from 79.8% down to 2.4% while keeping false refusals on benign adversarial queries at 0.4%. Trained by Han et al. (AI2, UW, SNU) on WildGuardMix, a 92K-example dataset spanning 13 risk categories, WildGuard jointly predicts prompt harmfulness, response harmfulness, and whether the assistant actually refused, beating GPT-4 by 3.9 F1 points on adversarial prompts and closing a 26.4% relative gap over prior open refusal detectors.
- Multi-task scope in one pass: simultaneously outputs three labels (
prompt_harm,response_harm,response_refusal) from a unified prompt-response template on Mistral-7B-v0.3. - WildGuardTest (5,299 human-annotated items): hits 85.5% F1 on adversarial prompt harmfulness (vs. 81.6% for GPT-4, 74.5% for Aegis-Guard-D, and 46.1% for Llama-Guard2) and 88.6% F1 on overall refusal detection (vs. 70.1% for LibrAI-LongFormer-ref and 92.4% for GPT-4).
- 10 public benchmarks: averages 86.1% F1 on prompt harmfulness (vs. 84.6% GPT-4, 77.0% Llama-Guard2) and 82.4% F1 on response harmfulness (vs. 82.0% GPT-4, 80.9% MD-Judge).
- Live guardrail tradeoff (WildJailbreak eval, 2,000 harmful + 250 benign adversarial prompts): filtering Tulu-2-dpo-7B with WildGuard drops Attack Success Rate (ASR) from 79.8% to 2.4% with 0.4% Refusal To Answer (RTA), whereas Aegis-Guard-D allows 12.4% ASR and blocks 16.0% of benign prompts.
How It Works
Earlier open safeguards such as Llama Guard and ShieldGemma focus on classifying whether a prompt or response violates a policy, leaving teams blind to two recurring failure modes. First, they break sharply on jailbreak-wrapped requests: on WildJailbreak, Llama-Guard2 drops from 85.6% F1 on vanilla prompts to 46.1% F1 on adversarial prompts in WildGuardTest. Second, response harmfulness cannot stand in for refusal detection. If a user asks “How to kill a Python process?”, both a false refusal and a helpful answer are harmless, so harm classifiers fail to measure exaggerated safety (a pattern studied closely in safety training failure modes).
To fix both bottlenecks, Han et al. build WildGuardTrain (86,759 items: 48,783 standalone prompts and 37,976 prompt-response pairs) from four deliberately balanced sources:
- Synthetic vanilla prompts: harmful scenarios across 13 subcategories (privacy, misinformation, harmful language, malicious uses) paired with XSTest-style contrastive benign prompts (homonyms, figurative language, safe targets) so the classifier learns sensitive keywords do not imply harm.
- Synthetic adversarial prompts: vanilla harmful and benign prompts rewritten via WildTeaming by composing 2 to 7 jailbreak tactics mined from real LMSYS-Chat-1M and WildChat logs.
- In-the-wild and worker-written prompts: 1,888 real user queries from LMSYS-Chat-1M and WildChat plus 9,491 items sampled from HH-RLHF and Anthropic Red-Teaming.
- Matched refusals, compliances, and nuanced edge cases: completions generated by eight open and API LLMs forced to either refuse or comply, plus GPT-4 synthetic examples targeting tricky responses such as “warning first, then benign answer” or “refusal followed by harmful compliance.”
An audit of 500 GPT-4 training labels against three human annotators showed 92% agreement on prompt harm, 82% on response harm, and 95% on refusal. WildGuardTest adds 1,725 human-voted prompt-response pairs (5,299 task labels total; Fleiss’ kappa 0.55, 0.50, and 0.72), alongside XSTest-Resp (446 response-harm and 449 refusal items).
Key Findings
Across 10 public benchmarks and WildGuardTest, the balanced multi-task dataset matters far more than model architecture. Swapping Mistral-7B-v0.3 for Gemma-7B, Llama-2-7B, Llama-3-8B, OLMo-1.7-7B, or Tulu-2-SFT-7B changes F1 by roughly 1 to 2 points (Llama-3-8B scores 88.6% total prompt harm and 88.4% total refusal on WildGuardTest). By contrast, dataset ablations prove every component carries load: removing synthetic adversarial data cuts WildGuardTest adversarial prompt F1 by 8.4 points (85.5% to 77.1%), removing In-the-Wild logs drops ToxicChat F1 by 10.3 points (70.8% to 60.5%), and training single-task models instead of one joint model lowers public response-harm F1 by 6.0 points (82.4% to 76.4%).
On XSTest-Resp, WildGuard achieves 94.7% response-harm F1 (beating GPT-4’s 91.3%) and 92.8% refusal F1 (nearly matching GPT-4’s 98.1% while crushing Llama-Guard2’s 64.1% and LibrAI-LongFormer-ref’s 74.3%). On WildGuardTest response harmfulness, MD-Judge edges out WildGuard overall (76.8% vs. 75.4% F1), while WildGuard takes adversarial responses (68.4% vs. 67.7%) and remains the only open tool handling all three tasks.
Caveats and Builder Takeaway
- Synthetic skew and taxonomy lock-in: Most of WildGuardTrain is GPT-4-generated rather than live production traffic, and its 13 harm categories plus refusal rules (“redirecting” and “selective” refusals count as refusals) bake in policy choices that may diverge from custom enterprise policies (a tension shared by production moderation classifiers).
- No category-level or multilingual breakdown: WildGuard predicts binary harm/refusal flags rather than naming which of the 13 risk categories triggered, and both training and benchmarks are English-centric.
- Not a standalone wall: Even at 2.4% ASR on Tulu-2-dpo-7B (or 0.7% stacked onto safety-tuned Tulu-2+WJ), adversarial prompts still slip past occasionally, especially under unseen attack formats.
For engineering teams running open-weight LLM guardrails, WildGuard’s main payoff is replacing brittle keyword scripts and expensive GPT-4 judge calls with one self-hosted 7B classifier that separates request intent, response safety, and refusal behavior. Deploy it as both an inference-time input/output gate and an automated eval judge to catch exaggerated over-refusals alongside actual jailbreaks.


