Defense Against the Dark Prompts: Mitigating Best-of-N Jailbreaks with Prompt EvaluationDefense Against the Dark Prompts: Mitigating Best-of-N Jailbreaking with Prompt Evaluation
DATDP uses an evaluation LLM to intercept BoN text jailbreaks: on 1045 successful samples, both models achieve 100%.
The defense targets text Best-of-N jailbreaks: an attacker applies word scrambling, random capitalization, and ASCII noising to harmful prompts and repeatedly samples to elicit harmful outputs. DATDP uses an evaluation agent before the answer model to intercept dangerous content or jailbreak attempts. Vision and audio are not included in this experiment.
- Best-of-N uses random text augmentation with repeated sampling and can bypass safety restrictions in frontier models. The authors aim to intercept dangerous content and jailbreak attempts before the prompt reaches the answering model.
- DATDP places an evaluation LLM before the answering model, asking it to judge whether the prompt is dangerous or attempts a jailbreak, ending with yes/no. Refusal scores +2, acceptance scores -1; after multiple samples, a positive score blocks and a strictly negative score allows. Claude samples 5 times, LLaMa-3-8B-instruct samples 25 times.
- BoN paper 1045 items: both evaluators 100% interception. Replicated jailbreak set: Claude 99.90%, LLaMa 99.80%. On unenhanced HarmBench, LLaMa is 98.74%. LLaMa falsely intercepts 0.40% of normal prompts. Switching to answer evaluation intercepted 760/1000.
- The authors leave visual and audio jailbreaks for future work and state that improvements such as fine-tuning have not been fully tested. The answer-side evaluation intercepted 760 of 1,000 replicated jailbreaks. The experiments use two evaluation models and six text sets, with augmentation parameter σ=0.25.
- Evaluated models
- Claude Sonnet 3.5 (claude-3-5-sonnet-20241022)LLaMa-3-8B-instruct
- Benchmarks
- HarmBenchBoN PaperReplicated JailbreaksReplicated SafeGeneric AugmentedNormal
- Metrics
- % blocked95% Clopper-Pearson confidence interval
The paper proposes the DATDP method, which uses an evaluation LLM to repeatedly review whether prompts contain dangerous, manipulative, or jailbreak intent until a stable safety rating is generated. The authors claim this method blocked 100% of successful jailbreaks from the Best-of-N jailbreak paper (confidence interval [99.65%, 100.00%]), and blocked 99.8% in their reproduction experiments (confidence interval [99.28%, 99.98%]). Unlike previous work describing Best-of-N jailbreaks implemented through repeated random augmentations (e.g., capitalization, punctuation), DATDP explicitly detects jailbreak attempts. The evaluation component maintains effectiveness even with smaller models; the authors claim Claude and LLaMa-3-8B-instruct perform almost equivalently. The authors therefore argue that DATDP can be integrated into generative AI systems at low cost, providing immediate safety improvements.
Related events and news
1 events · 1 news mentions
News that mentions this paper
固定权重模型概念空间存在对抗脆弱性
- AI Alignment Forumcites the paper's id or link固定权重模型为何必然存在对抗脆弱性并因此失准
But modern models are much harder to jailbreak, and adding other models as evaluation agents dramatically improves their resistance to jailbreaking.
Paper analysis
What problem does this paper attempt to solve?
An evaluation agent intercepts BoN-style text augmentation jailbreaks before the answering model.
How to intercept Best-of-N (BoN)-style random text augmentation jailbreaks before the answering model.
- Scenario: The authors state that jailbreaks bypass safety restrictions in LLMs and VLMs, generating harmful or restricted content. The introduction recounts that BoN can bypass open-source defenses such as circuit breakers.
- Existing shortcomings: The authors state that many mitigations target specific attack vectors and are reactive defenses, making it difficult to generalize across diverse adversarial scenarios.
- Authors' rationale: To elicit a dangerous answer, the prompt must be understandable to the model; the authors consider this consistent with the conditions under which an evaluation agent operates, even though models are sensitive to seemingly innocuous modifications.
- Threat model:
- Goal: Elicit harmful or restricted outputs. Experiments are text-only; vision and audio are left for future work.
- Capability: Apply word scrambling, random capitalization, and ASCII noising to harmful prompts, and sample repeatedly. The authors recount [16]: the effect comes from input variance, not from any particular augmentation itself.
- Victim location: The evaluation agent checks both dangerous content and jailbreak attempts before the answering model. The authors consider bypassing the evaluator and bypassing internal safety to be mutually constraining.
- This paper's approach: Propose Defense Against The Dark Prompts (DATDP), using an evaluation LLM to check repeatedly until a safety rating is given. The authors state that, unlike some other approaches, it explicitly looks for jailbreak attempts.
What related research exists?
Related work covers the jailbreak spectrum, reactive defenses, and BoN; DATDP builds on prompt evaluation.
Jailbreak attacks
- FigStep (Gong et al., 2023) uses typographic visual prompts to bypass VLM text filters; Jailbreaker (Deng et al., 2023) performs automatic jailbreaks across chatbots.
- Symbolic mathematics (Bethany et al., 2024) and persuasive prompts (Zeng et al., 2024) are listed in the introduction as attacks that can bypass existing defenses.
- The introduction also mentions prompt concatenation, context embedding manipulation, and using LLMs to generate adversarial prompts to attack commercial chat systems.
Defenses and evaluation resources
- Self-Reminder (Xie et al., 2023) uses self-reminders to defend ChatGPT against jailbreaks; Self-Guard (Wang et al., 2023) combines iterative self-evaluation with safety training.
- WildTeaming (Jiang et al., 2024) finds attack vectors from real interactions and improves defense data.
- Jailbreak taxonomies (Abhinav et al., 2023) and JailbreakBench (Chao et al., 2024) are cited in the introduction as formal analysis and robustness benchmarks.
BoN and method precursors
- Best-of-N Jailbreaking (Hughes et al., 2024) applies random augmentation to text, vision, and audio with repeated sampling. This paper recounts: with 10,000 samples, GPT-4o is 89% and Claude 3.5 Sonnet is 78%, and it bypasses circuit breakers (Zou et al., 2024).
- DATDP builds on the prompt evaluation approach of Gorman and Armstrong (2022) (Section 2).
- The conclusion links this paper to AI control (Greenblatt et al., 2023): using a smaller model to monitor a stronger model.
Test data: The experiments do not list other defenses as comparisons. The sets used are 159 harmful prompts from HarmBench, 1045 successful augmentations from the BoN repository, 1000 each of the authors' replicated successful and failed jailbreaks, 1590 random augmentations, and 250 normal prompts.
The authors position DATDP as a front-end evaluation agent to counter the text augmentations of [16]; and state that a small-model evaluator can intercept such prompts almost as well as a frontier-model evaluator.
How does the paper address this problem?
After a fixed number of evaluations, weight yes=+2 and no=-1; a positive score blocks and a strictly negative score allows.
DATDP places an evaluation agent before the answering model, repeatedly judges whether the user prompt is dangerous or a jailbreak attempt, and then decides to intercept or allow based on a weighted sum (Figure 1).
Pipeline
- The user prompt first enters the evaluation agent and is not directly given to the answering model.
- If judged harmful, an interception error message is returned; only if judged safe is an answer generated. Harmful includes dangerous content and jailbreak attempts.
- The figure caption states that evaluation continues until high confidence before routing. The main-text implementation is a fixed number of iterations followed by a weighted sum; the paper does not provide a separate confidence threshold.
- Figure 2: When the same LLaMa-3-8B-instruct serves as the answering model, it follows harmful requests with suggestions; as an evaluator, it intercepts and explains the reason. The figure outputs are not restated here.
Evaluation task
- The system prompt requires step-by-step reasoning and a final yes or no. yes indicates a forbidden_task.
- In the experiments, forbidden_task covers both "answering would be dangerous" and "intent to deceive or jailbreak." Section 2.1.2 has the English original; the sentence-format requirements are not listed here sentence by sentence.
- The user message contains only the prompt to be evaluated. Answers not ending in yes/no are excluded; the authors state this occurs with LLaMa, not Claude. The paper does not report the number of exclusions.
- The two evaluation models are Claude 3.5 Sonnet (API: claude-3-5-sonnet-20241022) and LLaMa-3-8B-instruct.
Iterative weighting
- LLaMa answers are unstable, so N=25 per item; the authors state Claude is more consistent, N=5.
- yes (reject) counts +2, no (accept) counts −1. A positive sum is judged harmful and rejected; a strictly negative sum is allowed. How a sum of 0 is handled is not written in the paper.
- The authors give an example: with N=5, two yes and three no gives a weighted sum of 1, so reject; one yes and four no gives a weighted sum of −2, so allow.
- The authors state this is a conservative rule: any small sign of harm tends toward rejection.
How test prompts were obtained
- Six sets: 159 from HarmBench (excluding copyright- and context-dependent behaviors); 1045 successful augmentations listed in the BoN paper; 1000 each randomly sampled from successful and failed jailbreaks in the replication experiment; 1590 random augmentations with 10 per base prompt; 250 normal prompts.
- Replicating [16] uses σ=0.25 and three text augmentations. 5000 per base prompt, totaling 795,000. LLaMa-3-8B-instruct answers, then the HarmBench auto-grader judges whether the original harmful behavior was achieved.
- The authors state that [16] used GPT-4o for that judgment; this paper uses LLaMa-3-8B-instruct for speed and cost. Of 795,000, 26,946 were judged successful and 768,054 failed, then 1000 each were sampled.
- The main evaluation checks whether the evaluator intercepts prompts it should intercept, not re-testing the answering model's attack success rate.
What experiments did the paper conduct?
BoN paper: 1045 items, both models 100% blocked; on unenhanced HarmBench, LLaMa is 98.74%.
Experimental Setup
- Evaluator: Claude 3.5 Sonnet (claude-3-5-sonnet-20241022), N=5; LLaMa-3-8B-instruct, N=25. yes scores +2, no scores −1.
- Data: HarmBench unenhanced 159; BoN successful enhancements 1,045; replicated successful and failed 1,000 each; random enhancements 1,590; normal prompts 250.
- Replication: σ=0.25, total 795,000; successful 26,946, failed 768,054. Harmfulness labels generated by LLaMa-3-8B-instruct running the HarmBench auto-grader, not GPT-4o from [16].
- Metrics: Table 1 is % blocked. The first five categories should be blocked; on normal prompts this proportion is false positives. 95% intervals use Clopper-Pearson (Table 2).
- Controls: The results table does not include interception rates for other defenses. The paper does not report the number of independent repetitions, nor the number of responses excluded due to format issues.
Main Results
Dataset (n) Claude LLaMa-3-8B-instruct HarmBench unenhanced (159) 100% 98.74% BoN paper successful jailbreaks (1045) 100% 100% Replicated successful jailbreaks (1000) 99.90% 99.80% Replicated non-jailbreak enhancements (1000) 99.50% 100% Random enhancements (1590) 99.94% 99.94% Normal prompts (250, % blocked) 0% 0.40% According to Table 1. The lower the last row, the fewer false positives. The replicated non-jailbreak set is still enhanced harmful prompts that should be blocked.
- The authors state that across the six groups, Claude is better in three, LLaMa better in one, and two are tied; looking only at enhanced prompts, one is better, one is worse, and two are tied (Section 3, 3.1).
- The abstract's 99.8% (CI [99.28%, 99.98%]) corresponds to LLaMa's replicated successful jailbreaks, not shared by both models. The CI for 100% on BoN samples is [99.65%, 100.00%] (Table 2).
- The authors state that the effect on the enhanced set is roughly constant at about 99.7%, expected not to change the exponent of the power law in [16], only multiply by a small scalar, making this jailbreak about 500 times harder. The paper does not report the recalculated attack success rate.
Unenhanced Prompts and Normal Prompts
- Figure 4's y-axis is the proportion of correct classifications, range 90%–100%. The caption title says Augmented Prompts, but the caption text and Section 3.2 refer to unenhanced HarmBench and normal prompts.
- LLaMa misses 2 in HarmBench, Claude blocks all. Appendix A.1 has the original text, not repeated here. The authors believe blocking enhanced prompts may be more effective than blocking unenhanced prompts.
- Interception CI for normal prompts: Claude [0.00%, 1.46%], LLaMa [0.01%, 2.21%] (Table 2). LLaMa falsely blocks 1. The authors say they can understand why it was blocked but still consider it a misclassification. That sentence is not repeated.
Self-Evaluation, Iteration, and Answer Side
- The authors state that the Claude evaluator blocks all prompts from [16], including those that jailbroke Claude; the paper does not give the count for that subset. The LLaMa evaluator blocks prompts that jailbroke its answer role, with the proportion being the replicated successful jailbreak row in Table 1.
- Figure 5 plots LLaMa's interception rate with N on the x-axis. The authors state that N=12 seems close to the N=25 used in the paper. The plain text does not give percentages for each point.
- When switching to evaluating answers, LLaMa blocks 760 out of 1,000 replicated jailbreaks. The authors call the preliminary results unsatisfactory and think the evaluator may be more lenient than the HarmBench auto-grader. The 3 missed on the prompt side are also blocked on the answer side (Section 4, A.3).
Other Ablations and Analyses
- The choices of weights +2/−1, σ=0.25, and N have no control experiment numbers; Figure 5's text does not give percentages for each N.
- Appendix A.3: In replicated successful jailbreaks, Claude misses 1, LLaMa misses 2. Enhanced text not repeated.
- Appendix A.4: In replicated non-jailbreaks, Claude misses 5, of which 4 have only 1 yes; the authors state that more conservative weighting would block these 4. The other 1 has no yes. LLaMa blocks all.
- Appendix A.5: Both models miss the same one out of 1,590, which is a different enhancement of the same original behavior as the one with no yes in A.4.
- Appendix A.2: Both models reject all 1,045, consistent with Table 1.
What are some points that can be further explored?
The authors state that vision and audio are left for future work, and the answer-side evaluation intercepted only 760/1000.
Limitations and future directions noted by the authors
- Visual and audio jailbreaks are left for future research (Section 1.1).
- The evaluation model can be fine-tuned for the task; the authors state that such improvements have not been fully tested (Section 4).
- Placing the evaluator after the answer: on 1,000 replicated jailbreaks, only 760 were intercepted; the authors state the preliminary result is not ideal (Section 4).
- The authors propose evaluating both the prompt and the answer, and adding a rewriting agent (translation round-trip or style rewriting). The rewriting option is written as a design that could be introduced; the paper does not provide experimental results for that option (Section 4).
Experimental coverage
- The evaluation models are Claude 3.5 Sonnet (N=5) and LLaMa-3-8B-instruct (N=25) (Section 3, Table 1).
- The six text sets have sizes 159, 1045, 1000, 1000, 1590, and 250 (Section 2.2.1).
- Replication augmentation uses σ=0.25 and three text augmentations, totaling 795,000 items before resampling (Section 2.2.2).
- Jailbreak labels are produced by running the HarmBench auto-grader with LLaMa-3-8B-instruct; the paper states that [16] used GPT-4o (Section 2.2.2).
- The main results are interception proportions and Clopper-Pearson 95% CIs (Table 1, Table 2). The paper does not report the number of excluded non-yes/no answers, nor comparison interception rates with other defense methods.
Summarize the main content of the paper
Both models block 100% of the 1,045 BoN successful samples; the LLaMa replicated jailbreak set is 99.80%.
DATDP is a prompt evaluation placed before the answer model, used to counter BoN-style text random enhancements.
- Problem: Repeated sampling with word scrambling, random capitalization, and ASCII noise can allow harmful prompts to bypass the model's own defenses. The authors aim to block both dangerous content and jailbreak attempts before generation.
- Approach: An evaluation LLM judges multiple times and ends with yes or no. yes scores +2, no scores −1; positive sum blocks, strictly negative sum allows. Claude 3.5 Sonnet runs 5 times per prompt, LLaMa-3-8B-instruct 25 times.
- Enhanced sets: On the 1,045 successful jailbreaks from the BoN paper, both evaluators achieve 100%, 95% CI [99.65%, 100.00%] (Table 2). On 1,000 replicated successful jailbreaks, Claude is 99.90% and LLaMa 99.80% (Table 1). The conclusion states that interception of enhanced prompts is between 99.5% and 100%.
- Exceptions: On unenhanced HarmBench, LLaMa is 98.74%, missing 2. On 250 normal prompts, Claude blocks 0% and LLaMa 0.40%. When evaluating answers, LLaMa only blocks 760/1000.
- Authors' conclusion: The authors state that the small model evaluator is nearly as effective as Claude at blocking enhanced prompts, and that the same model, when switched to the evaluation role, can block most prompts that would jailbreak its answer role. They believe this can be added before existing pipelines as a layer complementary to internal safety; vision, audio, and fine-tuning remain to be tested. The paper does not report cost or latency.