arXiv:2610.17313cs.CROct 2026

Manuscript Offprint

arXiv:2610.17313

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

Mohammad Reza Mirbagheri, Amir Mahdi Sadeghzadeh

MOHAMMAD REZA MIRBAGHERI*, Sharif University of Technology

AMIR MAHDI SADEGHZADEH, Sharif University of Technology

Aligned large language models (LLMs) remain vulnerable to jailbreak prompts that circumvent their safety guardrails, making the identification of these vulnerabilities important for understanding and mitigating model weaknesses. Existing automated jailbreak methods explore prompt candidates or reuse attack experience, but generally do not learn over a persistent hierarchy that connects related jailbreak strategies, such as role-play, encoding, and obfuscation. This leaves the relationships among reusable strategies underused in guiding adaptive attack selection. We present Tree-Guided Reinforcement-Augmented Probing (TRAP), a hierarchical framework for automated jailbreak strategy discovery that requires only black-box access to the target LLM. TRAP organizes established jailbreak methods and successful attack templates into a semantic strategy tree, connecting broad attack approaches to concrete, reusable strategies. A reinforcement-learning policy based on a tree-structured gradient bandit explores this tree and uses evaluator feedback to update strategy preferences along each selected path. The policy retains these preferences across attack objectives, allowing experience from earlier attempts to guide subsequent strategy selection. Retrieval-augmented prompt construction translates the selected strategy into an attack for the current objective using relevant successful examples. Experiments on AdvBench across seven aligned LLMs show that TRAP outperforms its counterparts on six models under the reported method settings and the common primary evaluator, achieving attack success rates of 45.6%–97.9% on these models. These findings support hierarchical strategy learning as an effective approach to discovering jailbreak vulnerabilities in aligned LLMs.

CCS Concepts: • Security and privacy → Systems security; • Computing methodologies → Reinforcement learning; Natural language processing.

Additional Key Words and Phrases: jailbreak attacks, safety alignment, large language models, gradient bandits, red teaming

Content Warning: This paper contains potentially offensive data and model outputs.

1 Introduction

Large language models (LLMs) now support chat systems, coding assistants, decision-support tools, and many other user-facing applications. As these systems become more widely used, failures of their safety mechanisms carry greater consequences. Recent studies show that adversarial prompts, including small changes to natural-language inputs, can alter the behavior of aligned models and elicit harmful, policy-violating, or otherwise unintended outputs. Automated red teaming uses algorithmically generated adversarial inputs and model feedback to discover safety vulnerabilities with reduced manual intervention [1,12][1, 12].

Among these threats, jailbreak attacks have emerged as a particularly important class of adversarial attacks against LLMs. These attacks aim to circumvent safety guardrails by exploiting weaknesses in instruction following, contextual reasoning, or alignment objectives. Jailbreak attacks can manipulate the wording and context of natural-language inputs, allowing them to transfer across some settings and making them difficult to detect reliably. A jailbreak strategy is an objective-independent approach to framing or transforming an input to circumvent safety guardrails. Prior

∗^{*}Corresponding author.

Authors' Contact Information: Mohammad Reza Mirbagheri, reza.mirbagheri135@sharif.edu, Department of Computer Engineering, Sharif University of Technology, Tehran, Iran; Amir Mahdi Sadeghzadeh, sadeghzadeh@sharif.edu, Department of Computer Engineering, Sharif University of Technology, Tehran, Iran.

Mirbagheri and Sadeghzadeh

studies have demonstrated a variety of such strategies, including role-playing, obfuscation, prompt injection, and indirect instruction manipulation [9, 10, 20, 24].

Recent advances have moved from manual prompt engineering toward automated and structured jailbreak generation. Search-based approaches iteratively refine prompts using feedback from target models [12, 24]; fuzzing-inspired frameworks explore prompt mutations [22]; reinforcement-learning approaches learn adaptive attack policies [2, 7, 15]; and lifelong systems reuse discovered strategies across tasks and models [8]. Broader surveys and benchmark frameworks further show that the jailbreak literature now spans suffix optimization, prompt rewriting, role-play, encoding and transformation attacks, tree search, attacker-model refinement, and reusable attack repositories [5, 11, 21, 23].

Despite this progress, existing methods generally organize search around prompt candidates or per-objective attack trees rather than a persistent hierarchy of reusable jailbreak strategies. A broad strategy is often refined through several related decisions before it becomes a concrete prompt, yet prompt-level optimization does not explicitly represent these relationships or share feedback through them. Learning-based selection can adapt exploration, but selection over independent strategy preferences does not explicitly share feedback across related decisions. Retrieval and memory support reuse of successful prompts or demonstrations, but do not by themselves connect that experience to a learned policy over strategy paths. This leaves a gap between organizing reusable strategies, learning which strategies expose target-model weaknesses, and using prior experience to instantiate them.

This paper proposes Tree-Guided Reinforcement-Augmented Probing (TRAP), a hierarchical framework for automated jailbreak strategy discovery against aligned LLMs. TRAP consolidates successful jailbreak templates and documented attack methods into a reusable strategy tree. The tree captures relationships among strategies and lets the policy explore complete paths through the attack space. TRAP models path selection as a gradient-bandit problem, propagates judge feedback through the selected path, and retains the learned policy across objectives. During prompt construction, retrieval reuses relevant experience drawn from successful outputs of other methods, public jailbreak examples, and successful manual attempts. TRAP separates strategy selection from prompt construction. This design combines structured exploration, experience reuse, model-assisted prompt construction, and auditable path-level decisions in one optimization loop.

TRAP has been evaluated on seven aligned LLMs in a single-turn, text-only black-box setting. The external baselines cover evolutionary optimization (AutoDAN), attacker-model refinement (PAIR), transformation heuristics (FlipAttack), and tree search (TAP). Under a common evaluator, TRAP achieves the highest observed ASR on six target models. Ablation experiments examine the contributions of the strategy hierarchy and retrieval to the framework.

The main contributions of this paper are summarized as follows:

(1) Curated Hierarchical Strategy Space: TRAP consolidates documented jailbreak methods and successful attack templates into an objective-independent hierarchy with 11 active families and 164 executable leaves, allowing related strategies to share structure across several levels of abstraction.

(2) Adaptive and Auditable Strategy Learning: TRAP uses reinforcement learning to learn a shared gradient-bandit policy over complete strategy paths, assigns feedback through the selected hierarchy, and combines the chosen strategy with retrieval and model-assisted prompt construction. The learned strategy preferences provide an evaluator-based indication of the target model's relative vulnerability to different strategies. The selected path remains available for inspection.

(3) Evaluation Across Target Models: We compare TRAP with four algorithmically distinct baselines across seven aligned LLMs under a common evaluator, and use controlled variants to separate the effects of hierarchy and retrieval.

(4) Hybrid and Multi-Judge Evaluation: We introduce a prompt- and response-sensitive hybrid evaluator, repeat TRAP across seeds, compare method rankings across nine automated judging procedures, and validate their decisions against blinded human labels obtained by majority vote.

The core implementation is available on GitHub. 1^{1}

The remainder of this paper is organized as follows. Section 2 reviews related work. Section 3 presents the TRAP framework, and Section 4 reports the experimental evaluation and ablation studies. Section 5 discusses ethical considerations, and Section 6 concludes the paper.

References (9)