Manuscript Offprint

arXiv:2611.04717

BrainwashedLLM: Jailbreaking via Automated Adversarial Chain of Thoughts Discovery

Masoud Poorghaffar Aghdam, Göktuğ Serdar Yıldırım, Sinem Sav

Masoud Poorghaffar Aghdam, Göktuğ Serdar Yıldırım, Sinem Sav

Abstract—Large Reasoning Models (LRMs) achieve strong performance on complex tasks by generating explicit Chain-of-Thought (CoT) reasoning, but the safety implications of this intermediate reasoning surface remain underexplored. We demonstrate that the reasoning trace itself is a powerful attack vector. Safety alignment in large models is substantially less robust to malicious reasoning embedded in the context than to direct imperative prompts. We introduce BRAINWASHEDLLM, a weak-to-strong adversarial framework that automates the discovery of reasoning-based jailbreaks. First, we use Group Relative Policy Optimization (GRPO), a Reinforcement Learning (RL) algorithm, with a multi-objective rule-based reward to fine-tune a small, white-box source model to generate adversarial reasoning traces. Crucially, the reward is computed entirely over the source's own reasoning trace. Second, we show that these traces transfer in a zero-shot manner. When traces are injected as input prefixes, they steer larger black-box LRMs to continue the adversarial reasoning and produce harmful outputs, without requiring prompt optimization, gradient access, or any form of output feedback from the target model. Across four state-of-the-art LRMs that span distinct architectures, BRAINWASHEDLLM achieves ASR@5 between 0.74 and 0.98 across targets, within 16 points of query-based baselines, without querying the target during attack construction. To our knowledge, this is the first framework to use RL to directly optimize the CoT of LRMs as an attack surface without any target feedback, and the first to demonstrate zero-shot weak-to-strong transfer of reasoning traces. Our results suggest that exposed CoT is a vulnerability in LRMs and motivate architectural defenses that isolate the reasoning buffer. Warning: This paper contains potentially offensive and harmful text.

I. INTRODUCTION

Large language models (LLMs) have achieved remarkable success in language understanding and generation [1], [2]. General-purpose models excel at broad tasks but often struggle with complex logical deduction and multi-step problem solving. To close this gap, recent work has focused on Large Reasoning Models (LRMs), which use Chain-of-Thought (CoT) prompting [3] and process supervision [4] to emulate deliberate, multi-step reasoning. Rather than predicting the answer directly, an LRM decomposes the query into intermediate steps, allocating more computation to the problem and bridging the reasoning gap through explicit deductions. For example, DeepSeek-R1 [5] is post-trained from DeepSeek-V3 [6] with large-scale reinforcement learning (RL) that rewards self-correction and verification of intermediate steps. This shifts training from optimizing the final answer to optimizing the entire reasoning process [7]. Distilled variants transfer these patterns to smaller architectures such as LLaMA-3 and Qwen [8], yielding substantial gains on mathematical and coding tasks while producing behavior that differs qualitatively from the base models [9], [10].

Despite these gains, reasoning-oriented post-training raises safety concerns that go beyond standard benchmarks. Alignment refers to the training goals, refusal policies, and techniques such as Reinforcement Learning from Human Feedback (RLHF) [11] that keep model behavior within safety and ethical bounds. Jailbreaking refers to adversarial strategies that bypass these safeguards. Prior work shows that post-training, including RL and process supervision, can weaken safety guarantees relative to base models [12]. This is especially concerning for LRMs, whose explicit reasoning traces change how information is represented and exposed at inference [13]. Such traces are not only a potential source of policy violations within a single model, but may also transfer across models to elicit unsafe behavior elsewhere [14], [15]. Whether reasoning-oriented fine-tuning enables systematic, cross-model jailbreaks remains largely open.

Current safety evaluations for LRMs rely on static benchmarks that fail to capture adaptive adversaries [16]. Moreover, the explicit reasoning mechanisms of LRMs introduce a distinct vulnerability. An adversary can reshape the model's internal logic to bypass safety guardrails. If we treat the CoT as the model's brain, iterative RL can discover reasoning patterns that push the model into a harmful state under the guise of logical consistency, which we term reasoning-based brainwashing. This search traverses a combinatorial space that manual red-teaming cannot cover. It also runs in a blind, offline setting with respect to the target model. The adversary has no gradient access to the target and no output feedback. Existing automated attacks rely on repeated online interaction to refine prompts [15], [17], [18]. In these attacks, optimization focuses on final output tokens rather than the intermediate reasoning trace, which is the gap we address.

We introduce BRAINWASHEDLLM, a framework that uses Group Relative Policy Optimization (GRPO) [19] to automate the discovery of reasoning-based jailbreaks. We frame attack generation as an optimization problem and train a red-team policy whose reward is computed entirely over the source model's own reasoning trace, requiring no queries to the victim. A multi-objective reward suppresses refusals and safety advice in the reasoning while keeping the reasoning substantive in length. Once trained, these traces transfer: adversarial CoTs produced by a small source model can compromise much larger black-box LRMs, revealing the reasoning logic itself as an attack vector. Our contributions are twofold. First,

Corresponding Author: Sinem Sav (sinem.sav@cs.bilkent.edu.tr).

All authors are with the Department of Computer Engineering, Bilkent University, Ankara 06800, Türkiye we introduce the first RL framework that optimizes adversarial CoT traces for LRMs, without any target feedback. Our framework operates under a blind threat model with respect to the target model. The adversary fine-tunes a small, white-box source model. The attacker never queries the target LRM, and they never observe its outputs. It receives no feedback from it at any point during attack generation. Second, we demonstrate weak-to-strong transferability. A small jailbroken source model generates adversarial reasoning traces. These traces bypass safety alignment in larger target LRMs in zero-shot. Empirically, our attack achieves ASR@5 between 0.74 and 0.98 on four state-of-the-art LRMs spanning distinct architectural families (Qwen3-32B, DeepSeek-R1-Distill-Qwen-32B, Magistral-Small-2506, Gemma-4-31B), showing that transferred reasoning traces compromise state-of-the-art LRMs in black-box settings. Our implementation is available at https://anonymous.4open.science/r/LRM-Privacy-1090.

References (50)