TRANSMISSION // 2611.34188v1

A relevance-first filter for prompt injection

Source published

MINE selects retrieved text by query relevance and coherence instead of detecting attacks. Its benchmark results are promising, but a targeted adaptive test and format limits show why it is not a complete defense.

AI-generated conceptual illustration for A relevance-first filter for prompt injection
AI-generated conceptual illustration; not documentary evidence.

AI assistants can retrieve useful facts alongside hostile instructions hidden in documents or tool outputs. MINE, described in an arXiv preprint, tries to reduce that risk by selecting evidence relevant to the user’s request—not by identifying attacks directly.

Retrieval-augmented generation, or RAG, gives an AI model outside information to use when answering a question. But retrieved documents are not necessarily trustworthy. An attacker may hide instructions in a web page or another source and try to redirect the model from the user’s request. This is called indirect prompt injection.

Truong Phan, Ngoc-Quan Pham and Dat Quoc Nguyen propose MINE, a filter that selects material before it reaches the language model. Rather than label text as malicious, MINE favors spans that are relevant to the query and coherent with one another. The core method requires no labeled attack examples, fine-tuning or additional language-model calls at inference time. That does not mean the full study or benchmark construction used no extra model calls: the authors used GPT-5.4-mini to help build their long-context benchmark.

How the method works

MINE’s standard splitter divides context at sentence boundaries and merges fragments until spans reach at least 50 characters. An embedding model represents the query and each span as vectors. The method then adjusts span weights to favor a group that is semantically related to the query while penalizing dispersion among the selected spans. It keeps the highest-weight spans and places the most highly weighted first.

The idea is that an injected instruction may pursue a different task and therefore be less relevant to the query or less coherent with useful evidence. If so, relevance selection may remove it without recognizing its wording as an attack. But that is an assumption, not a universal property: an instruction wrapped in on-topic text might be harder to separate, and useful evidence could, in some cases, be an outlier.

What was tested

The researchers evaluated MINE with three open-source language models on four datasets spanning short- and long-context question answering and agent tool-call injection. They also constructed LC-Inj-SQuAD by extending examples from an existing question-answering dataset. After a multi-step construction and filtering process, 694 examples were retained; their contexts averaged 4,032 words. The generated expansions were prompted to avoid mentioning the answer, but that construction aim is not a guarantee that no answer information leaked.

The comparisons included prompt-based defenses, a supervised detector and other filtering approaches. The researchers measured answer accuracy alongside attack success rate (ASR), because a defense that blocks attacks by also preventing useful answers has limited value. They tested static attacks and a particular adaptive attack, and adapted MINE for the tool-use benchmark. Across the four datasets, the authors report the best accuracy–security trade-off among the training-free defenses they compared—not among every possible defense.

Results—and their scope

On LC-Inj-SQuAD, MINE’s ASR was at most 3.31% and its accuracy at least 79.11% across the tested models and five static attack types. These figures describe that benchmark and those attacks; they do not establish performance across arbitrary documents, systems or strategies.

The adaptive test was a specifically designed two-position attack, not a test of every possible attacker. At the start of a document, the researchers used a filter-aware rewrite; at the end, they placed a conversational injection. Both were wrapped in topic-matched material intended to evade the span-level filter. In this evaluation, which used Llama-3.1-70B-Instruct only, MINE’s ASR on long-context LC-Inj-SQuAD rose to 23.20%. The authors call MINE the only usable defense in this test, but that interpretation should be read alongside both accuracy and ASR: low ASR alone does not show that a system still answers correctly.

For tool use, the researchers tested the 510-case Direct-Harm split of InjecAgent. They adapted MINE with a JSON-aware splitter, a different selection rule and document-order assembly. On this benchmark, MINE’s reported ASR-valid was 0.12% with Qwen3-30B-A3B-Instruct-2507 and 2.06% with Llama-3.1-70B-Instruct; the corresponding Valid Rates were 99.60% and 90.20%. Valid Rate matters because ASR-valid measures attacks among parseable traces, not all traces. These results concern this benchmark and adaptation, not tool-using agents generally.

Limits and uncertainty

MINE relies on useful evidence being query-relevant and mutually coherent, and injected content often differing in those respects. It is possible that malicious text could be blended with relevant material, or that legitimate evidence could be less coherent with the rest; the study does not establish how often this happens in deployment. The tailored adaptive attack demonstrates a specific way to challenge the filter, while its single-model evaluation limits how broadly that result can be generalized.

The authors note that sentence-based splitting assumes well-formed prose. Code, tables, JSON and languages with different sentence conventions may need specialized splitters; their tool-use test used a JSON-aware adaptation. More broadly, these are benchmark experiments whose results depend on the selected models, attacks, embedding model and settings. LC-Inj-SQuAD’s generated expansions provide a controlled long-context test, but do not represent every real-world document. The work is an arXiv preprint; the supplied source does not establish its review status. MINE is a relevance-based approach to reducing prompt-injection risk, not a complete solution.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.