Defend LLMs Through Self-Consciousness
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
This paper introduces a novel self-consciousness defense mechanism for Large Language Models (LLMs) to combat prompt injection attacks. Unlike traditional approaches that rely on external classifiers, our method leverages the LLM's inherent reasoning capabilities to perform self-protection. We propose a framework that incorporates Meta-Cognitive and Arbitration Modules, enabling LLMs to evaluate and regulate their own outputs autonomously. Our approach is evaluated on seven state-of-the-art LLMs using two datasets: AdvBench and Prompt-Injection-Mixed-Techniques-2024. Experiment results demonstrate significant improvements in defense success rates across models and datasets, with some achieving perfect and near-perfect defense in Enhanced Mode. We also analyze the trade-off between defense success rate improvement and computational overhead. This self-consciousness method offers a lightweight, cost-effective solution for enhancing LLM ethics, particularly beneficial for GenAI use cases across various platforms.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 11 of its 22 references that are in the map. First posted on arXiv 4 Aug 2025.
Builds on
11 of 22 references.
Closest ancestors · 3
Same direction, newest first
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimization7 Oct
- 2024GenTel-Safe: A Unified Benchmark and Shielding Framework for Defending Against Prompt Injection Attacks29 Sep
- 2023Prompt Injection attack against LLM-integrated Applications8 Jun
Other references · 8
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
- 2023Baichuan 2: Open Large-scale Language Modelscited by 670
- 2023The Falcon Series of Open Language Modelscited by 535
- 2024COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllabilitycited by 175
- 2024PLeak: Prompt Leaking Attacks against Large Language Model Applicationscited by 127
- 2025Life-Cycle Routing Vulnerabilities of LLM Routercited by 11
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2023LLM Self Defense: By Self Examination, LLMs Know They Are Being Tricked
- 2026Universal Defenses for Tool-Integrated LLM Agents Against Adversarial Attacks
- 2024Automatic and Universal Prompt Injection Attacks against Large Language Models
- 2026Evaluation of Prompt Injection Defenses in Large Language Models
- 2026A Systematic Literature Review on LLM Defenses Against Prompt Injection and Jailbreaking: Expanding NIST Taxonomy
- 2024Defense Against Prompt Injection Attack by Leveraging Attack Techniques
- 2024An Early Categorization of Prompt Injection Attacks on Large Language Models
- 2025A Critical Evaluation of Defenses against Prompt Injection Attacks