RedVisor: Reasoning-Aware Prompt Injection Defense via Zero-Copy KV Cache Reuse
On the map: LLM reasoning → Reasoning for agents, planning and code
also in 2 more
Abstract (arXiv)
Large Language Models (LLMs) are increasingly vulnerable to Prompt Injection (PI) attacks, where adversarial instructions hidden within retrieved contexts hijack the model's execution flow. Current defenses typically face a critical trade-off: prevention-based fine-tuning often degrades general utility via the "alignment tax", while detection-based filtering incurs prohibitive latency and memory costs. To bridge this gap, we propose RedVisor, a unified framework that synthesizes the explainability of detection systems with the seamless integration of prevention strategies. To the best of our knowledge, RedVisor is the first approach to leverage fine-grained reasoning paths to simultaneously detect attacks and guide the model's safe response. We implement this via a lightweight, removable adapter positioned atop the frozen backbone. This adapter serves a dual function: it first generates an explainable analysis that precisely localizes the injection and articulates the threat, which then explicitly conditions the model to reject the malicious command. Uniquely, the adapter is active only during this reasoning phase and is effectively muted during the subsequent response generation. This architecture yields two distinct advantages: (1) it mathematically preserves the backbone's original utility on benign inputs; and (2) it enables a novel KV Cache Reuse strategy, eliminating the redundant prefill computation inherent to decoupled pipelines. We further pioneer the integration of this defense into the vLLM serving engine with custom kernels. Experiments demonstrate that RedVisor outperforms state-of-the-art defenses in detection accuracy and throughput while incurring negligible utility loss.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 37 of its 48 references that are in the map. First posted on arXiv 2 Feb 2026.
Builds on
37 of 48 references.
Closest ancestors · 1
Same direction, newest first
Other references · 36
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2023Qwen Technical Reportcited by 3,273
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,126
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
24 more
- 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 940
- 2020AdapterFusion: Non-Destructive Task Composition for Transfer Learningcited by 780
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedbackcited by 738
- 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
- 2022Efficiently Scaling Transformer Inferencecited by 529
- 2023GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Promptscited by 520
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 401
- 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
- 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Gamecited by 135
- 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attackscited by 124
- 2024Optimization-based Prompt Injection Attack to LLM-as-a-Judgecited by 123
- 2024Automatic and Universal Prompt Injection Attacks against Large Language Modelscited by 112
- 2025PromptArmor: Simple yet Effective Prompt Injection Defensescited by 98
- 2024Neural Exec: Learning (and Learning from) Execution Triggers for Prompt Injection Attackscited by 78
- 2024Can LLMs Separate Instructions From Data? And What Do We Even Mean By That?cited by 70
- 2025Can Indirect Prompt Injection Attacks Be Detected and Removed?cited by 43
- 2025Defending Against Prompt Injection with DataFiltercited by 30
- 2024Mask-based Membership Inference Attacks for Retrieval-Augmented Generationcited by 29
- 2025Defending Against Prompt Injection With a Few DefensiveTokenscited by 26
- 2025PromptLocate: Localizing Prompt Injection Attackscited by 23
- 2025Robustness via Referencing: Defending against Prompt Injection Attacks by Referencing the Executed Instructioncited by 15
- 2025The Trojan Example: Jailbreaking LLMs through Template Filling and Unsafety Reasoningcited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2024Reasoning as a Weapon: Adaptive Dual-Path Jailbreak Attack on Large Language Models
- 2026Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignment
- 2025SecInfer: Preventing Prompt Injection via Inference-time Scaling
- 2025Mitigating Indirect Prompt Injection via Instruction-Following Intent Analysis
- 2026PlanGuard: Defending Agents against Indirect Prompt Injection via Planning-based Consistency Verification
- 2025ExplainableGuard: Interpretable Adversarial Defense for Large Language Models Using Chain-of-Thought Reasoning
- 2025D-REX: A Benchmark for Detecting Deceptive Reasoning in Large Language Models
- 2026Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning