RLShield: Dynamic Jailbreak Detection for LLMs via Reinforced Adaptive Learning
Zhao Tong, Pengfei Yang, Yimeng Gu, Haichao Shi, Qiang Liu, Xingcheng Xu, Shu Wu, Xiao-Yu Zhang
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 bypass 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 baselines 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.- Anthology ID:
- 2026.findings-acl.1182
- Volume:
- Findings of the Association for Computational Linguistics: ACL 2026
- Month:
- July
- Year:
- 2026
- Address:
- San Diego, California, United States
- Editors:
- Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
- Venue:
- Findings
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 23615–23630
- Language:
- URL:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.1182/
- DOI:
- Cite (ACL):
- Zhao Tong, Pengfei Yang, Yimeng Gu, Haichao Shi, Qiang Liu, Xingcheng Xu, Shu Wu, and Xiao-Yu Zhang. 2026. RLShield: Dynamic Jailbreak Detection for LLMs via Reinforced Adaptive Learning. In Findings of the Association for Computational Linguistics: ACL 2026, pages 23615–23630, San Diego, California, United States. Association for Computational Linguistics.
- Cite (Informal):
- RLShield: Dynamic Jailbreak Detection for LLMs via Reinforced Adaptive Learning (Tong et al., Findings 2026)
- PDF:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.1182.pdf