Quarantining Injected Pages Before They Reach the Model
Blocking pages at retrieval works: exposure falls by more than 80% while clean ranking barely moves. The evidence stops at four known page families, and the false-quarantine rate overshoots the budget it was tuned against.
On this page
Your support bot got 3 refund answers wrong last week, but the logs point at a help page it cited, not at the model. Most people treat that as a model problem: add a rule, add a classifier, tell the system to ignore text inside pages. Wrong. The page only mattered because a search step picked it, ranked it, and pasted it into what the model reads. If you run search plus generation, your real decision is which pages enter that pile. This paper moves it earlier and prices it[1].
The Default Reading Is Wrong: The Entry Point Is the Search Result
A sentence buried in a web page can change what a model does; that has been demonstrated for years[1]. Three steps: found, ranked, pasted into the text the model reads.
Indirect prompt injection means the attacker never touches your system: they write one line on a public page you will retrieve, then wait to be invited in.
Most teams file this under model behavior: rules, classifiers, a line telling the model to ignore web instructions. That helps, but it assumes the bad thing is already indoors.
Moving the decision earlier means a gate between steps two and three. Each candidate gets a risk score; anything above the threshold is skipped, survivors keep their order, lower-ranked pages refill to ten. Call it quarantine.
No page is deleted, no publisher is branded. One less sheet of paper on the desk.
That is the whole trick.
What the Paper Actually Ran: 300 Queries, Four Page Families, Three Retrievers
The corpus is SciFact, scientific abstracts in BEIR format: 5,183 documents, 809 training queries, 300 test queries. A hash splits the training set into 655 fitting and 154 calibration; the test 300 never touch either.
Payloads come from BIPIA text attacks, filtered to 9 categories for fitting, 3 for calibration, 13 for test. Malware, fraud, propaganda, and political persuasion were dropped; counts are the authors', not BIPIA's.
Four page families. Title stuffing repeats query terms in title and lead; a doorway page opens with a query summary and slides the payload in behind it; a near duplicate keeps most of an abstract and appends the instruction; hidden metadata puts query terms in indexed fields while the body stays natural.
All four appear during development. Testing swaps queries and payload categories, not page families.
The scorer is a class-balanced logistic regression over relevance r, abuse cues a, instruction likelihood i, and the products a×r, i×r.
The threshold is τ=0.973853, picked on calibration to catch crafted pages while holding clean false quarantine at or below 0.5%. Recall there is 0.804, false quarantine 0.00498.
Five Inputs, One Score, and the Numbers It Produces
r is the retriever's own score, normalized. a draws on title coverage, term density, repetition, source overlap, and markup oddities — the old web-spam toolkit. i matches word unigrams and bigrams plus character 3- to 5-grams, so spacing changes do not erase the match.
The two products let abuse and instruction cues weigh more or less with relevance: a relevant page carrying an instruction and an irrelevant one should not share a ruler.
Three retrievers, 300 queries, four families: 1,200 outcomes each.
| Retriever | Exposure@10, no defense | Exposure@10, joint quarantine | Clean nDCG@10 change |
|---|---|---|---|
| BM25 | 0.9408 | 0.1583 | −0.0018 |
| Normalized hybrid | 0.9158 | 0.1508 | −0.0013 |
| LSA | 0.8450 | 0.1375 | −0.0013 |
Counts are easier to picture: BM25 drops from 1,129 exposed cases to 190, the hybrid from 1,099 to 181, LSA from 1,014 to 165. Relative drops bunch between 83.2% and 83.7%.
Clean ranking barely moves. The largest change is 0.0018 on BM25, with a bootstrap interval of [−0.0053, 0]; the other two land at 0.0013.
Small numbers.
The authors flag the caveat: an interval hugging zero is not an equivalence test.
Split the policy apart and the picture gets odd. Abuse cues alone reach 0.1436 exposure at a cost of 0.1113 nDCG; instruction likelihood alone costs 0.0071 yet leaves exposure at 0.4169; the joint policy reaches 0.1489 at 0.0014, a bargain except the three were never matched at one false-quarantine rate. By family, doorway pages leak most: 0.21 to 0.23 still exposed; near duplicates 0.197, 0.163, 0.133; title stuffing 0.080 to 0.083.
Five Steps to Try This on Your Own Stack
Nothing here needs a retrained retriever or a new model. It sits between candidates and context.
- Fix the calibration split before the threshold. Do not copy 0.97; sweep your clean traffic and keep the highest recall your budget allows.
- Keep enough candidate depth. The paper scans 100 deep and refills from below; keep ten and the answer shortens.
- Log two numbers separately: did the page reach context, did the model act on it.
- Report by page family. Doorway pages and near duplicates, closest to real content, leak most.
- Keep a downstream layer: admitted pages still need tool-call attribution and task-alignment checks.
A 0.0018 nDCG shift is tiny, but Recall@10 falls by 0.0017 on every retriever.
Do not tune to one threshold point either. Lowering it rejects more candidates, yet refill can promote a target that sat below rank ten.
Where This Method Stops Working
The first limit is the page families. All four were seen during development; testing changed queries and payload categories, nothing else, and no attack knew the decision rule. The second is the false-quarantine rate: the budget was 0.5%, the frozen threshold produced 0.590%, 0.620%, and 0.650% on test, overshooting by 0.09, 0.12, and 0.15 points, and calibration counts went unreported.
The third sits downstream. In the 104-case generation follow-up, all 104 targets reached the undefended top five; after quarantine, 21 remained and 83 contexts lost the instruction. But the undefended side produced no confirmed hijack either: 0 confirmed, 4 unresolved per cell, 48 of 1,200 judgments unresolved. The endpoint was post hoc, non-blinded.
So the material supports one claim: pages were removed, not that attack success fell.
SciFact holds abstracts only: no rendered pages, links, freshness, or publisher reputation; LSA is no stand-in for neural encoders.
One line worth screenshotting: it counts how many sheets of paper the door stopped, not whether anyone inside obeyed them.
