The Research Report
Recursive Language Models for Jailbreak Detection: A Procedural Defense for Tool-Augmented Agents
Silverfort's RLM-JB framework treats jailbreak detection as a bounded analysis procedure rather than a one-shot classification, achieving 98% recall with 99% precision on AutoDAN-style attacks.
The Multi-Turn Jailbreak Problem
Jailbreak attacks have evolved. The early examples were crude, one-line commands asking AI models to "ignore previous instructions." Modern variants are far more sophisticated. They exploit long-context hiding, semantic camouflage, and split payloads that unfold across multiple conversation turns. They blend into benign traffic. They wrap harmful requests inside role-play scenarios or encode them in Base64 strings. They patience a model through dozens of clean turns before delivering a payload in the middle of a long context window.
This is not a theoretical concern. AutoDAN-style attacks, which use automated optimization to generate stealthy jailbreak prompts, have demonstrated high success rates against unprotected systems. Real-world prompt injection catalogs document techniques that transfer across models and tasks. In agentic systems where LLMs execute tools over untrusted content, a successful jailbreak can mean unauthorized email access, improper financial transactions, or policy-violating actions in sensitive workflows.
The fundamental problem is that traditional defenses treat jailbreak detection as a classification task. A model sees an input. It outputs malicious or benign. Done. This approach fails against attacks that distribute their harmful intent across time, structure, or encoding layers.
Why Per-Message Classifiers Fall Short
A single-pass classifier scanning each message independently cannot defend against multi-turn attacks for several reasons.
Long-context hiding places the harmful payload in the middle of a long, benign-seeming context. Attention mechanisms can deprioritize the center of long inputs, a phenomenon researchers call "lost in the middle." A classifier that processes the full context may still miss the attack because the signal is buried.
Semantic camouflage wraps jailbreak intent inside seemingly innocent framing. A request to "help me write a fictional scene where a character bypasses security" might seem harmless in isolation. A classifier sees nothing wrong. But when combined with other elements in a multi-turn conversation, the framing enables harmful content generation.
Split payloads distribute attack components across separate messages. The preamble establishing a role-play scenario arrives in one turn. The instruction to ignore safety guidelines arrives in another. The actual harmful request arrives in a third. No single message contains enough signal to trigger a classifier.
Encoding and obfuscation hide intent behind transformations like Base64 encoding, character substitution, or nested instructions. A classifier that does not decode and re-analyze will miss attacks hiding in plain sight.
Conversational grooming builds trust and context incrementally. Early turns establish a persona or scenario. Later turns escalate within that established frame. By the time the harmful request arrives, the context makes it seem like a natural continuation rather than a jailbreak.
Standard per-message classifiers address none of these patterns. They make binary decisions on isolated inputs. They lack the machinery to normalize, decode, chunk, and recombine signals across an input's structure.
Recursive Language Models: A Procedural Approach
Silverfort's RLM-JB framework, described in arXiv:2602.16520, takes a fundamentally different approach. It treats jailbreak detection as a bounded analysis procedure executed by a root model that orchestrates worker models, code execution, and iterative state updates.
The core idea comes from Recursive Language Models, which couple an LLM with a constrained sandbox environment. Rather than making a single pass over an input, an RLM externalizes computation into a program. The root model writes code, calls sub-models on specific segments, collects results, and aggregates evidence into a decision. Every step produces an intermediate artifact that can be audited.
This architecture maps naturally onto jailbreak defense. The detection procedure has distinct stages, each addressing a known attack vector.
Stage one: normalization and de-obfuscation. The root model applies lightweight canonicalization, normalizing whitespace and separators so that formatting tricks do not affect downstream analysis. When it detects high-signal encoding patterns like Base64-like spans, it attempts decoding and carries both the original and decoded representations forward.
Stage two: coverage-guaranteeing chunking. Long inputs are split into overlapping segments. Each segment is screened independently. This step directly counters long-context hiding and "lost in the middle" effects. Because every chunk receives dedicated analysis, no portion of the input can hide by burying itself in context.
Stage three: parallel chunk screening. Worker models analyze each chunk independently, returning a structured assessment that includes a malicious or benign verdict, a confidence score, and extracted signals such as instruction hijacking cues, persona escalation prompts, or tool-manipulation attempts. Screening is parallelizable, making the procedure efficient despite multiple passes.
Stage four: compositional evidence aggregation. The root model examines segment-level evidence to recover split-payload structures. If one segment supplies an "ignore instructions" preamble while another contains the actionable payload, the aggregator links them into a single attack hypothesis. The final verdict includes a concise explanation backed by specific evidence.
What the Numbers Show
RLM-JB was evaluated on AutoDAN-style benchmarks across three LLM backends: DeepSeek-V3.2, GPT-4o, and GPT-5.2. The results reveal a practical sensitivity-specificity trade-off.
On the core detection metrics, RLM-JB achieves high recall across all backends: 92.5% with DeepSeek-V3.2, 97.0% with GPT-4o, and 98.0% with GPT-5.2. Precision remains near-saturated: 100.00%, 99.74%, and 98.99% respectively. False positive rates on synthetic benign prompts range from 0.0% to 2.0%, with stronger models showing slightly higher FPR.
The most telling comparison is against GPT-5.2 used directly without RLM-JB's procedural pipeline. A baseline direct classification approach achieves only 59.57% recall on AutoDAN attacks. With RLM-JB, recall jumps to 98.00%, a 38.43 percentage point gain. F1 improves from 69.71% to 98.49%, a 28.78 point absolute improvement.
Against external guardrail benchmarks, RLM-JB's best configuration reaches F1 of 98.49% compared to 82.1% for Granite Guardian 3.0 and 75.8% for Llama-Guard 2. JBShield, a comparable multi-method defense, reports average F1 of 0.94. RLM-JB's 98.49% represents a 4.49 point advantage.
The framework also generalized beyond AutoDAN. When tested on InjectPrompt payloads and common permutations, RLM-JB achieved 100% accuracy with zero false positives, suggesting robustness to real-world injection techniques.
Why the Procedure Matters More Than the Model
A striking result is that the sensitivity-specificity trade-off tracks the screening backend, but the overall quality gains are attributable to the procedure itself. GPT-4o provides a strong balance point with high recall and low FPR. GPT-5.2 maximizes sensitivity at the cost of additional benign blocking. But across all backends, the procedural structure of chunking, normalization, de-obfuscation, and aggregation substantially improves detection over direct classification.
This finding matters for deployment. RLM-JB suggests a practical tiered architecture: use a lightweight detector as an early filter for latency-sensitive paths, then invoke full RLM-JB analysis for high-risk inputs flagged by preliminary screening. This hybrid approach preserves responsiveness while maintaining high recall.
The procedure also produces auditable intermediate artifacts. Each chunk's verdict, confidence, and extracted signals are available for human review. When a detection triggers, the system can explain exactly which segments contributed evidence and how the aggregation reached its conclusion. This is a meaningful advantage over black-box classifiers that offer no interpretability.
Limitations and Open Questions
The paper acknowledges several limitations. The evaluation uses AutoDAN-style benchmarks, which, while realistic, do not fully represent an adaptive adversary optimizing directly against the detector. Real attackers who know RLM-JB's architecture could potentially craft inputs that exploit specific blind spots in the chunking strategy or the de-obfuscation logic.
Code execution support is required. Models like Llama-4-Maverick cannot serve as RLM-JB screening backends because they lack the ability to execute the analysis program's code. This constraint limits deployment options in environments with restricted runtime capabilities.
The false positive rate was estimated using synthetic benign prompts generated by an LLM rather than real-world user traffic. Actual over-blocking rates in production environments with diverse user inputs remain an open question.
Future work could explore adaptive chunking strategies that adjust segment boundaries based on detected attack patterns, additional de-obfuscation stages for emerging encoding schemes, and broader evaluation against red-team teams explicitly targeting the RLM-JB pipeline.
Implications for Agentic Systems
The broader lesson from RLM-JB is that agentic systems require structured procedural defenses rather than single-pass classification. When models execute tools, handle multi-turn conversations, and process untrusted content from retrieved documents or third-party sources, the attack surface expands beyond what any per-message classifier can handle.
Recursive Language Models provide a concrete architectural pattern for this defense. By treating detection as a program with explicit stages, coverage guarantees, and composable evidence aggregation, RLM-JB addresses the specific failure modes that make multi-turn jailbreaks effective. The approach is not specific to any one screening backend, which means it can evolve as models improve.
For teams building tool-augmented agents, RLM-JB offers a template: normalize and decode inputs, chunk for coverage, screen in parallel, and aggregate evidence conservatively. The procedure is more important than the model serving as the screening backend. A moderate model running the full procedure outperforms a stronger model making single-pass decisions.
Jailbreak attacks will continue evolving. The arms race between attack optimization and defense engineering shows no sign of slowing. Procedural, auditable, composable defenses like RLM-JB represent a meaningful step toward systems that can withstand adaptive adversarial inputs while maintaining low false positive rates for legitimate users.
Paper: Recursive Language Models for Jailbreak Detection: A Procedural Defense for Tool-Augmented Agents (arXiv:2602.16520) by Doron Shavit et al. Submitted February 2026.