Source-linked AI summary
EasyJailbreak: A Unified Framework for Jailbreaking Large Language Models
Weikang Zhou, Xiao Wang, Limao Xiong, Han Xia, Yingshuang Gu, Mingxu Chai, Fukang Zhu, Caishuang Huang, Shihan Dou, Zhiheng Xi, Rui Zheng, Songyang Gao, Yicheng Zou, Hang Yan, Yifan Le, Ruohui Wang, Lijun Li, Jing Shao, Tao Gui, Qi Zhang, Xuanjing Huang
TL;DR
Jailbreak methods lack a standard framework for fair, comprehensive LLM security evaluation. EasyJailbreak provides a modular system built from four components and evaluates attacks across models, finding substantial vulnerability. The framework also supports standardized comparison and responsible security research.
Problem
Different jailbreak methods are difficult to compare fairly because they use different samples and victim models, while reimplementation is time-consuming and error-prone.
Source: §1 · p. 1Method
EasyJailbreak constructs and evaluates attacks through reusable Selector, Mutator, Constraint, and Evaluator components, supporting standardized benchmarking and model compatibility.
Source: §1 · p. 2Results
60% average breach probability was observed across 10 LLMs, with GPT-3.5-Turbo and GPT-4 showing 57% and 33% average ASRs, respectively.
Source: §1 · p. 2Takeaways & Limitations
The findings underscore the need for enhanced LLM security measures and provide researchers with tools for evaluating and improving defenses.
Source: §1 · p. 2, §6 · p. 6Because of its dual-use potential, the framework requires responsible disclosure, ethical use, monitoring, and iterative updates to reduce misuse risks.
Source: Ethics Statement · p. 6
Abstract
from arXiv · showhide
Jailbreak attacks are crucial for identifying and mitigating the security vulnerabilities of Large Language Models (LLMs). They are designed to bypass safeguards and elicit prohibited outputs. However, due to significant differences among various jailbreak methods, there is no standard implementation framework available for the community, which limits comprehensive security evaluations. This paper introduces EasyJailbreak, a unified framework simplifying the construction and evaluation of jailbreak attacks against LLMs. It builds jailbreak attacks using four components: Selector, Mutator, Constraint, and Evaluator. This modular framework enables researchers to easily construct attacks from combinations of novel and existing components. So far, EasyJailbreak supports 11 distinct jailbreak methods and facilitates the security validation of a broad spectrum of LLMs. Our validation across 10 distinct LLMs reveals a significant vulnerability, with an average breach probability of 60% under various jailbreaking attacks. Notably, even advanced models like GPT-3.5-Turbo and GPT-4 exhibit average Attack Success Rates (ASR) of 57% and 33%, respectively. We have released a wealth of resources for researchers, including a web platform, PyPI published package, screencast video, and experimental outputs.
1 Introduction
Jailbreak attacks can bypass LLM safeguards, but differing methods and evaluation settings hinder fair comparison and vulnerability mitigation. EasyJailbreak addresses this gap with a modular framework whose evaluation exposes widespread risks across models.
Motivation
- Jailbreak methods are difficult to compare fairly because they often use different data samples and victim models.Reimplementing prior work is also time-consuming and error-prone when source code is unavailable.Source: §1 · p. 1
Framework
- EasyJailbreak decomposes jailbreak methods into Selector, Mutator, Constraint, and Evaluator components.Selectors identify threatening candidates, mutators refine prompts, constraints filter ineffective instances, and evaluators assess attack success.Source: §1 · pp. 1–2
Contributions
- The framework supports standardized benchmarking of 12 jailbreak attacks within a unified implementation.This enables the methods to be benchmarked, compared, and analyzed together.Source: §1 · p. 2
- Its modular architecture supports reuse of shared components and lowers the development barrier for creating new attacks.Researchers can focus on novel components while minimizing development effort.Source: §1 · p. 2
- EasyJailbreak supports open-source and closed-source models, including LlaMA2 and GPT-4, and allows users to incorporate their own models and datasets through HuggingFace transformers.Source: §1 · p. 2
Empirical findings
- 60% average breach probability was found across 10 LLMs evaluated against jailbreak attacks, including 57% and 33% average ASRs for GPT-3.5-Turbo and GPT-4.The findings indicate that advanced models remain susceptible to jailbreak attacks.Source: §1 · p. 2
2 Related Work
Prior jailbreak research uses human-designed prompts, long-tail encodings, and automated prompt optimization to bypass model safeguards. These approaches exploit creative prompting, distributional weaknesses, or systematic prompt search.
Taxonomy
- Jailbreak attacks are organized into Human-Design, Long-tail Encoding, and Prompt Optimization categories.The categories cover manual prompt construction, rare-format inputs, and automated vulnerability exploration.Source: §2 · p. 2
Human Design
- Human-designed attacks use role-playing, scenario crafting, and context-learning vulnerabilities to induce responses to malicious instructions.Source: §2 · p. 2
Long-tail Encoding
- Long-tail Encoding exploits limited generalization to unseen security-alignment data by using rare formats, low-resource languages, or encrypted inputs with embedded decoding functions.Source: §2 · p. 2
Prompt Optimization
- Prompt optimization methods search for vulnerabilities through gradients, genetic algorithms, prompt fuzzing, iterative scoring, persuasion, or assistant-model generation.Source: §2 · p. 2
3 Framework
EasyJailbreak organizes jailbreak attacks into a preparation stage, an iterative attack stage, and an output stage. Its four reusable components manage candidate selection, prompt mutation, filtering, and evaluation, producing detailed attack reports.
3 Framework
- EasyJailbreak integrates 11 classic jailbreak attack methods into a unified framework with a user-friendly interface.Users can execute attack algorithms with just a few lines of code.Source: §3 · p. 2
3.1 Preparation
- Users configure queries, seed prompt templates, target or auxiliary models, and attack hyperparameters before running an attack.Queries specify prohibited instructions, while seeds are initial templates intended to improve ASR.Source: §3.1 · p. 3
3.2 Selector
- Selectors choose promising candidates when productive mutators cause alternative jailbreak inputs to grow exponentially.EXP3SelectPolicy is an example that uses Exp3 to select seeds for subsequent updates.Source: §3.2 · p. 3
3.3 Mutator
- Mutators modify rejected jailbreak inputs to seek successful attacks, including by translating inputs into languages on which the target model was rarely trained.Source: §3.3 · p. 3
3.4 Constraint
- Constraints remove randomly generated jailbreak inputs that are likely to fail, such as off-topic inputs identified by DeleteOffTopic.Source: §3.4 · p. 3
3.5 Evaluator
- Evaluators automatically determine whether a target response constitutes a successful jailbreak and whether further attack steps are warranted.ClassificationJudge uses a trained classifier to distinguish responses indicating successful jailbreaking.Source: §3.5 · p. 3
- The framework combines Selector, Mutator, Constraint, and Evaluator components flexibly across attack recipes.Table 1 marks unused components as N/A.Source: Table 1 · p. 4
3.6 Report
- Each attack produces a report containing success rates, response perplexity, model replies, jailbreak prompts, and evaluations.These reports support pinpointing vulnerabilities and strengthening model defenses.Source: §3.6 · p. 4
4 Usage
EasyJailbreak provides a concise workflow for running jailbreak attacks and inspecting their outcomes. Users configure attack, target, evaluation models, and datasets, while the platform also demonstrates results through a web interface.
Configuration
- EasyJailbreak runs PAIR attacks by combining an attack model, target model, evaluation model, and JailbreakDataset.The attack model generates prompts, the target model is tested, and the evaluation model judges success.Source: §4 · pp. 4–5
- The attack model generates the jailbreak prompt and performs the initial attack phase.Source: §4 · p. 4
- The target model is the LLM users attempt to jailbreak and the primary object of security testing.Source: §4 · p. 5
- The evaluation model determines whether an illegal query successfully jailbroke the target and assesses attack effectiveness.Source: §4 · p. 5
Web interface
- The web platform lets users compare outputs from different jailbreak approaches, including ChatGPT’s response to PAIR.Source: §4 · p. 5, Figure 3 · p. 5
5 LLM Benchmarking via EasyJailbreak
The benchmark evaluates diverse jailbreak recipes across ten language models and compares their security and evaluator performance. Results show widespread susceptibility, lower average ASR for closed-source models, no clear security gain from larger parameter counts, and trade-offs among evaluators.
5.1 Setup
- The setup evaluates ten models on AdvBench using human-designed, long-tail encoding, and optimization-based attack recipes.GenerativeJudge uses GPT-4-turbo-1106 as the scoring model.Source: §5.1 · p. 5
5.2 Result Analysis
- 63% average breach probability across ten models shows pervasive vulnerability, while GPT-3.5-Turbo and GPT-4 reach 57% and 33% average ASR, respectively.Source: §5.2 · p. 5, Table 2 · p. 6
- Closed-source GPT-3.5-Turbo and GPT-4 average 45% ASR versus 66% for the remaining open-source models, while Llama2 security is comparable to GPT-4.Source: §5.2 · p. 5
- On both Llama2 and Vicuna, 13B versions have slightly higher average jailbreak success rates than 7B versions, so larger size does not necessarily improve security.The paper proposes further validation on larger-scale models such as Llama2-Chat-70B.Source: §5.2 · pp. 5–6
5.3 Evaluator Comparison
- GPT-4 leads evaluator accuracy, TPR, and F1 but takes longer, whereas the Gptfuzz classifier combines high efficiency with the lowest FPR.Rule-based matching is fast but has higher FPR because of strictness and limited adaptability.Source: §5.3 · p. 6, Table 3 · p. 6
6 Conclusion
EasyJailbreak unifies and modularizes jailbreak evaluation and development across models. Its results expose substantial vulnerability in advanced LLMs and motivate stronger security measures.
Ethics Statement
The paper recognizes that EasyJailbreak has dual-use potential and frames its deployment around responsible disclosure and defensive research. It also calls for monitoring, updates, and collaboration to address emerging threats.
- EasyJailbreak’s dual-use potential motivates conscientious research and deployment focused on advancing LLM security.Source: Ethics Statement · p. 6
- The authors advocate responsible disclosure, ethical usage, monitoring, iterative updates, and cybersecurity collaboration to strengthen defenses.Source: Ethics Statement · p. 6
A Component Details
EasyJailbreak organizes jailbreak attacks into modular components for selecting, mutating, filtering, and evaluating attack instances. The component library includes multiple strategies for each stage, enabling varied attack construction.
A Component Details
- The section provides detailed explanations of all components implemented in Easyjailbreak.Source: A Component Details · p. 8
A.1 Selector
- Selectors choose seeds for subsequent updates using random, bandit, round-robin, MCTS, score-based, or reference-loss strategies.These policies balance exploration, scoring, and loss-based selection across candidate seeds.Source: §A.1 · p. 8
A.2 Mutator
- Mutators update jailbreak inputs through generative-model rephrasing or translation, gradient-based perturbation, and rule-based transformations such as Base64 encoding.The mutation strategies target improved jailbreak likelihood through language-model generation, gradients, or predefined rules.Source: §A.2 · p. 8
A.3 Constraint
- Constraints filter attack instances by harmfulness, topical relevance, or perplexity before further processing.DeleteHarmLess removes inputs judged harmless, DeleteOffTopic removes off-topic inputs, and PerplexityConstraint removes high-perplexity inputs.Source: §A.3 · p. 8
A.4 Evaluator
EasyJailbreak evaluates jailbreak outcomes with classifier-based, generative-model-based, and rule-based evaluators. Figure 4 reports ASR and efficiency for jailbreak methods on llama2-7b and llama2-13b.
A.4 Evaluator
- Evaluators use classifiers or generative models to score responses from 0 to 9 or judge whether an attack succeeds.Classifier-based evaluators include ClassificationGetScore and ClassificationJudge, while generative evaluators include GenerativeGetScore and GenerativeJudge.Source: §A.4 · pp. 8–9
- Figure 4 compares ASR and efficiency across jailbreak methods on llama2-7b and llama2-13b.The figure separates ASR in panel (a) from efficiency in panel (b).Source: Figure 4 · p. 9
- Rule-based evaluators determine success through exact matching, pattern presence, or required response prefixes.The framework provides Match, PatternJudge, and PrefixExactMatch according to the required matching level.Source: §A.4 · p. 9
B Efficiency Comparison
Efficiency varies substantially across jailbreak categories on Llama2 models. Human-designed methods are fastest, long-tail encoding methods vary in success, and prompt optimization is most time-intensive but more successful on these models.
B Efficiency Comparison
- Human-designed methods require the shortest processing time, but their success rates may drop sharply as models are updated or replaced.JailBroken, DeepInception, and ICA typically use only a human-written prompt.Source: B Efficiency Comparison · p. 9
- 61% and 90% are the Cipher success rates for Llama2-7B-chat and Llama2-13B-chat, respectively, whereas MultiLingual performs worse because of limited multilingual capability.Cipher’s performance is attributed to security optimizations not adequately covering its language-processing abilities.Source: B Efficiency Comparison · p. 9
- 764.4 hours and 803.9 hours are required by prompt optimization on Llama2-7B-chat and Llama2-13B-chat, respectively, while achieving higher success rates.The long runtimes reflect iterative optimization for finding effective jailbreak prompts.Source: B Efficiency Comparison · p. 9