BASIS: Breach-Aware Selective Prompt Injection Shielding with Prefill Attention Probes

Laiqiao Qin, Tianqing Zhu, Longxiang Gao, Wanlei Zhou
8/8/2026
cs.CRcs.LG

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{qin2026basis,
  title  = {BASIS: Breach-Aware Selective Prompt Injection Shielding with Prefill Attention Probes},
  author = {Laiqiao Qin and Tianqing Zhu and Longxiang Gao and Wanlei Zhou},
  year   = {2026},
  eprint = {2608.08027},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.08027v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.08027.svg)](https://codeofpaper.com/paper/2608.08027)

Discussion