JBShield: Defending Large Language Models from Jailbreak Attacks through Activated Concept Analysis and Manipulation
Open accessAbstract
Despite the implementation of safety alignment strategies, large language models (LLMs) remain vulnerable to jailbreak attacks, which undermine these safety guardrails and pose significant security threats. Some defenses have been proposed to detect or mitigate jailbreaks, but they are unable to withstand the test of time due to an insufficient understanding of jailbreak mechanisms. In this work, we investigate the mechanisms behind jailbreaks based on the Linear Representation Hypothesis (LRH), which states that neural networks encode high-level concepts as subspaces in their hidden representations. We define the toxic semantics in harmful and jailbreak prompts as toxic concepts and describe the semantics in jailbreak prompts that manipulate LLMs to comply with unsafe requests as jailbreak concepts. Through concept extraction and analysis, we reveal that LLMs can recognize the toxic concepts in both harmful and jailbreak prompts. However, unlike harmful prompts, jailbreak prompts activate the jailbreak concepts and alter the LLM output from rejection to compliance. Building on our analysis, we propose a comprehensive jailbreak defense framework, JBShield, consisting of two key components: jailbreak detection JBShield-D and mitigation JBShield-M. JBShield-D identifies jailbreak prompts by determining whether the input activates both toxic and jailbreak concepts. When a jailbreak prompt is detected, JBShield-M adjusts the hidden representations of the target LLM by enhancing the toxic concept and weakening the jailbreak concept, ensuring LLMs produce safe content. Extensive experiments demonstrate the superior performance of JBShield, achieving an average detection accuracy of 0.95 and reducing the average attack success rate of various jailbreak attacks to 2% from 61% across distinct LLMs.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Prompt-focused defenses primarily target input-level detection and are specialized to jailbreak or prompt-injection settings; they do not jointly verify whether the generated response contains actionable harm, nor provide unified coverage across broader threat categories such as phishing, cyber abuse, and harmful content.
“However, these approaches primarily target input-level detection and are specialized to jailbreak or prompt-injection settings. They do not jointly verify whether the generated response contains actionable harm, nor do they provide unified coverage across broader threat categories such as phishing, cyber abuse, and harmful content.”
From Verifying Intent and Harm: A Unified Defense Against LLM-Generated Threats (2026) · cites this paper as [7]
Existing LLM defenses typically analyze either user prompts or generated outputs, but not both.
“Existing defenses typically analyze either user prompts or generated outputs, but not both.”
From Verifying Intent and Harm: A Unified Defense Against LLM-Generated Threats (2026) · cites this paper as [7]
No citation lists for this paper
No citation lists for this paper yet — checked again daily.
Cited by 1
- Authors
- Zhang, S., Zhai, Y., Guo, K., Hu, H., Guo, S., Fang, Z., Zhao, L., Shen, C., Wang, C., & Wang, Q.
- Affiliations
- University at Buffalo, State University of New York (US)
- Xi'an Jiaotong University (CN)
- City University of Hong Kong (HK)
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2025
- ISSN
- 2331-8422 (ISSN-L)
- arXiv
- 2502.07557
- OpenAlex
- W4407425033
- Cited by
- 1
- References
- 0
- Citations by year
- 2025: 1
- Type
- posted content
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Funders
- City University of Hong Kong
- National Natural Science Foundation of China (U2441240, 62161160337, T2442014, U21B2018, 62441238, 62132011, U24B20185)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
- Physical Sciences › Computer Science › Artificial Intelligence › Security and Verification in Computing
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Keywords
- jailbreak attacks, large language models, jailbreak defense, linear representation hypothesis, concept activation, jailbreak detection, prompt manipulation, LLM safety
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review