PrimeGuard: Safe and Helpful LLMs through Tuning-Free Routing
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
Deploying language models (LMs) necessitates outputs to be both high-quality and compliant with safety guidelines. Although Inference-Time Guardrails (ITG) offer solutions that shift model output distributions towards compliance, we find that current methods struggle in balancing safety with helpfulness. ITG Methods that safely address non-compliant queries exhibit lower helpfulness while those that prioritize helpfulness compromise on safety. We refer to this trade-off as the guardrail tax, analogous to the alignment tax. To address this, we propose PrimeGuard, a novel ITG method that utilizes structured control flow. PrimeGuard routes requests to different self-instantiations of the LM with varying instructions, leveraging its inherent instruction-following capabilities and in-context learning. Our tuning-free approach dynamically compiles system-designer guidelines for each query. We construct and release safe-eval, a diverse red-team safety benchmark. Extensive evaluations demonstrate that PrimeGuard, without fine-tuning, overcomes the guardrail tax by (1) significantly increasing resistance to iterative jailbreak attacks and (2) achieving state-of-the-art results in safety guardrailing while (3) matching helpfulness scores of alignment-tuned models. Extensive evaluations demonstrate that PrimeGuard, without fine-tuning, outperforms all competing baselines and overcomes the guardrail tax by improving the fraction of safe responses from 61% to 97% and increasing average helpfulness scores from 4.17 to 4.29 on the largest models, while reducing attack success rate from 100% to 8%. PrimeGuard implementation is available at https://github.com/dynamofl/PrimeGuard and safe-eval dataset is available at https://huggingface.co/datasets/dynamoai/safe_eval.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 29 of its 61 references that are in the map. First posted on arXiv 23 Jul 2024.
Builds on
29 of 61 references.
Closest ancestors · 1
Same direction, newest first
- 2023The Poison of Alignment25 Aug
Other references · 28
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2023Mistral 7Bcited by 3,065
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,883
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
- 2022Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learnedcited by 702
- 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
- 2024How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMscited by 533
16 more
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 494
- 2023XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Modelscited by 477
- 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 457
- 2024Prometheus 2: An Open Source Language Model Specialized in Evaluating Other Language Modelscited by 431
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 401
- 2023JudgeLM: Fine-tuned Large Language Models are Scalable Judgescited by 351
- 2023The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learningcited by 251
- 2021Gradient-based Adversarial Attacks against Text Transformerscited by 233
- 2023Red-Teaming Large Language Models using Chain of Utterances for Safety-Alignmentcited by 213
- 2023Do-Not-Answer: A Dataset for Evaluating Safeguards in LLMscited by 176
- 2023Attack Prompt Generation for Red Teaming and Defending Large Language Modelscited by 73
- 2023The Art of Defending: A Systematic Evaluation and Analysis of LLM Defense Strategies on Safety and Over-Defensivenesscited by 63
- 2024Gradient Cuff: Detecting Jailbreak Attacks on Large Language Models by Exploring Refusal Loss Landscapescited by 63
- 2023AART: AI-Assisted Red-Teaming with Diverse Data Generation for New LLM-powered Applicationscited by 53
- 2024ShieldLM: Empowering LLMs as Aligned, Customizable and Explainable Safety Detectorscited by 48
- 2016Learning to Perform Physics Experiments via Deep Reinforcement Learningcited by 47
Built on by
Citing papers per year: 2025: 8; 2026: 2.
10 papers.
- 2025Neither Valid nor Reliable? Investigating the Use of LLMs as Judgescited by 37
- 2025Know Thy Judge: On the Robustness Meta-Evaluation of LLM Safety Judgescited by 19
- 2025SoK: Evaluating Jailbreak Guardrails for Large Language Modelscited by 17
- 2025Efficient LLM Moderation with Multi-Layer Latent Prototypescited by 4
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defensescited by 4
- 2025SAFENLIDB: A Privacy-Preserving Safety Alignment Framework for LLM-based Natural Language Database Interfacescited by 4
- 2025Unified Multi-Task Learning & Model Fusion for Efficient Language Model Guardrailingcited by 3
- 2025Dynamic Evaluation for Oversensitivity in LLMscited by 2
- 2026Towards Understanding the Robustness of Sparse Autoencoderscited by 0
- 2026False Floors: LLM Safety Routing Evaluations Break Under Distribution Shiftcited by 0
- 2026False Floors: LLM Safety Routing Evaluations Break Under Distribution Shift1 Oct 2026
- 2026Towards Understanding the Robustness of Sparse Autoencoders20 Apr 2026
- 2025SAFENLIDB: A Privacy-Preserving Safety Alignment Framework for LLM-based Natural Language Database Interfaces10 Nov 2025
- 2025Dynamic Evaluation for Oversensitivity in LLMs21 Oct 2025
- 2025SoK: Systematizing LLM Prompt Security: Taxonomies, Datasets, and Unified Evaluation of Attacks and Defenses17 Oct 2025
- 2025Neither Valid nor Reliable? Investigating the Use of LLMs as Judges25 Aug 2025
- 2025SoK: Evaluating Jailbreak Guardrails for Large Language Models12 Jun 2025
- 2025Unified Multi-Task Learning & Model Fusion for Efficient Language Model Guardrailing27 Apr 2025
- 2025Know Thy Judge: On the Robustness Meta-Evaluation of LLM Safety Judges6 Mar 2025
- 2025Efficient LLM Moderation with Multi-Layer Latent Prototypes22 Feb 2025
Similar, not cited
Close in wording, no citation either way
- 2026Robust and Efficient Guardrails with Latent Reasoning
- 2025Unlocking LLM Safeguards for Low-Resource Languages via Reasoning and Alignment with Minimal Training Data
- 2026TraceSafe: A Systematic Assessment of LLM Guardrails on Multi-Step Tool-Calling Trajectories
- 2024Safety Layers in Aligned Large Language Models: The Key to LLM Security
- 2025UpSafe^circC: Upcycling for Controllable Safety in Large Language Models
- 2025Activation Approximations Can Incur Safety Vulnerabilities Even in Aligned LLMs: Comprehensive Analysis and Defense
- 2025PandaGuard: Systematic Evaluation of LLM Safety against Jailbreaking Attacks
- 2025Defending MoE LLMs against Harmful Fine-Tuning via Safety Routing Alignment