PRP: Propagating Universal Perturbations to Attack Large Language Model Guard-Rails

Neal Mangaokar, Ashish Hooda, Jihye Choi, Shreyas Chandrashekaran, Kassem Fawaz, Somesh Jha, Atul Prakash

Abstract

As Large Language Models (LLMs) are increasingly deployed in sensitive applications, developers have turned to "Guard-Railed" architectures—where a secondary safety model monitors the primary model's output—to prevent the generation of harmful content. This paper introduces PRP (Propagating Universal Perturbations), a novel two-stage attack that systematically bypasses these defenses. By combining universal adversarial triggers with in-context learning, PRP tricks a base LLM into prepending a "magic string" to its response, effectively blinding the guard model. Our experiments demonstrate that PRP achieves high attack success rates (up to 92%) and exhibits strong transferability across state-of-the-art models like GPT-3.5 and Gemini-Pro, highlighting a critical vulnerability in current LLM safety frameworks.

Introduction

Ensuring that LLMs do not generate harmful content, such as instructions for illegal acts or hate speech, is a paramount concern for AI safety. While techniques like Reinforcement Learning from Human Feedback (RLHF) align models with human values, they remain susceptible to "jailbreak" prompts. To bolster security, many systems now employ a Guard-Railed LLM configuration. In this setup, a primary LLM generates a response, which is then scrutinized by an independent Guard Model. If the Guard Model identifies the content as harmful, the output is blocked before reaching the user.

However, existing jailbreak attacks primarily target the base model's alignment. These often fail in guarded environments because the secondary model still recognizes the resulting output as malicious. This research introduces PRP, an adaptive framework designed to circumvent both the base model's safety training and the secondary guardrail.

The PRP Framework

The PRP attack operates in two distinct stages, exploiting vulnerabilities in how Guard Models process text and how base LLMs utilize context.

  1. Stage 1: Universal Adversarial Prefix ($\Delta_{fG}$): Using discrete optimization, the researchers identify a short (approx. 20 tokens) "magic" string. When this string is prepended to a harmful response, it causes the Guard Model to misclassify the entire text as "safe." Crucially, this prefix is universal; it works across diverse harmful topics.
  2. Stage 2: Propagation Prefix ($p \to \Delta_{fG}$): To ensure the Guard Model sees this magic string, it must appear at the start of the base LLM's response. PRP achieves this through In-Context Learning (ICL). By prepending a "propagation prefix" consisting of few-shot examples where every assistant response begins with the magic string, the base LLM is biased to follow this pattern even when generating prohibited content.
Comparison between standard jailbreaking (a), which fails against guardrails, and the proposed PRP attack (b), which successfully bypasses them.

Experimental Evaluation

The authors evaluated PRP using the AdvBench dataset for harmful prompts and a benign dataset for few-shot examples. The evaluation was performed across a wide range of models, including Llama 2, Vicuna, Guanaco, Mistral, GPT-3.5, and Gemini-Pro.

Key Results

The results indicate that Guard Models share the same fundamental vulnerabilities as the models they are meant to protect. PRP achieved an Attack Success Rate (ASR) of up to 92% against a Llama2-70B Guard Model. In contrast, standard jailbreak attacks like GCG saw their success rates plummet to near zero in the same guarded environment.

Furthermore, the attack proved highly transferable. An adversarial prefix optimized on an open-source model like Llama 2 successfully bypassed proprietary models. PRP reached success rates as high as 88% against GPT-3.5 and 80% against Gemini-Pro in "no-access" transfer settings.

Attack Success Rates (ASR) across different base LLMs and Guard Models, comparing original attacks (Orig) to PRP.

Discussion and Limitations

The effectiveness of PRP suggests that "safety by obscurity"—hiding the guard model's architecture—is not a robust defense. The power of in-context learning allows attackers to force specific output formats without needing white-box access or fine-tuning.

To counter such threats, the authors suggest several defensive strategies, including adversarial training for Guard Models and implementing advanced string-matching filters to catch known adversarial triggers. While this study focused on LLM-based guards, future work should explore non-LLM safety filters and multi-agent safety setups to build more resilient systems.

Conclusion

PRP exposes a significant flaw in the current "defense-in-depth" strategy for LLMs. By propagating a universal perturbation through the base model to the guardrail, attackers can reliably elicit harmful content. This work underscores the need for more robust, adversarial-resistant safety mechanisms in the next generation of AI systems.

Summary updated

BibTeX
@inproceedings{mangaokar2024prp,
  author = {Neal Mangaokar and Ashish Hooda and Jihye Choi and Shreyas Chandrashekaran and Kassem Fawaz and Somesh Jha and Atul Prakash},
  title = {{PRP: Propagating Universal Perturbations to Attack Large Language Model Guard-Rails}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.591},
}
Figure