"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Models

Xinyue Shen, Zeyuan Chen, Michael Backes, Yun Shen, Yang Zhang

TL;DR

This paper presents JAILBREAKHUB, the first large-scale systematic study of "in-the-wild" jailbreak prompts used to bypass Large Language Model (LLM) safety guardrails. By analyzing 1,405 real-world jailbreak prompts and evaluating them against a massive dataset of 107,250 forbidden questions, the authors reveal that current safety alignments (like RLHF) and external guardrails are heavily vulnerable to sophisticated, evolving, and even slightly paraphrased adversarial attacks.

What Problem Does This Paper Address?

As LLMs become deeply integrated into commercial applications, vendors use techniques like Reinforcement Learning from Human Feedback (RLHF) and external moderation APIs to prevent them from generating harmful content (e.g., malware, hate speech, or illegal advice). However, users continuously find adversarial prompts—known as jailbreak prompts—that trick models into ignoring their safety rules.

While prior research has looked at small, synthetic, or isolated sets of jailbreaks, the community lacked a comprehensive understanding of how jailbreak prompts evolve in the wild, who makes them, what strategies they use, and how robust commercial defenses actually are against them.

Example of a classic DAN jailbreak prompt bypassing safety filters.

Methods

The authors built JAILBREAKHUB, a unified framework consisting of three main stages:

  1. Data Collection: The team crawled 15,140 prompts from December 2022 to December 2023 across Reddit, Discord, prompt-aggregation websites (like FlowGPT), and open-source datasets, filtering out 1,405 verified jailbreak prompts.
  2. Prompt Analysis: To map out the jailbreak landscape, they analyzed prompt lengths, mapped semantic structures using Sentence-BERT and UMAP, and applied a graph-based community detection method (the Louvain algorithm) based on Levenshtein distance to categorize prompts into 131 distinct attack communities.
  3. Response Evaluation: They evaluated the prompts against six popular LLMs. To handle the massive volume of model responses, they leveraged ChatGLM for automated labeling to determine if an attack successfully elicited forbidden content.
Overview of the JAILBREAKHUB framework spanning collection, analysis, and evaluation.

Datasets

The study utilizes and introduces two key data components:

  • In-the-Wild Jailbreak Prompts: A curated set of 1,405 jailbreak prompts collected over a one-year lifecycle.
  • Forbidden Question Testbed: A newly created benchmark containing 107,250 samples. The authors used GPT-4 to generate 30 distinct dangerous questions across 13 forbidden scenarios outlined in OpenAI’s usage policy (e.g., economic harm, privacy violence, fraud).

Key Insights and Ideas

  • The Migration to Prompt Hubs: Jailbreak sharing is shifting away from traditional social networks like Reddit and Discord toward dedicated prompt-aggregation platforms like FlowGPT, where users actively curate and optimize attacks as a service.
  • An Evolutionary Arms Race: Jailbreak prompts are significantly longer than regular prompts (averaging 555 tokens, or 1.5x regular length). Crucially, jailbreak lengths spike immediately following major safety updates from vendors like OpenAI, showing that adversaries actively lengthen prompts to wrap complex logic around new defenses.
  • Semantic Camouflage: Semantic mapping reveals that jailbreak prompts cluster tightly with benign "role-play" or storytelling prompts. This makes simple embedding-based semantic filters highly ineffective at detecting them.
  • Fragility of Hidden Patches: While newer model iterations (like gpt-3.5-1106) initially blocked historical jailbreaks, the authors discovered these hidden safeguards are incredibly fragile. Simple paraphrase attacks or introducing minor typos easily reactivated the jailbreaks.
Statistics showing prompt counts, target models, and the expanding length of jailbreak prompts over time.

Key Results

  • High Success Rates: The most effective jailbreak prompts achieved an Attack Success Rate (ASR) of over 0.95 on both ChatGPT (GPT-3.5) and GPT-4.
  • Vulnerable Scenarios: Across all tested models, Political Lobbying was the most vulnerable category (0.855 mean ASR), followed closely by Legal Opinion and Pornography.
  • Open-Source Risks: Dolly, an open-source model intended for commercial use, showed virtually zero inherent safety resistance, yielding a baseline attack success rate (ASR-B) of 0.857 even without a jailbreak prompt.
  • Bypassing the Latest Defenses: By introducing simple adversarial typos to just 1%, 5%, and 10% of the words in a blocked prompt, the ASR on the updated gpt-3.5-1106 model jumped from a baseline of 0.477 to 0.517, 0.778, and 0.857, respectively.
  • Guardrail Inefficacy: External safety tools (OpenAI Moderation Endpoint, OpenChatKit, and NeMo-Guardrails) provided very minor protection, with the best tool only reducing the average jailbreak success rate by 0.091.

Limitations and Future Work

The authors note that their dataset is bounded by a specific timeframe (ending December 2023). Because the cat-and-mouse game between LLM vendors and adversaries moves rapidly, jailbreak strategies will continue to morph.

Future work will focus on comparing these crowdsourced, in-the-wild prompts against emerging automated jailbreak generation algorithms, alongside designing more adaptive, defense-in-depth guardrails that go beyond rigid classification-based filtering.

Summary updated

BibTeX
@inproceedings{shen2024do,
  author = {Xinyue Shen and Zeyuan Chen and Michael Backes and Yun Shen and Yang Zhang},
  title = {{"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Models}},
  booktitle = {CCS},
  year = {2024},
  doi = {10.1145/3658644.3670388},
}
Figure