SearchInject: retrieval exposure control for indirect prompt injection in language model searchSearchInject: Retrieval Exposure Control for Indirect Prompt Injection in Language-Model Search
The authors propose SearchInject, which isolates pages by a joint risk score before retrieval results enter the model context; the authors report that on SciFact, Exposure@10 for three retrievers decreases relatively by 83.2–83.7%.
The attacker controls the titles, body text, and markup-like metadata of pages published for a known query family; the service provider controls the retrieval and generation pipeline, and the defender can observe queries, candidate text, and ranker scores. Pages are fixed before the final evaluation, and the attacker does not adapt based on defense outputs.
- Search-augmented language models place retrieved third-party web pages into the context, and attackers can embed instructions in pages (indirect prompt injection), but a page must first be retrieved and admitted into the context. The authors focus on control at the retrieval admission stage and its cost to clean retrieval.
- SearchInject computes a joint risk score over the depth-100 candidate list (retrieval relevance, abuse cues, instruction likelihood and two interaction terms); candidates exceeding the calibration threshold are isolated and refilled to 10; the threshold is selected on the calibration set under an empirical 0.5% clean false-isolation constraint.
- On 300 held-out SciFact queries and four construction families, Exposure@10 for three retrievers decreases relatively by 83.2–83.7%, and the maximum absolute change in clean NDCG@10 is 0.0018; under the frozen threshold, the clean test false-isolation rate is 0.59–0.65%, above the calibration constraint. The 104-case generation follow-up recorded no confirmed undefended hijacking, and a decrease in attack success rate cannot be estimated.
- The authors note: the benefit of interaction terms at equal clean cost is unresolved; held-out construction families and defense-aware adaptive attacks were not evaluated; the generation endpoint is post hoc and non-blind, and there was no confirmed hijacking under the undefended condition; the experiments cover only the SciFact corpus, three lightweight retrievers, and four known construction families, and do not include dense retrievers.
- Evaluated models
- BM25normalized hybridlatent semantic analysis (LSA)Qwen3-4BPhi-4-mini-instruct
- Benchmarks
- SciFact (BEIR format)BIPIA text attacks(过滤子集)
- Metrics
- Exposure@10NDCG@10MRR@10Recall@10false quarantine rate
The researchers propose SearchInject, which isolates pages suspected of carrying indirect prompt injection at the retrieval admission stage of retrieval-augmented large language models; on three retrievers, the top-10 target exposure rate decreases by 83.2%-83.7% relative. The method forms a joint score from retrieval relevance, search abuse cues, instruction likelihood, and two relevance interaction terms, and selects the isolation threshold on a calibration set under a 0.5% clean-candidate false isolation constraint; on 300 SciFact held-out queries and held-out payload categories from four construction families, BM25's exposure rate drops from 0.9408 to 0.1583, and clean nDCG@10 changes by at most 0.0018. The frozen threshold yields a clean false isolation rate of 0.59%-0.65% on the test set, higher than the 0.5% calibration constraint. 104 cases in subsequent generation-stage experiments recorded context removal, but because a post hoc evaluation endpoint was used and hijacking cases under undefended conditions were not confirmed, the decrease in attack success rate cannot be estimated; the paper holds that the evidence supports the use of retrieval exposure control within the evaluated construction families.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:智能体安全边界在签名、授权与上下文
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:智能体的安全边界在签名、授权与上下文三层防线里
SearchInject: Retrieval Exposure Control for Indirect Prompt Injection in Language-Model Search(https://arxiv.org/abs/2611.02643)
Paper analysis
What problem does this paper attempt to solve?
Carrier pages for indirect prompt injection must first be retrieved and admitted into the model context; the authors propose control at the admission stage.
Core problem: In search-augmented language models, third-party pages carrying injected instructions must first be retrieved, ranked, and admitted into the model context; the authors treat this admission decision as the defense point.
- Scenario and motivation: Search-augmented models answer queries using retrieved third-party text, and publishers can embed instructions in pages that are unauthorized for the application; the authors state that early demonstrations have shown such content can redirect language model applications.
- Gap in existing work: The authors state that InjecAgent and AgentDojo evaluate behavior after malicious content is delivered via tool observations or the task environment, and their endpoints do not isolate the carrier-selection step; retrievable trigger fragments can cross the selection boundary under ordinary queries.
- Core idea: The authors propose a relevance-conditioned risk score plus an isolation threshold constrained by clean cost, implementing the admission policy with a logistic score and refill; the evaluation records target exposure and task hijacking separately, and a change in one quantity is not counted as a change in the other.
- Threat model:
- Attacker goal: get pages carrying injected instructions into the model context.
- Attacker knowledge and capability: control the titles, body text, and markup-like metadata of pages published for a known query family.
- Defender: the service provider controls the retrieval and generation pipeline and can observe queries, candidate text, and ranker scores.
- Pages are fixed before the final evaluation, and the attacker does not adapt based on defense outputs (non-adaptive attack).
What related research exists?
Related work is divided into three groups: injection and retrieval, complementary defense boundaries, and plugin trust boundaries; the authors position this paper as admission-decision control.
Injection and retrieval
- BIPIA (Yi et al., 2025): embeds instructions in external content paired with benign tasks to build an indirect prompt injection benchmark; this paper's payloads are taken from a filtered subset of its text attacks.
- Liu et al. (2024): formalizes prompt injection as a conflict between the application goal and the injection goal.
- PoisonedRAG (Zou et al., 2025): optimizes inserted content so that it is both retrieved and steers toward a chosen answer; this paper's constructions modify title coverage, term placement, borrowed evidence, or index metadata, connecting to content-based spam page detection (Ntoulas et al., 2006).
Complementary defense boundaries
- DataSentinel (Liu et al., 2025) and PromptLocate (Jia et al., 2026): the former evaluates detection against strategic adaptive injectors, the latter locates contaminated spans within a document. The paper notes that SearchInject scores the entire candidate before it enters the generator context, does not locate instructions, and does not guarantee that admitted pages are safe.
- StruQ (Chen et al., 2025) and SecAlign (Chen et al., 2025): use structured queries plus model training and preference optimization, respectively, to strengthen the boundary between trusted instructions and external data after retrieval.
Plugins and other harms
- Kaya et al. (2026): third-party chatbot plugins introduce trust boundary failures via crawling and application integration; the authors state that this paper's fixed corpus does not reproduce these deployment paths.
- AttriGuard (He et al., 2026) and Task Shield (Jia et al., 2025): check the causal support of tool calls and alignment with the authorized task, respectively; the authors state that admitted candidates still require such downstream controls.
- Blocker documents (Shafran et al., 2025) and Topic-FlipRAG (Gong et al., 2025): target answer availability and response stance, respectively; the authors state that these harms are outside this paper's task-substitution endpoint.
Positioning: The authors position the distinction from the above work as: control at the admission decision after retrieval and before generation, while also measuring clean retrieval cost; the evaluation benchmarks are SciFact (BEIR format) plus a BIPIA filtered subset, with no other defense method set as a comparison baseline.
How does the paper address this problem?
A five-feature logistic risk score is computed over the depth-100 candidate list; candidates exceeding the calibration threshold are isolated and refilled to 10 candidates.
Overall approach: SearchInject computes a relevance-conditioned joint risk score for each candidate page before retrieval results enter the model context; candidates exceeding the threshold are isolated (do not enter the context), and the rest are refilled to 10 in the original ranking order.
Admission policy and procedure
- For each query, the original depth-100 ranking is scanned; candidates whose risk score exceeds the threshold are skipped, and the rest are appended in ranking order until 10 are reached or candidates are exhausted.
- Removed pages are replaced by subsequent candidates in the same ranking, leaving no shortened top-10; surviving candidates are not re-ranked, and no content outside the original candidate list is retrieved.
- Isolation only means the candidate text is not placed into the generation context; no judgment is made about the publisher; exposure and confirmed hijacking are recorded separately.
Construction families (attack pages)
- Each target pairs a SciFact query with a deterministically selected source document, for four construction families in total: title stuffing (title and first sentence repeat salient terms), doorway (starts with a query-relevant summary then introduces the payload), near duplicate (retains most of the relevant summary and appends instructions), and hidden metadata (query terms placed in index fields while the body remains natural).
- Construction records retain family, source identifier, payload category, and content hash; all families appear in both development and test.
Features and risk score
- Features: normalized ranker relevance r, abuse model score a (title coverage, body word density, repetition, source overlap, markup symbols), instruction likelihood i (IDF-weighted word 1–2-grams and character 3–5-grams).
- The joint model is a class-balanced logistic regression with fixed feature order z(q,d)=[r, a, i, ar, ir], outputting s(q,d)=σ(b+β⊤ z(q,d)) as the risk score; the two interaction terms allow the contributions of the abuse and instruction signals to vary with relevance.
- Construction labels and simulated source markers are excluded; the logistic output carries no probability calibration guarantee.
Calibration and threshold
- The threshold is selected on the calibration split: maximize constructed-page recall subject to the clean-candidate false-isolation rate (the empirical ratio defined in Equation (2)) not exceeding 0.005; strictly greater than the threshold means isolation.
- The selected threshold is τ = 0.973853, with calibration recall 0.804 and false isolation 0.00498; feature definitions, fitted model, and threshold are frozen before test.
- The authors note that this empirical selection rule does not guarantee the 0.5% bound on new samples.
Evaluation design
- Primary endpoint Exposure@k: the proportion of query–family cases in which the constructed target appears in the first k pages of the admitted context; clean utility is measured on a separate unattacked corpus copy by NDCG@10, MRR@10, and Recall@10.
- The statistical unit is 300 queries, with 4 family results per query treated as repeated observations; Hoeffding's inequality under an independent-query assumption gives a conservative 95% interval for the paired reduction (Equation (4), ±0.15682), and clean metrics use a 10,000-iteration whole-query paired bootstrap.
- The generation follow-up is an exploratory endpoint: 104 cases, across two deterministic selections, four families, and 13 payload categories, with the target required to enter the undefended hybrid top five; evaluated with a conventional and a hardened prompt (the latter labels retrieved material as untrusted).
What experiments did the paper conduct?
Exposure@10 decreases relatively by 83.2–83.7% across three retrievers, and the maximum absolute change in clean NDCG@10 is 0.0018; the generation follow-up cannot estimate the change in attack success rate.
Experimental setup
- Corpus and splits: SciFact scientific abstracts (BEIR format), 5,183 documents; deterministic hash split into 655 fitting queries, 154 calibration queries and 300 held-out test queries.
- Payload: a filtered subset of BIPIA text attacks—9 fitting categories, 3 calibration categories, 13 test categories (the authors note these are study-specific subset counts, not the official BIPIA split); malware, fraud, propaganda and political persuasion categories are excluded.
- Retrievers: BM25, LSA (truncated SVD), normalized hybrid (average of normalized BM25 and LSA scores), retrieval depth 100; the authors note that LSA does not represent Dense Passage Retrieval or current learned encoders.
- Joint model: class-balanced logistic regression with features [r, a, i, ar, ir]; threshold 0.973853, refilling 10 after isolation.
- Generation follow-up: Qwen3-4B and Phi-4-mini-instruct, four-bit weights, temperature 0; prompts contain 5 sources, each truncated to 450 characters, answers limited to 128 tokens; 104 attacked cases and 90 distinct clean queries.
- Review method: automated payload-specific execution checks; the two planned independent human reviews could not participate, and the endpoint is post hoc and non-blind.
Main results
According to Table II (1,200 query–family results per retriever):
Swipe horizontally to read the table
Retriever Exposure@10 no defense Exposure@10 joint isolation Clean NDCG@10 no defense Clean NDCG@10 joint isolation BM25 .9408 .1583 .6602 .6584 Hybrid .9158 .1508 .4606 .4593 LSA .8450 .1375 .3000 .2987 - Exposure counts go from 1,129→190 (BM25), 1,099→181 (hybrid), 1,014→165 (LSA); absolute reductions 0.7825/0.7650/0.7075, relative reductions 83.2–83.7%.
- The conservative 95% intervals per Equation (4) are BM25 [0.626, 0.939], hybrid [0.608, 0.922], LSA [0.551, 0.864], based on 300 query units and an independent query sampling model.
- Clean NDCG@10 changes −0.0018/−0.0013/−0.0013; MRR@10 changes −0.0017/0/0; Recall@10 drops 0.0017 for each. The authors caution that near-zero point estimates and intervals do not constitute a formal equivalence test.
Calibration transfer and construction-family analysis
- Calibration transfer (Table III): the selected rule reaches 0.498% on calibration; at the frozen threshold, test false-isolation rates are BM25 0.590%, hybrid 0.620%, LSA 0.650%, exceeding the 0.5% constraint by 0.09, 0.12 and 0.15 percentage points respectively; the authors state that sampling and distribution differences may contribute but cannot be separated from these rates, and that calibration placement counts are not reported.
- Construction families (Table IV): exposure decreases for every construction–retriever pair; doorway pages retain the highest residual exposure (about 0.21–0.23), and near duplicate retains exposure under all three retrievers (LSA's post-isolation value is lower than BM25 and hybrid); the authors state that duplicated relevant evidence may be a difficult source but that the aggregate results cannot separate this mechanism.
Component and alternative-strategy comparison
- Component strategies (Table V, mean across retrievers): abuse signal alone gives exposure 0.1436 but clean NDCG drops 0.1113; instruction signal alone has a smaller clean loss but exposure 0.4169; joint isolation gives exposure 0.1489 and clean NDCG change −0.0014. The authors emphasize that these operating points are not matched at a common false-isolation rate, so the trade-off cannot be attributed to the interaction terms; the [r, a, i] model was not evaluated.
- Continuous rescoring: under hybrid, exposure 0.083 and clean NDCG drop 0.062; under BM25, exposure remains 0.878. Two-stage penalization changes exposure by only 0.1–0.5 percentage points relative to isolation and has a larger clean loss; on this basis the authors report direct isolation as the main strategy, but note that these are likewise unmatched operating-point comparisons.
- Instruction detector: held-out category recall 0.754, with calibration false isolation 0.00076 at its operating point; under hybrid retrieval, post-isolation exposure is 0.500 for interrogative affective requests, 0.476 for conversational requests, 0.346 for research assistance, 0.298 for task automation and 0.269 for business intelligence. Adding a simulated source marker achieves full calibration recall, but that marker encodes benchmark source information and was excluded from the main model.
Exploratory generation observations
- Context removal: all 104 selected targets enter the undefended top five; after isolation, 21 are retained and 83 contexts no longer contain the target instruction. The authors note this is a retrieval observation and is unrelated to whether the output executes the instruction.
- Behavioral endpoint (Table VI): confirmed hijacking is 0/4 under both models × both prompts (confirmed/unresolved determinations out of 104 cases per cell); the endpoint classifies 1,200 determinations as failures and 48 as unresolved; five transient positives lack the required Caesar transformation, and two misspelled claim labels lack the required automated output.
- Clean accuracy: Qwen3-4B is 40.0%/37.8% under the regular/hardened prompts, and Phi-4-mini is 52.2% under both prompts.
- Authors' interpretation: with no confirmed hijacking even under the undefended condition, together with the post hoc endpoint and repeated queries, the reduction in attack success rate due to the defense cannot be estimated; carrier removal does not resolve behavioral ambiguity and does not establish zero attack success.
Other ablations and analyses
- Threshold sensitivity: only one calibration threshold is reported; the authors state that sensitivity cannot be recovered from the aggregate results and that admission and refilling would need to be rerun.
- In the generation endpoint, four underspecified monoalphabetic-substitution cases recur across model–prompt–condition cells.
What are some points that can be further explored?
The authors list unresolved issues including interaction-term attribution, adaptive attacks, and generation endpoints; the experiments cover three lightweight retrievers and four known construction families.
Limitations and future directions noted by the authors
- Interaction-term benefit unresolved (abstract, Section VI-A): a matched-cost experiment comparing [r, a, i] and [r, a, i, ar, ir] under the same split and fitting procedure is needed; it is not currently reported.
- Adaptive attacks and construction-family holdout not evaluated (Section VI-A): all page constructions were fixed before final evaluation; the authors state that adaptive attacks could exploit knowledge of the decision rule, that a static attack suite may overestimate protection, and that neither construction-level holdout nor defense-aware attacks were evaluated.
- Threshold sensitivity missing (Section VI-A): a pre-specified grid of calibration constraints is needed, reporting test exposure, false isolation, NDCG and refill behavior without retuning on the test set; currently only one calibration threshold is reported.
- Corpus and retriever coverage (Section VI-A): SciFact lacks rendered pages, links, recency, publisher reputation and client-side content; broader transfer requires dense retrievers and independent construction families; cross-query dependence from shared sources requires higher-level clustering of the original manifest.
- Generation endpoint flaws (Section IV-C, V-D): the two planned independent human reviews could not participate, and the endpoint is post hoc and non-blind; there was no confirmed hijacking under the undefended condition, so the reduction in attack success rate cannot be estimated; prospectively defined generation endpoints and confirmed undefended attacks are needed.
- Reproduction status (Section VI-C): the original candidate records and training artifacts are unavailable in this revision, and the accompanying source code cannot replay the experiments or supply the missing components and threshold analysis; the authors do not claim a public anonymous experimental archive.
Scope of experimental coverage
- The retrievers tested are BM25, normalized hybrid and LSA, three in total, with retrieval depth 100; the paper notes that LSA does not represent Dense Passage Retrieval or current learned encoders.
- Evaluation is 300 held-out SciFact queries × four construction families (title stuffing, doorway, near duplicate, hidden metadata), 1,200 query–family results per retriever; all families appear in both development and test.
- The generation follow-up covers two models, Qwen3-4B and Phi-4-mini-instruct, two prompts, regular and hardened, 104 attacked cases and 90 distinct clean queries.
- The paper does not report calibration placement counts, per-query clustered covariance, or paired contingency tables; clean metric intervals are based on 10,000 whole-query paired bootstrap resamples.
- Comparison experiments compare the full strategy at its own recorded operating point and are not matched at a common false-isolation rate; the [r, a, i] ablation model was not evaluated.
Summarize the main content of the paper
SearchInject isolates high-risk pages at the retrieval admission stage, with relative exposure reductions of 83.2–83.7% across three retrievers and a small cost to clean retrieval.
SearchInject targets indirect prompt injection in search-augmented language models and performs admission control before retrieval results enter the model context: the attacker controls page titles, body text, and metadata for a known query family, and the defender computes a joint risk score over depth-100 candidates (a class-balanced logistic regression over relevance r, abuse score a, instruction likelihood i, and interaction terms ar and ir), and candidates exceeding the calibrated threshold 0.973853 are isolated and refilled to 10 in the original ranking order; the threshold is selected on the calibration split under an empirical 0.5% clean false-isolation constraint.
- Main results: On 300 held-out SciFact queries and four known construction families, Exposure@10 drops from 0.9408 to 0.1583 (BM25), 0.9158 to 0.1508 (hybrid), and 0.8450 to 0.1375 (LSA), a relative decrease of 83.2–83.7% (Table II).
- Clean cost: The maximum absolute change in clean NDCG@10 is 0.0018; MRR@10 changes by no more than 0.0017; Recall@10 decreases by 0.0017 each (Table II).
- Calibration transfer: Under the frozen threshold, the clean test false-isolation rate is 0.59–0.65%, exceeding the 0.5% empirical calibration constraint by 0.09–0.15 percentage points (Table III).
- Residual risk: After doorway pages are isolated, exposure remains about 0.21–0.23; interrogative sentiment requests reach an exposure of 0.500 after isolation under hybrid.
- Generation follow-up: In 104 cases, isolation removed the target instruction from 83 contexts, but there was also no confirmed hijacking under the undefended condition, and the authors state that a reduction in attack success rate cannot be estimated.
The authors' conclusion: the evidence supports retrieval exposure control within the evaluated construction families; the benefit of interaction terms at equal clean cost, matched-cost comparisons, and reduction in downstream attack success rate remain unestablished, requiring original candidate records, additional calibration comparisons, and prospectively defined generation endpoints.