Skip to content
Conference Open access

RLShield: Dynamic Jailbreak Detection for LLMs via Reinforced Adaptive Learning

2026 · Annual Meeting of the Association for Computational Linguistics · pp. 23615-23630 · 0 citations · 40 references
Computer Science

TL;DR

RLShield is a dynamic jailbreak detection framework that employs reinforcement learning for adaptive threshold selection and incorporates three key innovations: a dynamic retrieval and LLM-based rewriting module to simulate diverse adversarial contexts; a cross-layer representation analysis to pinpoint safety-critical parameters; and a Soft Actor-Critic based agent that learns to predict optimal, sample-specific detection thresholds.

Abstract

While prompt engineering enhances the capabilities of Large Language Models (LLMs), it also exposes critical safety concerns. Due to the inherent brittleness of their static safety boundaries, LLMs are vulnerable to jailbreak prompts , i.e. adversarial inputs designed to by-pass safeguards and induce the generation of harmful content. Existing detection mechanisms rely on static model components or fixed decision thresholds, limiting their ability to generalize to evolving attack patterns and continual model updates. To bridge this gap, we propose RLShield , a dynamic jailbreak detection framework that employs reinforcement learning for adaptive threshold selection. RLShield incorporates three key innovations: ( i ) a dynamic retrieval and LLM-based rewriting module to simulate diverse adversarial contexts; ( ii ) a cross-layer representation analysis to pinpoint safety-critical parameters; and ( iii ) a Soft Actor-Critic (SAC) based agent that learns to predict optimal, sample-specific detection thresholds. Experimental results demonstrate that RLShield consistently outperforms state-of-the-art base-lines in detection performance while maintaining high computational efficiency. Notably, it improves F1 by up to 7.3%, while achieving an average of 3 × gain in inference efficiency across multiple LLM backbones. Our codes are available at this website.

Read PDF

Similar papers

Open access Aug 2026

D2ANN-RL: Defense-in-Depth ANN-Reinforcement Learning Framework for LLM Chatbot Code Injection Mitigation

A D2ANN-RL framework that integrates input/output sanitization, context isolation, sandboxing, and secure prompt engineering, supported by hybridization of Artificial Neural Network (ANN)–Reinforcement Learning (RL) detection model is introduced.

Victor Omoboye Oluwasegun, O. Falebita, Nabeela Temitayo Adebola et al. · 0 citations
Open access Aug 2026

You Are an Expert: RAG Injection and Guided Error Expert Activation for Jailbreaking Large Language Models

This work proposes a novel jailbreak framework: YAE, which enhances the model's dependency on external information by constructing a RAG‐based knowledge base containing harmful Q&A content and leverages Guide MoE, a routing‐inspired prompting strategy, to guide the model toward alternative reasoning trajectories through expert‐role prompting and domain‐specific perturbations.

Shun Zhang, Ying Ding, Yanxu Mao · 0 citations
Preprint Jul 2026

On-Policy Distillation for LLM Safety: A Routing Approach to Template-Robust Realignment

This work proposes Routing-based On-Policy Distillation (ROPD), a novel realignment framework that models the divergence between aligned and compromised output probability distributions rather than fitting specific prompt templates, establishing a new standard for robust LLM realignment.

Yongjian Guo, Wanlun Ma, Lingyu Shen et al. · 0 citations
Conference Open access 2026

SafetyMem: Adaptive Jailbreak Defense via Dual-Component Safety Memory

This work proposes Safet-yMem, a novel framework that secures LLMs through a dual-component safety memory sys-tem, and introduces an adversarial memory expansion mechanism that proactively generates challenging variants to solidify these memories.

Hao Wang, Ziyi Ni, Huacan Wang et al. · 0 citations
Jul 2026

A systematic evaluation of large language models for autonomous cyber defense

Overall, the results show that LLMs can produce competitive defense policies without fine-tuning but require manually engineered prompts, and their higher variance and slower response times could render them unsuitable for some real-world scenarios.

Thibaut Jacques · 0 citations