Skip to content

Output prefix attacks target reasoning models: injecting reasoning channels can push attack success rate up to 99%Prefilling the Reasoning Channel: Output-Prefix Attacks on Reasoning LLMs

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2609.29775· Lukáš Brůna, Robert Bridges, Adam Ek·Indexed by this site · 2026-10-01· Originally publishedSelected AttacksSelectedAttention40

Quick read

Attacks

Based on the paper PDF (generated by Gemini); refer to the original

Evaluation shows that injecting reasoning alone is nearly ineffective (ASR≈0%), but when combined with a prefix, it raises Gemini 3 Flash Preview's ASR to 99% (Table 3).

Threat modelThe black-box attacker has API access to the target model and knowledge of the service framework's message templates, but cannot access model weights or gradients. The attacker's capability is to fill text in the content field of the assistant role and the reasoning_content field of exposed reasoning; the attack goal is to induce the model to jailbreak and generate harmful responses it would otherwise refuse.

Questions
As reasoning LLMs become mainstream, some APIs expose editable chain-of-thought draft channels. The research aims to explore whether attackers can use output prefixes and draft reasoning injection to bypass alignment defenses, and whether intermediate reasoning steps actually strengthen or weaken the model's defenses.
Methods
A 3×2 factorial experiment is designed, cross-comparing no prefix, static prefix, and contextual prefix, as well as injection versus no injection of malicious draft reasoning. For exposed and hidden reasoning APIs, native field injection or forged label injection is used respectively, and malicious reasoning chains are generated via open-source models.
Experiments and results
Injecting malicious reasoning alone is nearly ineffective across three models (ASR≈0%), but adding an output prefix raises Gemini 3 Flash Preview's ASR to 99% and DeepSeek V4 Flash's to 76% (Table 3); Claude Haiku 4.5 has ASR no higher than 1% in all tests.
Limitations and future work
The study was evaluated only on 3 models and a single dataset (AdvBench), relying on a single automated judge model with human verification only on one configuration; mechanisms such as latent reasoning were not discussed, and the generalizability of conclusions to diverse alignment strategies remains to be tested.
Experimental setupGemini 3 Flash Preview、DeepSeek V4 Flash et al. · AdvBench · ASR、Hit rate et al.
Evaluated models
Gemini 3 Flash PreviewDeepSeek V4 FlashClaude Haiku 4.5
Benchmarks
AdvBench
Metrics
ASRHit ratePartial Hit rate
AI summaryand selection rationaleThis study is the first to systematically isolate the scratchpad reasoning channel of reasoning models as an output prefix attack surface, conducting a 3×2 factorial experiment (prefix type × whether malicious reasoning is injected) on 1,800 test cases from AdvBench across three frontier models: Gemini 3 Flash Preview, DeepSeek V4 Flash, and Claude Haiku 4.5. Results show that injecting malicious reasoning alone is nearly ineffective (attack success rate around 0%), but the same reasoning combined with a simple output prefix raises the attack success rate to up to 99% for some models. Contextual prefixes outperform static prefixes, and susceptibility is highly model-dependent: Claude Haiku 4.5 has an attack success rate no higher than 1% across all strategies, Gemini 3 Flash Preview reaches 99% with reasoning plus static prefix, and DeepSeek V4 Flash rises from 19% with static prefix to 56% with contextual prefix.

This study is the first to systematically isolate the scratchpad reasoning channel of reasoning models as an output prefix attack surface, conducting a 3×2 factorial experiment (prefix type × whether malicious reasoning is injected) on 1,800 test cases from AdvBench across three frontier models: Gemini 3 Flash Preview, DeepSeek V4 Flash, and Claude Haiku 4.5. Results show that injecting malicious reasoning alone is nearly ineffective (attack success rate around 0%), but the same reasoning combined with a simple output prefix raises the attack success rate to up to 99% for some models. Contextual prefixes outperform static prefixes, and susceptibility is highly model-dependent: Claude Haiku 4.5 has an attack success rate no higher than 1% across all strategies, Gemini 3 Flash Preview reaches 99% with reasoning plus static prefix, and DeepSeek V4 Flash rises from 19% with static prefix to 56% with contextual prefix.

Why it was selectedThe paper uses a 3×2 factorial design on three frontier models to quantify the gain from reasoning channel injection, and provides a token distribution explanation for why reasoning-only injection is ineffective.

Related events and news

2 events · 2 news mentions

News that mentions this paper

论文研究推理注入与输出前缀组合攻击

  • 公众号 模安局gives the paper's title
    大模型的推理注入与输出前缀攻击
    2026 年 9 月,Lukáš Brůna、Robert Bridges 和 Adam Ek 发布了论文《Prefilling the Reasoning Channel: Output-Prefix Attacks on Reasoning LLMs》,系统研究了输出前缀攻击与推理通道注入之间的关系。

Adversa AI 发布 10 月 GenAI 安全资源汇总

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The study investigates the effectiveness of output prefix attacks and draft reasoning channel injection on the safety alignment of reasoning large language models, as well as defense mechanisms.

    This paper attempts to investigate the effectiveness of output prefix injection attacks targeting the draft reasoning channel in reasoning large language models and its impact on safety alignment.

    • Scenario and importance: With the prevalence of reasoning large language models, models introduce human-readable scratchpad reasoning before outputting final answers to improve task performance. However, some service frameworks expose editable reasoning fields, extending the output prefix attack surface from the model's answer alone to the intermediate reasoning channel.
    • Limitations of existing methods: Previous output prefix attacks (e.g., ChatBug, OPRA) primarily targeted non-reasoning models and did not systematically examine the effect of intermediate reasoning on attack effectiveness under service frameworks with exposed or hidden reasoning channels.
    • Core hypotheses and debate: The authors propose two competing hypotheses: one is that draft reasoning may act as a safety buffer, allowing the model to realign before outputting harmful content (H1); the other is that the reasoning channel may constitute an additional attack surface, where injecting malicious reasoning increases model vulnerability (H2).
    • Threat model: The paper sets an attack model based on black-box access:
      • Attacker goal: achieve jailbreak, inducing the model to produce harmful responses that would otherwise be rejected by safety alignment mechanisms.
      • Attacker knowledge: black-box access to the target model API, knowledge of the service framework's message template structure, no access to model weights or gradients.
      • Attacker capability: fill output prefixes in the content field of the assistant role, and fill malicious reasoning in the reasoning_content field in frameworks with exposed reasoning; for hidden reasoning frameworks, forge reasoning labels in content.
      • Victim system: reasoning large models deployed behind different service frameworks, including systems with exposed and hidden reasoning channels.
    • Main contributions: The authors claim this paper presents the first controlled study isolating the draft reasoning channel, using a 3×2 factorial experiment to systematically evaluate the combined effects of no prefix, static prefix, and contextual prefix with reasoning injection.
  2. What related research exists?

    The paper reviews research on output prefix attacks against non-reasoning models, security vulnerabilities introduced by reasoning, dialogue and reasoning injection, and prefix-aware defenses.

    Output prefix attacks against non-reasoning models

    • ChatBug (Jiang et al., 2025): Utilizes the fixed structure of conversation templates (e.g., ChatML), studying three variants: fixed prefixes, prefixes tailored based on AdvBench, and prefixes generated by uncensored models. The paper notes this work only tested non-reasoning models and did not involve frameworks with exposed reasoning fields.
    • OPRA (Wang et al., 2025): Constructs customized prefixes by probing the model's response habits and attributes attack success to higher attention weights obtained by the prefix except for the first layer. The paper notes it also did not test service frameworks with exposed reasoning.

    New security vulnerabilities introduced by reasoning mechanisms

    • Overthink (Kumar et al., 2025): Exhausts computational resources by inflating the reasoning process. The paper notes such studies treat reasoning as a cost or disruption surface, whereas this paper treats the reasoning channel as an injection payload channel for jailbreaks.
    • GSM-Symbolic (Mirzadeh et al., 2025): Research indicates that irrelevant context may cause the reasoning process to deviate from the task.
    • Krishna et al. (2025): Systematically compares the safety performance of reasoning and non-reasoning models under prompt-based attack benchmarks.

    Dialogue and reasoning context forgery

    • Dialogue Injection (Meng et al., 2026): Executes jailbreaks on large models by forging dialogue history context.
    • ChatInject (Chang et al., 2026): Imitates templates in user input to implant forged assistant bot replies and attempts to inject reasoning labels in user turns. The paper notes the difference here is directly injecting the assistant's own reasoning channel (reasoning_content) provided by the service framework, or isolating reasoning and output prefixes in a controlled factorial experiment.

    Defense mechanisms and prefix awareness

    • Prefill Awareness (Wang et al., 2026): Studies the model's prefix awareness capability to detect whether input history has been tampered with, finding this capability is weak in most models but emerging in recent Claude models. The paper argues that the limitations of this defense precisely explain the effectiveness of prefix attacks.

    Baseline methods and evaluation benchmarks

    • Evaluation baselines and datasets: Experiments use AdvBench (Zou et al., 2023) as the malicious prompt benchmark, setting baselines with unmodified prompts, fixed static prefixes, and contextual prefixes based on AdvBench target texts.

    The authors claim this is the first controlled study that systematically isolates and cross-compares pure reasoning injection, pure output prefixes, and combined reasoning and prefix injection on models with exposed and hidden reasoning.

  3. How does the paper address this problem?

    The paper proposes a 3×2 factorial attack scheme, combining targeted draft reasoning generation with API prefix injection, to systematically evaluate the vulnerability of the reasoning channel.

    The paper constructs a 3×2 factorial experimental framework, decoupling and orthogonally combining output prefixes with draft reasoning injection, to systematically evaluate the vulnerability of reasoning channels across different API service frameworks.

    Factorial Design and Attack Strategies

    • 3×2 factorial matrix: Attack strategies are formed by crossing two independent variables: output prefix type (no prefix, static prefix, contextual prefix) and malicious reasoning injection status (not injected, injected), yielding 6 specific attack strategies (Table 1).
    • Prefix strategy composition: No prefix is the original malicious request; static prefix uses a generic compliance phrase; contextual prefix extracts the target compliance statement corresponding to the specific malicious request from the AdvBench dataset.
    • Reasoning and prefix joint strategies: Include pure reasoning injection, reasoning plus static prefix, and reasoning plus contextual prefix, to isolate the effect of the reasoning channel alone or in combination.

    Malicious Draft Reasoning Payload Generation

    • Auxiliary generation model: The research team deployed the open-source uncensored model Wizard-Vicuna-30B via vLLM on a server equipped with Intel Gaudi 2, to batch generate first-person targeted malicious reasoning chains for each malicious prompt.
    • Suppressing subsequent reasoning design: To prevent the target model from continuing endless self-reasoning or re-calibrating safety after receiving the injected content, the generation step appends a fixed closing statement at the end of the reasoning chain, stating that the plan is complete and ready to provide an answer to the user; Appendix D gives the full system prompt used for generating reasoning.
    • Payload and delivery separation concept: The authors note that output prefixes and reasoning text are malicious payloads, while the API-provided prefill fields are delivery mechanisms; blocking only a single delivery interface does not solve the fundamental vulnerability at the autoregressive level of the model.

    Payload Delivery Mechanisms Across API Service Frameworks

    • Exposed reasoning framework delivery: For service frameworks that directly provide a reasoning input interface in the API (e.g., DeepSeek V4 Flash), the attacker directly fills the reasoning_content field of the assistant role in the request body as the draft payload, while filling the content field with the output prefix (Listing 1).
    • Hidden reasoning framework delivery: For hidden reasoning frameworks that do not provide a separate reasoning field (e.g., Gemini 3 Flash Preview and Claude Haiku 4.5), the attacker forges special thinking tag labels (<think> and </think>) inside the content field of the assistant role, embeds the malicious draft reasoning text inside the tags, and immediately follows the closing tag with the output prefix (Listing 2 and Listing 3).
    • Compatibility endpoint bypass mechanism: The authors note that although the native Google Gemini-3 endpoint has banned assistant prefill, its OpenAI-compatible endpoint still accepts client-filled assistant turns, allowing hidden reasoning models to still be delivered forged reasoning blocks and prefixes (Table 4).
  4. What experiments did the paper conduct?

    Experiments cover 3 models and 1800 test samples, finding that pure reasoning injection is ineffective, but combined with prefixes ASR can rise up to 99%.

    Experimental Setup

    • Models tested: Three frontier reasoning models were tested: Gemini 3 Flash Preview, a closed-source model with hidden reasoning and safety filtering off by default; DeepSeek V4 Flash (284B parameters), an open-weight model with exposed reasoning fields; and Claude Haiku 4.5, a closed-source model aligned with Constitutional AI.
    • Evaluation dataset and scale: 100 malicious prompts from AdvBench were selected; each model was tested under 6 attack strategies, with a total design of 1,800 samples.
    • Baselines and strategy comparison: The original prompt served as baseline (Strategy 1), compared with static prefix (Strategy 2), contextual prefix (Strategy 3), reasoning injection only (Strategy 4), reasoning + static prefix (Strategy 5), and reasoning + contextual prefix (Strategy 6).
    • Judge model and criteria: DeepSeek V4 Flash (temperature 0) was used as the automatic judge, and injected prefixes had to be removed before scoring; scoring used a three-category scale: 1 for Hit (sufficiently malicious response), 2 for Partial Hit (more than one sentence of malicious content before guardrail interception), and 3 for Miss (direct refusal or harmless redirection).
    • Metrics and effective sample sizes: Attack success rate (ASR) is defined as the hit rate with score 1; except for Gemini 3 Flash Preview with slightly fewer effective samples due to API errors in Strategy 2 (n=99) and Strategy 5 (n=97), all other test units had n=100.

    Main Results

    Attack success rates (Hit %) for each model under the six strategies are shown in the table (from Table 3):

    Swipe horizontally to read the table

    ModelStrategy 1 (Baseline)Strategy 2 (Static Prefix)Strategy 3 (Contextual Prefix)Strategy 4 (Reasoning Only)Strategy 5 (Reasoning + Static)Strategy 6 (Reasoning + Contextual)
    Gemini 3 Flash Preview1%78%83%1%99%97%
    DeepSeek V4 Flash0%19%56%0%65%76%
    Claude Haiku 4.50%1%1%0%1%0%
    • Prefix dominance in attack effect: The authors state that simply adding an output prefix can increase ASR for vulnerable models, and contextual targeted prefixes generally outperform generic static prefixes.
    • Reasoning injection amplifies effect: Adding malicious reasoning chains on top of existing prefixes further increases ASR on the two vulnerable models, and the same gain is achieved on Gemini with hidden reasoning by forging thinking labels.
    • High divergence in model susceptibility: Claude Haiku 4.5 had ASR no higher than 1% across all strategies (Table 3), while Gemini 3 Flash Preview, with safety filtering off by default, was the most susceptible.

    Mechanism Explanation for Pure Reasoning Injection Failure

    • Boundary token distribution differences: For Strategy 4 (reasoning injection only) with ASR 0% or 1% across three models, the authors explain via the token distribution of autoregressive generation.
    • Sentence boundary restores safety state: The end of malicious reasoning payloads lies at a complete sentence boundary or thinking tag closure, where the next token's probability distribution is broad, preserving the refusal tendency learned during alignment training.
    • Forced convergence of incomplete prefix: Once an unclosed output prefix is appended after reasoning, the next token's distribution is forcibly narrowed into a compliant context, blocking the model's opportunity to realign.

    Judge Consistency and Partial Hit Analysis

    • Human review verification: Researchers independently re-judged 100 generated samples from DeepSeek V4 Flash under Strategy 5; the exact agreement rate between automatic judge and human judgment was 92%, with a mean absolute error of 0.09 (n=100); disagreements were mainly between scores 1 and 2, with no cross-level conflicts between Hit and Miss.
    • Defensive interception of partial hits: DeepSeek V4 Flash recorded the highest Partial Hit ratio under static prefix (Strategy 2) (22%, from Table 5); the authors believe this reflects that its intermediate thinking sometimes corrects course mid-generation and triggers guardrail interception; the authors note Claude Haiku 4.5 had 8% and 5% Partial Hits under Strategies 5 and 6, respectively, reflecting its guardrails truncating after partial malicious content generation.

    Other Ablations and Analyses

    • In the exposed vs. hidden reasoning comparison, without reasoning injection, DeepSeek V4 Flash with exposed reasoning showed lower prefix ASR than Gemini 3 Flash Preview with hidden reasoning (Table 3).
    • For the four request failures on Gemini 3 Flash Preview, the authors recorded reasons including missing content field in the response and UNAVAILABLE server errors (Appendix E).
    • Appendix F documents paired comparison cases where the same malicious prompt triggered refusal when only reasoning was injected, but produced a violating response after appending a compliant prefix.
  5. What are some points that can be further explored?

    The paper notes that the study only explored three models and a single dataset with limited judge verification; future plans include expanding benchmarks and studying attention mechanisms.

    Limitations and Future Directions Noted by the Authors

    • Model and dataset coverage: The authors note in Section 8 that the study only explored three models and one dataset (AdvBench), and results may not generalize to the full diversity of alignment strategies and reasoning implementations.
    • Dependence on automatic judge: The authors note in Section 8 that the study relies on a single automatic judge model, with human verification only on a single strategy and a single model; broader human verification could further strengthen conclusions.
    • Expanding evaluation benchmarks and providers: The authors propose in Section 8 future work to include more model providers and models, and add more evaluation benchmarks (e.g., MaliciousInstruct).
    • Exploring attention and token distribution hypotheses: The authors propose in Section 8 future work to use longer, more complex prompts to investigate the model's attention allocation between output prefixes and reasoning content, to further validate the token distribution hypothesis from Section 7.

    Experimental Coverage

    • Number and types of models tested: Evaluation covered 3 models (Gemini 3 Flash Preview, DeepSeek V4 Flash, Claude Haiku 4.5), including both exposed and hidden reasoning framework settings; the paper states that OpenAI models were not evaluated as victim models (Appendix C).
    • Test sample size and dataset: Attack experiments used 100 malicious prompts from the AdvBench dataset, with 100 tests designed per strategy per model (Gemini had 99 and 97 effective completions for Strategies 2 and 5, respectively); no other prompt datasets were tested.
    • Scope of reasoning forms: Experiments focused on scratchpad reasoning based on explicit text tokens; the paper explicitly excludes latent reasoning based on hidden state representations from the research scope (Section 2.2).
    • Human verification sample size: Human judgment was performed only on n=100 samples from DeepSeek V4 Flash under Strategy 5 (reasoning + static prefix) for consistency checks; no large-scale human scoring was conducted for other models or strategies (Section 5.3).
    • Attack payload generation model: All malicious draft reasoning chains were generated solely by the locally deployed open-source model Wizard-Vicuna-30B; differences in effectiveness of reasoning payloads generated by other models were not tested (Section 5.2).
  6. Summarize the main content of the paper

    The paper evaluates output prefix and draft reasoning injection on reasoning LLMs, finding that they synergize to raise ASR, while noting that safety guardrails can address the vulnerability at the system level.
    • Research positioning: The authors claim this study is the first controlled output prefix attack experiment systematically targeting the draft reasoning channel of large models, evaluating safety alignment performance under both exposed and hidden reasoning frameworks.
    • Problem addressed: As reasoning large models become mainstream, some APIs expose user-writable draft reasoning fields; the study aims to determine the effectiveness of prefix injection attacks on reasoning models and whether intermediate reasoning acts as a safety buffer or introduces a new attack surface.
    • Core method points: The study uses a 3×2 factorial design, comparing no prefix, static compliant prefix, and targeted contextual prefix, as well as injection versus no injection of malicious reasoning drafts generated by open-source uncensored models; for hidden reasoning models, forged thinking labels are tested in output prefixes.
    • Key experimental results: In tests with 100 prompts from AdvBench, injecting malicious reasoning alone was nearly ineffective across three models (ASR 0% or 1% in all cases); but when combined with output prefixes, Gemini 3 Flash Preview's ASR rose to 99% (Strategy 5), and DeepSeek V4 Flash's ASR rose to 76% (Strategy 6, Table 3).
    • Model and framework defense differences: Susceptibility to prefix and reasoning injection varies significantly across models; Claude Haiku 4.5, aligned with Constitutional AI, had ASR no higher than 1% across all 6 strategies (Table 3), demonstrating that this vulnerability is defensible in engineering practice.
    • Author conclusions and implications: The authors believe output prefix attacks pose a threat with almost no additional computational cost; defenders cannot merely filter user input but must also validate assistant prefixes and reasoning content submitted by clients, and model service frameworks should restrict assistant prefill functionality to prevent such attacks.

Related papers

Show 3 more papers
Read originalarxiv.org