BASIS: Breach-Aware Selective Prompt Injection Shielding with Prefill Attention Probes
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
Prompt injection is a critical security threat in large language model (LLM) applications, where attackers hijack model behavior by embedding malicious instructions in user or external data. Existing detection methods only detect the presence of injection and refuse to respond upon detection, overlooking the fact that for many modern aligned models, well-crafted instructions can resist most injection attacks. This means that the injection robustness varies significantly across instructions and models. This leads to widespread unnecessary over-refusal: inputs containing injections that the model could have handled correctly are rejected incorrectly. To deal with this over-refusal issue, we propose BASIS (Robustness-Aware Prompt Injection Defense). This defense method uses the Attention Competition Ratio (ρ) as features to train two sparse linear probes: an existence probe and a breach probe. Both probes make defense decisions through cascaded gating, which does not require additional LLM inference. BASIS comprises three stages: injection existence detection, per-sample breach prediction, and instruction robustness assessment; the online cascade refuses only when the model would actually be compromised and thus avoids over-refusal on robust instructions. Experiments across four tasks and six open-source LLMs show that BASIS maintains near-perfect injection detection while substantially reducing over-refusal on safe attack samples, especially under robust instruction templates.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 21 of its 53 references that are in the map. First posted on arXiv 8 Aug 2026.
Builds on
21 of 53 references.
Closest ancestors · 5
Same direction, newest first
- 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMs1 Nov
- 2024InjecGuard: Benchmarking and Mitigating Over-defense in Prompt Injection Guardrail Models30 Oct
- 2024Defending Against Indirect Prompt Injection Attacks With Spotlighting20 Mar
- 2024Signed-Prompt: A New Approach to Prevent Prompt Injection Attacks Against LLM-Integrated Applications15 Jan
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defenses19 Oct
Other references · 16
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2025Qwen3 Technical Reportcited by 8,195
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2023A Survey of Large Language Modelscited by 2,537
- 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,308
- 2016Understanding intermediate layers using linear classifier probescited by 1,279
- 2022In-context Learning and Induction Headscited by 930
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 831
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
4 more
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
- 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Studycited by 478
- 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 457
- 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 219
Built on by
Citing papers per year: 2026: 1.
1 paper.