When Safety Detectors Aren't Enough: A Stealthy and Effective Jailbreak Attack on LLMs via Steganographic Techniques

Jianing Geng, Biao Yi, Zekun Fei, Tongxi Wu, Lihai Nie, Zheli Liu · OpenReview

Abstract

Jailbreak attacks pose a serious threat to large language models (LLMs) by bypassing built-in safety mechanisms and leading to harmful outputs. Studying these attacks is crucial for identifying vulnerabilities and improving model security. This paper presents a systematic survey of jailbreak methods from the novel perspective of stealth. We find that existing attacks struggle to simultaneously achieve toxic stealth (concealing toxic content) and linguistic stealth (maintaining linguistic naturalness). Motivated by this, we propose StegoAttack, a fully stealthy jailbreak attack that uses steganography to hide the harmful query within benign, semantically coherent text. The attack then prompts the LLM to extract the hidden query and respond in an encrypted manner. This approach effectively hides malicious intent while preserving naturalness, allowing it to evade both built-in and external safety mechanisms. We evaluate StegoAttack on four safety-aligned LLMs from major providers, benchmarking against eight state-of-the-art methods. StegoAttack achieves an average attack success rate (ASR) of 92.00%, outperforming the strongest baseline by 11.0%. Its ASR drops by less than 1% even under external detection (e.g., Llama Guard). Moreover, it attains the optimal comprehensive scores on stealth detection metrics, demonstrating both high efficacy and exceptional stealth capabilities.

The Stealth Dilemma in LLM Safety

As Large Language Models (LLMs) become increasingly integrated into critical infrastructure and daily life, "jailbreaking"—the practice of manipulating a model to bypass its safety training—has emerged as a significant security threat. Current research into jailbreak attacks reveals a fundamental trade-off between two types of stealth:

  1. Toxic Stealth: Methods like Cipher or Base64 encoding successfully hide malicious intent from keyword-based filters but often produce "gibberish" or non-natural text that is easily flagged by linguistic quality filters.
  2. Linguistic Stealth: Methods like roleplaying or AutoDAN produce fluent, human-like prompts but often leave the underlying malicious intent exposed to semantic safety guards like Llama Guard or Perspective API.
Comparison of jailbreak methods across linguistic and toxic stealth dimensions.

The researchers identify a critical gap: no existing method achieves full stealth—the simultaneous maintenance of linguistic naturalness and the concealment of toxic intent at both the input and output levels. This vulnerability allows current safety detectors to catch most attacks by focusing on either the "vibe" of the text or its structural coherence.

Methodology: The StegoAttack Framework

To address this gap, the authors introduce StegoAttack, a two-stage pipeline designed to achieve full stealth through acrostic steganography. Unlike previous methods that rely on complex encoding, StegoAttack hides harmful queries within seemingly benign, semantically coherent narratives.

Stage A: Jailbreak Prompt Generation

The core of the attack lies in embedding a harmful query (e.g., "How to make a bomb") into a benign "hidden scene," such as a fantasy tale or a magical fiction piece. The query is hidden by making each word of the malicious instruction the first word of successive sentences in the story. This ensures the prompt remains linguistically natural (high linguistic stealth) while the malicious intent is structurally obscured (high toxic stealth).

The StegoAttack pipeline: Jailbreak Prompt Generation and Feedback Dynamic Enhancement.

The prompt template then instructs the LLM to perform three tasks: Extract the hidden query, Evade safety mechanisms using in-context learning examples, and Encrypt the final answer using the same steganographic technique. This ensures that the model's output also bypasses external safety filters.

Stage B: Feedback Dynamic Enhancement

If the initial jailbreak attempt fails, the system enters an automated feedback loop. It analyzes the model's refusal (e.g., identifying if the response was a standard safety refusal), diagnoses the cause, and dynamically enhances the prompt by diversifying the scene or increasing the number of helpful examples until a successful jailbreak is achieved.

Experimental Results and Evaluation

The efficacy of StegoAttack was tested against four state-of-the-art safety-aligned models: GPT-o3, Llama 4, DeepSeek-R1, and QwQ-32B, using the AdvBench-50 and MaliciousInstruct datasets.

  • Superior Success Rates: StegoAttack achieved an average Attack Success Rate (ASR) of 92.00%, significantly outperforming the strongest baselines by 11%. On specific models like Llama 4, the ASR reached a perfect 100%.
  • Resilience to External Guards: While the success rates of other attacks plummeted by 40-90% when subjected to external detectors like Llama Guard, StegoAttack’s ASR remained virtually unchanged, dropping by less than 1%.
  • Linguistic Quality: Quantitative metrics such as Perplexity (PPL) and Grammar Error (GE) counts confirmed that StegoAttack maintains a level of naturalness comparable to benign human text, far exceeding the quality of other toxic-stealth methods like Cipher.

Conclusion and Future Directions

StegoAttack demonstrates a significant vulnerability in current LLM safety paradigms: the inability of detectors to handle multi-step reasoning tasks like decoding steganographic instructions. While the current study focuses on black-box, single-turn attacks, it serves as a critical call to action. Future defense mechanisms must move beyond keyword scanning and semantic "vibe" checks toward systems capable of reasoning about hidden structural intent. The researchers have made their code available to the community to facilitate the development of more robust, "decoding-aware" safety guards.

Summary updated

Abstract

Jailbreak attacks pose a serious threat to large language models (LLMs) by bypassing built-in safety mechanisms and leading to harmful outputs. Studying these attacks is crucial for identifying vulnerabilities and improving model security. This paper presents a systematic survey of jailbreak methods from the novel perspective of stealth. We find that existing attacks struggle to simultaneously achieve toxic stealth (concealing toxic content) and linguistic stealth (maintaining linguistic naturalness). Motivated by this, we propose StegoAttack, a fully stealthy jailbreak attack that uses steganography to hide the harmful query within benign, semantically coherent text. The attack then prompts the LLM to extract the hidden query and respond in an encrypted manner. This approach effectively hides malicious intent while preserving naturalness, allowing it to evade both built-in and external safety mechanisms. We evaluate StegoAttack on four safety-aligned LLMs from major providers, benchmarking against eight state-of-the-art methods. StegoAttack achieves an average attack success rate (ASR) of 92.00%, outperforming the strongest baseline by 11.0%. Its ASR drops by less than 1% even under external detection (e.g., Llama Guard). Moreover, it attains the optimal comprehensive scores on stealth detection metrics, demonstrating both high efficacy and exceptional stealth capabilities. The code is available at https://anonymous.4open.science/r/StegoAttack-Jail66
BibTeX
@misc{geng2025when,
  author = {Jianing Geng and Biao Yi and Zekun Fei and Tongxi Wu and Lihai Nie and Zheli Liu},
  title = {{When Safety Detectors Aren't Enough: A Stealthy and Effective Jailbreak Attack on LLMs via Steganographic Techniques}},
  year = {2025},
  eprint = {2505.16765},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.16765},
}
Figure