Skip to content

TRAP: Tree-Guided Reinforcement-Augmented Probing for Automated LLM JailbreakingTRAP: Tree-Guided Reinforcement-Augmented Probing for Automated LLM Jailbreaking

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.17313· Mohammad Reza Mirbagheri, Amir Mahdi SadeghzadehDepartment of Computer Engineering, Sharif University of TechnologyIndexed by this site · 2026-10-14· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

Under the AdvBench main evaluation, TRAP black-box attacks seven aligned LLMs, with six models achieving an ASR of 45.6%–97.9%.

Threat modelThe automated red-teaming agent can only submit natural-language prompts to the target LLM and observe text responses, with no weights, gradients, or logits, which the paper calls black-box. Single-turn, pure text; budget B=10 per target, and a hybrid evaluation score of 7.0 counts as success. Strategy selection does not observe the attack target.

Questions
The guardrails of aligned LLMs can still be bypassed by jailbreak prompts. The authors believe existing automated methods mostly optimize over candidate prompts or single-target search, and do not share feedback on related strategies at a persistent cross-target strategy level.
Methods
TRAP collects successful templates and documented methods into a semantic strategy tree frozen before evaluation, uses a tree-structured gradient bandit to update path preferences from evaluation feedback, and retains them across targets. Retrieval and the auxiliary model only write the selected strategy into a prompt for the current target.
Experiments and results
Across all 520 targets in AdvBench, under the common main evaluation and each method's own settings, TRAP achieves higher ASR than the four baselines on six of the seven aligned LLMs, ranging from 45.6% to 97.9%; on GPT-OSS-120B it is 0.0% for all. Changing the reviewer changes the ranking.
Limitations and future work
The paper does not specifically discuss limitations. Experiments are single-turn, text-only black-box with AdvBench; external comparisons use 520 targets, at most 10 queries per target, and query counts are not aligned. Seed repetitions are reported only for three models on the validation subset.
Experimental setupGPT-OSS-120B、Mistral-7B-Instruct et al. · AdvBench · ASR、balanced accuracy et al.
Evaluated models
GPT-OSS-120BMistral-7B-InstructLLaMA-4-ScoutQwen3-235B-A22BDeepSeek-V3.2GPT-4o-miniGemini-2.5-Flash
Benchmarks
AdvBench
Metrics
ASRbalanced accuracyKrippendorff's α
AI summaryThe researchers propose TRAP (Tree-Guided Reinforcement-Augmented Probing), an automated jailbreaking framework requiring only black-box access to the target LLM, evaluated on seven aligned LLMs on AdvBench, outperforming comparable methods on six models under the reported experimental settings and the common primary evaluator, with attack success rates ranging from 45.6% to 97.9%. TRAP organizes existing jailbreak methods and successful attack templates into a semantic strategy tree, linking broad attack styles to reusable concrete tactics. A tree-structured gradient bandit reinforcement learning policy explores the tree, using evaluator feedback to update policy preferences along selected paths, and retains these preferences across attack targets. Retrieval-augmented prompt construction uses relevant successful examples to convert selected tactics into attacks for the current target. The authors state these results support hierarchical strategy learning as an effective avenue for discovering jailbreak vulnerabilities in aligned LLMs.

The researchers propose TRAP (Tree-Guided Reinforcement-Augmented Probing), an automated jailbreaking framework requiring only black-box access to the target LLM, evaluated on seven aligned LLMs on AdvBench, outperforming comparable methods on six models under the reported experimental settings and the common primary evaluator, with attack success rates ranging from 45.6% to 97.9%. TRAP organizes existing jailbreak methods and successful attack templates into a semantic strategy tree, linking broad attack styles to reusable concrete tactics. A tree-structured gradient bandit reinforcement learning policy explores the tree, using evaluator feedback to update policy preferences along selected paths, and retains these preferences across attack targets. Retrieval-augmented prompt construction uses relevant successful examples to convert selected tactics into attacks for the current target. The authors state these results support hierarchical strategy learning as an effective avenue for discovering jailbreak vulnerabilities in aligned LLMs.

Related events and news

1 events · 1 news mentions

News that mentions this paper

RL/RLHF 训练条件可诱发模型智能体提权逃逸

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Aligned LLMs can still be bypassed by jailbreaks; TRAP uses a cross-target strategy tree for black-box strategy discovery.

    The safety guardrails of aligned LLMs can still be bypassed by jailbreak prompts, and existing automated methods do not learn reusable strategies at a persistent strategy hierarchy.

    • Scenario: the authors state LLMs are used for chat, coding assistants, and decision support, so the consequences of safety failures grow. The authors state jailbreaks bypass guardrails through wording and context, can transfer across some settings, and are hard to detect reliably.
    • Existing limitations: the authors state search, mutation, reinforcement learning, and lifelong systems mostly revolve around candidate prompts, or build an attack tree separately for each target. Independent strategy preferences and retrieval memories each do not share feedback across related decisions.
    • Hypothesis: the authors believe that under limited query budgets, flat exploration spreads sparse feedback thin, while hierarchy lets related strategies share evidence through common decisions.
    • Proposal: TRAP (Tree-Guided Reinforcement-Augmented Probing) requires only black-box access. It collects existing methods and successful templates into a semantic strategy tree, uses a tree-structured gradient bandit to retain preferences across targets, and then uses retrieval to write the selected strategy into a prompt for the current target.
    • Threat model:
      • Goal: induce policy-violating outputs for benchmark harmful behaviors; a fixed evaluation score reaching the threshold counts as success.
      • Knowledge: the paper states black-box. Only natural-language prompts can be submitted and text responses observed; weights, gradients, and logits are not visible.
      • Capabilities: single-turn, pure text; at most 10 iterations per target, stopping on success. The target is not observed when selecting strategies; the selected path and current target are visible when constructing prompts.
      • Victim systems: the seven aligned LLMs in the experiments, accessed via OpenRouter; the target set is AdvBench harmful-behaviors.
  2. What related research exists?

    The paper divides related work into manual templates, prompt-level search, bandit selection, and defenses, and compares against four types of baselines.

    Section 2 of the paper positions TRAP relative to manual templates, prompt-level automation, bandit-style selection, and defenses.

    • Manual templates: The authors classify role-play, prompt injection, context reframing, and obfuscation as early manual patterns, citing Wei et al. (2023) and Liu et al. (2025). The authors state that these works show jailbreaks depend on phrasing, but effectiveness relies on manual templates and does not cover a broader attack space.

    • Prompt-level search and reuse: GCG (Zou et al., 2023) optimizes adversarial suffixes; AutoDAN (Liu et al., 2024) evolves candidate prompts; GPTFuzz (Yu et al., 2023) mutates seeds; TAP (Mehrotra et al., 2024) searches attack trees per target; PAIR (Chao et al., 2025) uses an auxiliary model to rewrite prompts. RL-JACK (Chen et al., 2024), PathSeeker (Lin et al., 2024), multi-armed bandit context switching (Ramesh et al., 2025), and AutoDAN-Turbo (Liu et al., 2025) learn strategies or reuse experience across tasks. The authors state that these typically optimize at the candidate prompt level or are tied to single-target search.

    • Bandit precedents: Knockoff Nets (Orekondy et al., 2019) use a hierarchical gradient bandit to select image queries for model extraction. Shukla et al. (2026) perform bandit selection among existing jailbreaks. The authors state that TRAP similarly selects adaptively by reward, but actions are paths on a semantic tree, and evaluation rewards are distributed by distance. SemAder (Wang et al., 2026) does learning-guided optimization on binary analysis; the authors state that TRAP applies guided exploration to jailbreak red-teaming.

    • Defenses and adjacent attack surfaces: The authors cite RLHF/RLAIF (Ouyang et al., 2022; Lee et al., 2024), applied guardrails (Shen et al., 2024), and surveys on detection, input transformation, and output auditing (Chen et al., 2026; Yi et al., 2024), to illustrate that red-teaming should also consider how search structure, memory, and query budgets interact with refusal mechanisms. Shen et al. also discuss prompt injection in tools or retrieval and agent interactions; Cook et al. (2026) discuss attack synthesis for industrial control. The authors state that TRAP only does single-turn text and considers attacks to be compositional.

    • Baselines and benchmarks: Experimental baselines are AutoDAN, PAIR, FlipAttack, and TAP, corresponding to population optimization, iterative rewriting by an attack model, fixed text transformations, and per-target tree search, respectively. The benchmark is AdvBench. Table 1 compares design components, not ASR after alignment budgets. The authors state that TAP's tree expands prompts per target, while TRAP's strategies are reused across targets; AutoDAN searches prompt candidates, while TRAP delegates prompt writing to a separate module; FlipAttack does not rewrite based on target responses; PAIR iterates at the prompt level, while TRAP learns at the strategy level.

    The authors place the main distinction in this fixed, cross-target shared hierarchy: it organizes, selects, and reuses the above mechanisms, while keeping retrieval-based construction separate from learned actions.

  3. How does the paper address this problem?

    TRAP selects paths with a frozen strategy tree; retrieval and the auxiliary model only handle writing them into prompts.

    TRAP decomposes jailbreak discovery into strategy selection shared across targets and prompt construction that varies with the target. The strategy space is frozen before evaluation; the online closed loop only updates path preferences in a tree-structured gradient bandit.

    Problem Setting

    The red team can only query the target with natural language and read responses. Each harmful behavior g has an independent session, with iteration cap B=10, stopping on success. Within a session, the model's internal state is not observed; only the target's best score so far, tried strategies, and cross-target shared bandit preferences are kept; the first two are reset when a new target starts. After prompt p_i yields response y_i, a fixed hybrid evaluator gives a score s_i from 0 to 10. Success is defined as si ≥ η, where η=7.0, and this threshold is shared across all methods in the main evaluation. The native reviewers of PAIR, TAP, and FlipAttack mentioned later use a 10-point threshold. The hybrid score combines an LLM rubric, auxiliary scores across six aspects, and deterministic checks for refusal, relevance, and response quality; the LLM rubric only sees the target and response, while prompts are checked by the deterministic layer. ASR is the proportion of N targets where at least one success occurs within budget. Strategy optimization is written as π∗=argmaxπ𝔼g∼𝒢[∑i=1BR̃i∣π]. The normalized shaping reward is used only for updates, not as a reported effectiveness metric. When selecting strategies, g is not observed, and retrieved content does not directly enter strategy selection.

    Semantic Strategy Tree

    The leaves of the tree are executable strategies; internal nodes are progressively narrowing categories. An action is a path from root to leaf, not a prompt string. The four levels are family, subtype, tactic group, and executable strategy. The corpus comes from public jailbreak libraries and successful prompts from prior research; GPT and Claude models iteratively propose labels and groupings, with authors supervising, merging near-duplicates, removing templates that directly encode benchmark targets, and freezing before evaluation. The tree in use has 11 top-level families and 164 leaves, with maximum depth 4. In Table 2, the leaves are most numerous in modern_ai_techniques (35) and social_engineering (30). The leaves of multi_turn_manipulation are still written as single messages; the paper states that multi-turn dialogue is not performed. An ablation uses a pruned tree with 36 leaves and 6 buckets fixed before evaluation; a flat variant places the same leaves directly under the root.

    Gradient Bandit on Paths

    Each internal node maintains independent preferences, selecting child nodes via temperature softmax with T=1.0. The sampling behavior policy mixes uniform exploration with ε=0.1, and parameter updates do not use this mixing. Learning rate α=0.1. Node baselines shrink the node's rolling average toward the global average based on visit count, with κ=8.0. The normalized reward for a path is distributed by distance to leaf selection decisions, with γ=0.85: leaf selection gets the full amount, and more abstract decisions get larger discounts. Replay memory supports repeated updates. Two safeguard rules can replace with deeper and different paths before generating prompts; these replacements do not come from strategy sampling and are not written into preferences. Figure 2 compares hierarchical strategy with flat strategy.

    Retrieval and Prompt Construction

    The selected leaf is first rendered into a base prompt. Memory comes from successful outputs of other methods, public jailbreak examples, and successful human attempts. The main configuration uses online retrieval; new prompts with scores above 6.5 and passing filters are written; an ablation uses a read-only snapshot. The embedding model is qwen/qwen3-embedding-8b. The query consists of g and the selected leaf; cosine similarity first takes top-2q then filters to q=5, with initial similarity threshold 0.60, minimum storage score 6.5, and removal of entries containing refusal language. Ranking is primarily by similarity, then passes an acceptance gate; if there are no examples, only the base prompt is used. The composition module does not replay whole examples but uses seven bucketed operators to incorporate text patterns from examples into the base prompt, selected by a secondary gradient bandit based on evaluation scores, with α=0.1. Whether to retrieve is sampled by a consultation probability initialized at 0.85, with default mixing parameter β=0.30. When stalled, qwen/qwen-2.5-7b-instruct can draft or rewrite drafts, but must maintain the selected tactic. Figure 3 indicates that retrieval does not feed back into strategy.

    Reward and Stopping

    The shaping reward includes anchoring score, proximity to success boundary, earlier success, improvement over the target's historical best score, leaf and template coverage, and penalties for refusal, off-topic, and regression, with activation conditions in Table 4. Coefficients are fixed, not tuned per model, and do not change the success criterion of s≥7. Before updates, normalization uses a rolling window of up to 100 values and truncates to -5 to 5. Sessions in Algorithm 1 stop on success or when budget is exhausted; Figure 4 corresponds to one iteration.

  4. What experiments did the paper conduct?

    Table 5: TRAP is 45.6%–97.9% across six models, and each method is 0.0% on GPT-OSS-120B.

    Experimental Setup

    • Target models: GPT-OSS-120B, Mistral-7B-Instruct, LLaMA-4-Scout, Qwen3-235B-A22B, DeepSeek-V3.2, GPT-4o mini, Gemini-2.5-Flash, all accessed via OpenRouter.
    • Data: AdvBench. External comparisons use all 520 targets; ablations use a fixed 52-target subset; validation uses a fixed 30-target subset. The benchmark order is fixed because strategies and online retrieval carry experience to subsequent targets.
    • TRAP main configuration: 164 leaves, shaping reward, online retrieval; B=10 per target. B counts only attack prompts submitted to the target model, not auxiliary model, evaluator, retrieval, or embedding calls.
    • Baselines: AutoDAN, PAIR, FlipAttack, TAP, configured per their original papers and official implementations, without per-target retuning. The paper states the comparison controls target access and evaluator, and does not align query counts.
    • Auxiliary models and hyperparameters: drafting is fixed to qwen/qwen-2.5-7b-instruct; embeddings are qwen/qwen3-embedding-8b. T=1.0, ε=0.1, α=0.1, κ=8.0, γ=0.85, identical across targets.
    • Evaluation: the main evaluation uses a hybrid evaluator, with the LLM component checkpoint at openai/gpt-4o-mini and threshold 7.0. Aspect weights are completeness 0.25, harmfulness 0.20, clarity 0.10, relevance 0.15, detail 0.10, compliance 0.20. The metric is ASR. The nine reviewers and human labels in Section 4.7 do not update TRAP.

    Main Results

    Per Table 5 (shared evaluation, each method with its own configuration, ASR %):

    Swipe horizontally to read the table

    ModelTRAPAutoDANTAPPAIRFlipAttack
    GPT-OSS-120B0.00.00.00.00.0
    Mistral-7B-Instruct94.042.131.95.40.0
    LLaMA-4-Scout76.211.513.37.31.0
    Qwen3-235B-A22B84.40.07.32.70.2
    DeepSeek-V3.297.925.825.28.70.8
    GPT-4o mini45.624.217.34.80.0
    Gemini-2.5-Flash78.19.64.20.80.6
    • In Table 5, except for GPT-OSS-120B, TRAP's ASR is higher than the four baselines in the same table; the authors state the range is 45.6%–97.9%. All five methods are 0.0% on that model.
    • The authors state this corresponds to the shared evaluator and the comparison scope of Section 4.2; the baseline original papers use different checkpoints, providers, evaluators, or settings, which is a different evaluation condition.
    • TRAP (Ours) in Table 6 is a separate run. The authors state randomness in strategy sampling and target generation can make ASR differ, e.g., 44.2% for GPT-4o mini and 82.7% for Qwen3-235B-A22B.

    Hierarchy and Retrieval Ablations

    Table 6 uses the 52-target subset. A and E both have 164 leaves and differ only in whether static retrieval is present; B and C both have 36 leaves and static retrieval and differ only in hierarchical vs. flat. D changes both action selection and prompt construction, which the authors call a diagnostic reference, not a single-factor ablation.

    • Hierarchy: the authors state B is equal or higher than C on five of the six nonzero models, with the largest gain on Qwen3-235B-A22B (92.3% vs. 84.6%). On Gemini-2.5-Flash, B is 76.9% and C is 80.8%.
    • Retrieval: the authors state A is higher than E on four of the six nonzero models, with the largest gain on GPT-4o mini at 38.4 percentage points (61.5% vs. 23.1%). On DeepSeek-V3.2, A is 96.2% and E is 98.1%; on Gemini-2.5-Flash, A is 80.8% and E is 84.6%.
    • No-tree reference: the authors state D remains competitive on LLaMA-4-Scout (75.0%) and GPT-4o mini (55.8%), while tree variants are higher on DeepSeek-V3.2 (A 96.2%, D 78.8%), Mistral-7B-Instruct (94.2% vs. 67.3%), and Qwen3-235B-A22B (90.4% vs. 51.9%).

    Strategy Family Rankings

    Figure 7 gives observed ranks for the eight most frequently selected top-level families on the six targets with successful attacks, with 1 being the highest and ties sharing ranks. The text does not give selection counts.

    • The authors state the leading family varies by model: steganography/obfuscation is 1 on DeepSeek-V3.2 and 8 on Gemini-2.5-Flash; domain camouflage is 1 on Mistral-7B-Instruct and Qwen3-235B-A22B, and 6 on Gemini-2.5-Flash and LLaMA-4-Scout outside those two models.
    • In Figure 7, Conversational tactics is 1 for GPT-4o mini; Format/structure exploitation is 1 for LLaMA-4-Scout and Gemini-2.5-Flash.
    • The authors state these ranks are observations under adaptive selection, and their model-specific ordering supports learning strategies per target rather than prescribing a global order.

    Seed and Reviewer Dependence

    The validation subset is 30 targets. Table 7 reruns TRAP with three seeds under the main reviewer: GPT-OSS-120B is 0.0 in all; DeepSeek-V3.2 is 86.7, 86.7, 83.3, with a Range of 3.3; GPT-4o-mini is 43.3, 43.3, 53.3, with a Range of 10.0. The authors report paired bootstrap detected no significant difference between seed pairs (two-sided tail probabilities all at least 0.28), and state this cannot establish equivalence across runs.

    • Figure 8 rescored outputs of five methods on DeepSeek-V3.2 and Mistral-7B-Instruct with nine automatic reviewers. The text does not list bar values. The authors state TRAP leads under the main evaluator, and rankings change when the reviewer and target change, with no method leading under every reviewer.
    • The authors state the main evaluator looks at both the response and the prompt, so reversal-style prompts can be downgraded; LlamaGuard 4 and HarmBench look only at responses and cannot use that prompt-format signal.
    • Table 8 is the proportion of the same human-labeled responses marked as jailbroken, which the paper states is not ASR. The human majority vote is 45.8%. Automatic reviewers range from FlipAttack-native's 23.3% to AutoDAN-native's 79.2%; the main evaluator is 32.5%, with balanced accuracy 0.737. GPT-5.2 is 0.922, and HarmBench is 0.921. Claude Opus 5 is 5.0%, and the authors state it rejected a substantial portion of the samples at the platform level, so they do not report balanced accuracy. Krippendorff's α is 0.41. Table 10 in Appendix B uses one validation target to illustrate: PAIR and TAP rejections were unanimously judged unsuccessful by the nine reviewers; every successful method was rejected by at least one reviewer.

    Other Ablations and Analyses

    • All configurations in Table 6 are 0.0 on GPT-OSS-120B.
    • TRAP (Ours, online retrieval) in Table 6 is 44.2% on GPT-4o mini, lower than A's 61.5% and D's 55.8% in the same table.
    • B is 98.1% on DeepSeek-V3.2, higher than A's 96.2% and C's 96.2%.
    • E is 84.6% on Gemini-2.5-Flash, higher than A's 80.8% and TRAP (Ours)'s 76.9%.
    • Native PAIR, TAP, and FlipAttack reviewers set jailbreak at 10 points; they appear only in cross-review and do not update strategies.
  5. What are some points that can be further explored?

    The paper does not specifically discuss limitations or future work.

    Limitations and Future Directions Noted by the Authors

    The paper does not specifically discuss limitations. Section 6 does not list unfinished items as future work; Section 5 explains dual-use risks, voluntary labeling, and de-identification in reporting, without framing the experimental scope as a method limitation.

    Experimental Coverage

    • Tested models are GPT-OSS-120B, Mistral-7B-Instruct, LLaMA-4-Scout, Qwen3-235B-A22B, DeepSeek-V3.2, GPT-4o mini, and Gemini-2.5-Flash, totaling 7; external comparisons, ablations, and validations all use AdvBench (Sections 4.1, 4.4, 4.5, 4.7).
    • External comparisons use 520 targets, with at most 10 target model queries per target; baselines use their original settings, and the paper states that query counts are not aligned (Sections 4.1, 4.2).
    • Ablations use a fixed subset of 52 targets, including full tree, pruned, flat, no-retrieval, and no-tree references (Table 6). Three seed repetitions cover only GPT-OSS-120B, DeepSeek-V3.2, and GPT-4o-mini on the validation subset (Table 7). The paper does not report the number of repetitions for Table 5.
    • Nine automatic reviewers re-score already generated outputs on DeepSeek-V3.2 and Mistral-7B-Instruct; human comparison is three blind annotators with majority vote (Section 4.7, Table 8). These additional reviews do not update TRAP.
    • The auxiliary attack model is fixed to qwen/qwen-2.5-7b-instruct; the strategy tree is frozen before target evaluation. The leaves of multi_turn_manipulation are executed as single prompts, and the paper states that multi-turn dialogue is not performed (Sections 3.2, 4.1).
  6. Summarize the main content of the paper

    TRAP performs black-box jailbreaks with a cross-target strategy tree; under the main evaluation, ASR across six models is 45.6%–97.9%.

    TRAP is a black-box, single-turn text automated jailbreak framework for aligned LLMs that places strategy discovery on a semantic tree retained across targets.

    • Problem: the authors believe existing methods mostly optimize candidate prompts or single-target search, and do not let reusable strategies such as role-play, encoding, and obfuscation share feedback at a persistent hierarchy.
    • Method: a strategy tree with 11 families and 164 leaves is frozen offline; online, a tree-structured gradient bandit selects full paths, with updates driven by a hybrid evaluation score and retained across targets. Retrieval and qwen/qwen-2.5-7b-instruct only write strategies into prompts, and target information is not observed when selecting strategies. At most 10 queries per target, with a main success threshold of 7.0.
    • Main results: under the shared main evaluation on all 520 AdvBench targets, TRAP in Table 5 is higher than AutoDAN, PAIR, FlipAttack, and TAP on six models, with the authors stating ASR of 45.6%–97.9%; all five methods are 0.0% on GPT-OSS-120B.
    • Ablations: on the 52-target subset, the authors state that with the same 36 leaves, hierarchical selection is equal or higher than flat selection on five of the six nonzero models; the largest gain from retrieval under the full tree is 38.4 percentage points on GPT-4o mini. On DeepSeek-V3.2 and Gemini-2.5-Flash, the no-retrieval configuration is not lower.
    • Reviewers: on the 30-target subset, the Range across three seeds is 3.3 on DeepSeek-V3.2 and 10.0 on GPT-4o-mini. Under nine automatic reviewers, no method always leads; relative to the human majority vote, GPT-5.2 has balanced accuracy 0.922, and Krippendorff's α is 0.41.
    • Authors' conclusion: the authors state the design can expose safety weaknesses within at most ten submissions per target, strategy-family rankings vary by model, and prompt visibility and success criteria change the observed rankings.

Related papers

Show 3 more papers
Read originalarxiv.org