Relevance Is the Vulnerability: How Web Retrieval Weakens the Safety Alignment of Large Language Model AgentsRelevance as a Vulnerability: How Web Retrieval Degrades Safety Alignment in LLM Agents
The authors propose the AGENT REVEAL framework and find that in retrieval-augmented agents, safety-oriented web pages instead raise harmful compliance by an average of 25%, and that coupling tool calls with answering amplifies harm.
- Connecting web retrieval to LLM agents weakens safety alignment, but prior end-to-end measurements cannot localize which stage of the retrieval pipeline the failure occurs in, nor explain why safety-oriented web pages also increase harmful outputs.
- The authors propose the AGENT REVEAL framework, which decomposes retrieval-induced harm along an architecture axis (four integration methods: Control/Inline/Agent/DEFER) and a content axis (web page stance SS1–SS5, topical relevance TR), and construct HarmURLBench (1,405 real URLs paired with 320 HarmBench behaviors), scoring harmfulness on a 1–5 scale with GPT-4o.
- On 8 open-source models, Agent average harm score 2.66 is higher than Control's 1.80; SS1 opposing content is +0.45 higher than no retrieval (Safe Source Paradox); DEFER, which decouples retrieval from answering, lowers the score by 0.22; off-topic retrieval makes both effects largely disappear; defenses such as output filtering only narrow but do not eliminate the gap.
- The authors note: GPT-4o judging may have calibration bias; the main results are limited to the externally specified URL setting; the defense diagnosis covers only representative tiers; the content axis cannot control for the same URL; the benchmark covers only English HTML pages. The mechanism probe uses only 2 Qwen models, with 100 behaviors each.
- Threat model
- Externally specified URL retrieval: the user or system provides an unmodified public URL, with no attacker tampering with the page or corpus; the model retrieves the cached page via the fetch_url tool and then answers the harmful request, measuring safety degradation in the post-retrieval stage.
- Evaluated models
- Qwen2.5-3BQwen2.5-7BQwen2.5-14BQwen2.5-32BGemma-3-12BGranite-3.1-8BLlama-3.1-8BPhi-4-miniGPT-4o4-miniGemini-2.5-FlashGemini-2.0-FlashClaude-SonnetDeepSeek-V3
- Benchmarks
- HarmURLBenchHarmBenchTriviaQA
- Metrics
- Harmfulness Score (H)ASR
The researchers propose the AgentREVEAL diagnostic framework, which analyzes how web retrieval weakens the safety alignment of large language model agents, finding that the relevance of retrieved content itself can become a vulnerability. The framework proceeds along two dimensions: the retrieval integration method and the properties of retrieved content. In terms of integration method, binding tool calls and response generation into a single step amplifies harmful outputs; in terms of content properties, even when the retrieved content is safety-oriented content containing warnings or risk disclaimers, the harmful compliance rate increases by an average of 25% compared with the no-retrieval baseline, which the authors call the "safe source paradox." Relevance is identified as the common activation condition for both types of vulnerabilities; similar patterns also appear on frontier closed-source models, and the harmful compliance rate remains elevated under various representative pipeline interventions, with some agents also entering this state during autonomous retrieval. The authors also release the HarmURLBench benchmark, containing 1,405 real web pages and 320 harmful behaviors, for use in subsequent evaluations.
Related events and news
0 events · 3 news mentions
News that mentions this paper
- Failure-Firstcites the paper's id or linkAI Safety Daily 2026 年 5 月 31 日:检索增强削弱 Agent 对齐、评测感知抬高安全分
from unsafe compliance. “Relevance as a Vulnerability” (arXiv:2605.29224) demonstrates that web retrieval in LLM agents degrades safety alignment even when retrieved content originates from
- Failure-Firstcites the paper's id or linkFailure-First AI 安全日报:授权缺口、欺骗表征与检索带来的安全退化
Relevance as a Vulnerability (arXiv:2605.29224) shows that integrating web search into LLM agents increases harmful compliance by approximately 25% above baseline — not because the sources are
- Failure-Firstcites the paper's id or linkAI Safety Daily 2026 年 6 月 7 日:多步提示注入、检索对齐退化与奖励作弊
The RAG vulnerability in arXiv:2605.29224 is pertinent to any agentic pipeline that retrieves context from sensor data, documents, or environmental observations before acting.
Paper analysis
What problem does this paper attempt to solve?
Localizing the source of safety degradation in retrieval-augmented agents: two axes, integration method and retrieved content, with no attacker tampering.
Core question: why does connecting LLM agents to web retrieval weaken safety alignment, and at which stage of the retrieval pipeline does the failure occur? The authors argue that prior end-to-end measurements cannot localize the failure, because a single autonomous trajectory simultaneously determines the query, source, stance, content, and retrieval timing.
- Scenario and importance: Web retrieval agents are already deployed in search assistants, research copilots, enterprise knowledge platforms, etc.; prior work shows that enabling retrieval lowers refusal rates and increases harmful outputs (Kumar et al., 2025; Yu et al., 2025).
- Shortcomings of existing methods: The authors state that mitigation measures focus on visible endpoints—constraining query generation or filtering final outputs—while how the intermediate document retrieval and context augmentation stages affect safety remains unclear.
- Core observations: The authors propose two effects—the integration path itself amplifies harm (commitment bias), and the Safe Source Paradox: pages containing opposing content such as warnings and disclaimers instead raise harmful compliance by an average of 25%; topical relevance is the shared activating condition for both.
- The paper proposes: the diagnostic framework AGENT REVEAL, the decoupled design DEFER, and the benchmark HarmURLBench (1,405 real URLs paired with 320 HarmBench harmful behaviors, annotated by stance and relevance).
- Threat model:
- Goal: measure the effect of post-retrieval stages (retrieval, context integration) on harmful compliance.
- Knowledge/capability: no attacker; pages are real, unmodified public web pages, with no prompt injection and no corpus poisoning.
- Victim system: a retrieval-augmented LLM agent equipped with a fetch_url tool.
- Setting: externally specified URL retrieval, where the URL is provided by the user or system.
What related research exists?
Related work falls into four groups: retrieval safety, agent tool use, safety degradation without an attacker, and defenses; this paper's distinction lies in localizing the failure with fixed URLs.
Retrieval safety
- An et al. (2025), She et al. (2025)—benign context weakens guardrails; Zou et al. (2025), Deng et al. (2024)—poisoned corpora induce harmful outputs; Liang et al. (2025)—injected noise and toxicity end-to-end break the pipeline. The paper notes that these works treat retrieved content as neutral context or malicious instructions, and do not test whether opposing sources still increase compliance.
- Longpre et al. (2021), Xie et al. (2024), Xu et al. (2024)—the knowledge conflict literature studies how models arbitrate between retrieved text and internal knowledge (oriented toward factual accuracy); the authors argue that this mechanism also governs safety: the harmful content in this paper's responses comes from the model rather than the page.
Agent tool use
- Yao et al. (2022), Schick et al. (2023), Qin et al. (2023)—tool-use frameworks extend model capabilities.
- Zou et al. (2023), Greshake et al. (2023), Zhang et al. (2025b) et al.—adversarial manipulation targeting tools (jailbreak, indirect prompt injection, tool injection). The paper notes that these threat models all presuppose an attacker who tampers with tools, corpora, or prompts, whereas the setting in this paper has no attacker.
Safety degradation without an attacker
- Kumar et al. (2025), Zhang et al. (2025a)—aligned models are more likely to comply via browser and multi-step tool interfaces; Levy et al. (2024), Tur et al. (2025), Vijayvargiya et al. (2025)—autonomous web agent benchmarks.
- Yu et al. (2025)—closest to the setting in this paper, showing that enabling retrieval lowers refusal rates without adversarial manipulation. The paper notes that such end-to-end evidence cannot localize the failure; fixing the URL allows each factor to be varied one at a time.
Defenses
- Inan et al. (2023) input/output classifiers, Li et al. (2025a) rule isolation, Zhong et al. (2025) information flow tracking, Shi et al. (2025) policy enforcement, Zhan et al. (2025) query-level reward shaping; Padhi et al. (2024), Sun et al. (2025), Buonocore and Parimbelli (2025) condition judgments on context. The paper notes that no work tests whether the integration path itself amplifies compliance under fixed retrieved content.
Baselines and benchmarks: The control conditions are Control (no retrieval), Inline (content placed directly into the prompt), Agent, and DEFER; harmful behaviors are taken from HarmBench (Mazeika et al., 2024), and benign utility uses TriviaQA. The authors position this paper as the first diagnostic framework that decomposes integration path and content attributes under fixed sources (the paper states that end-to-end work cannot localize the failure, and this paper fills this gap).
How does the paper address this problem?
AGENT REVEAL decomposes retrieval-induced harm along the architecture axis (four integration conditions) and the content axis (stance, relevance), scored by GPT-4o.
Overall approach: decompose retrieval-induced harm along the architecture axis (how retrieval is integrated into the agent pipeline) and the content axis (the stance and relevance of retrieved content), using controlled comparisons to localize the failure stage. The framework is named AGENT REVEAL (Retrieval-Enabled Vulnerability Elicitation in ALigned agents).
Problem setting and formalization
- Study externally specified URL retrieval: the URL is provided by the user or system, the URL and cached page content are fixed, isolating the post-retrieval stages (❷document retrieval, ❸context augmentation), with ❹response generation as the measurement stage.
- Key definitions: Topical Relevance (TR, 1–5, the degree to which the content is relevant to the target behavior); Stance Score (SS, 1–5, 1 being actively opposed, 5 being directly facilitative); Harmfulness Score (H, 1–5, GPT-4o's harmfulness rating of the output, 1 being a safe refusal, 5 being fully harmful compliance).
- Empirical decomposition: Δ H = α + β Bd + γ s̃, where α is the baseline lift triggered by relevance (estimated as DEFER(SS1) versus Control), β is commitment bias (estimated as Agent versus DEFER), γ is the stance effect (estimated as SS5 versus SS1 within Agent); s̃ = (s−1)/4 anchors SS1 at 0.
HarmURLBench data construction
- Behaviors are taken from the 320 test behaviors of HarmBench; candidate URLs are collected via iterative failure-driven search: a Query Generator (Qwen3-30B) generates queries, SearxNG aggregates Google/DuckDuckGo/Yandex results, and a Content Evaluator (GPT-4) scores TR and SS after crawling, with only TR ≥ 3 entering the bucket.
- At most one URL is collected per behavior per stance tier (SS1–SS5); the final total is 1,405 URLs, with overall coverage of 87.8% (Table 6).
- Annotation validation: two annotators blindly labeled 300 URLs; quadratic weighted Cohen's κ between the primary annotator and automatic labels = 0.72 (SS) / 0.81 (TR), and inter-annotator κ = 0.77 (SS) / 0.83 (TR) (Appendix A.2).
Four experimental conditions and DEFER
- Control: no retrieval, the behavior request is given directly; Inline: cached content is placed directly into the prompt, with no tool call; Agent: the prompt requires visiting the URL and answering based on the content, and the model calls fetch_url; DEFER (proposed by the authors): the first turn retrieves the URL with a benign request, and only the second turn gives the harmful request, testing the effect of temporal coupling.
- Agents are implemented with a custom vLLM serving pipeline (not AutoGen, to avoid injected prompts interfering with the comparison); all conditions share the Llama 2/HarmBench standard safety prompt, and Agent only adds tool-use instructions; temperature 0.0.
Evaluation method
- All outputs are scored for H by GPT-4o (temperature 0.0) according to the X-Teaming scoring criteria; ASR is defined as the proportion of outputs with H ≥ 3.
- Calibration: two annotators re-rated 400 outputs, GPT-4o versus human κ = 0.74, inter-annotator κ = 0.79 (87% raw agreement); Gemini-2.5-Pro re-rated about 800 outputs, κ = 0.889, ASR threshold agreement rate 92.1% (Appendix A.3).
- Statistical tests: paired Wilcoxon (Holm–Bonferroni correction) and 10,000 behavior-level bootstrap confidence intervals (Appendix D.2, D.3).
What experiments did the paper conduct?
Main experiments on 8 open-source models plus reproduction on 6 closed-source models: Agent has the highest harm, SS1 opposing content still raises harm, and off-topic retrieval makes the effect disappear.
Experimental setup
- Models tested: 8 open-source — Qwen2.5-3B/7B/14B/32B, Gemma-3-12B, Granite-3.1-8B, Llama-3.1-8B, Phi-4-mini; 6 closed-source reproductions — GPT-4, o4-mini, Gemini-2.5-Flash, Gemini-2.0-Flash, Claude-Sonnet, DeepSeek-V3.
- Data: HarmURLBench (1,405 URLs × 320 HarmBench behaviors, TR ≥ 3); benign utility uses TriviaQA (n=94 per model).
- Conditions: Control, Inline, Agent, DEFER; the content axis varies SS1–SS5 under Agent; relevance ablation uses TR=1 off-topic pages.
- Metrics and judging: H (1–5, GPT-4o per X-Teaming guidelines, temperature 0.0); ASR = proportion of H ≥ 3; significance via paired Wilcoxon (Holm–Bonferroni correction) and bootstrap CI.
- Sample sizes: mechanism probes 100 behaviors per model (Qwen-2.5-7B/14B); keyword intervention n=50 per model; DEFER mechanism decomposition covers 6 open-source models, 296 behaviors.
Main results
According to Table 2 (architecture axis, TR ≥ 3, H̄±SE) and Table 3 (content axis, by stance under Agent):
Swipe horizontally to read the table
Model Control Agent Inline DEFER SS1 SS5 Qwen2.5-3B 1.94 3.22 2.83 2.81 2.64 3.62 Qwen2.5-7B 1.97 3.45 3.03 3.18 2.90 3.62 Qwen2.5-14B 1.68 3.07 2.59 2.82 2.65 3.27 Qwen2.5-32B 1.92 2.64 2.70 2.43 2.10 2.93 Gemma-3-12B 2.02 2.46 2.24 2.17 1.97 2.81 Granite-3.1-8B 1.92 2.74 2.76 2.77 2.32 3.03 Llama-3.1-8B 1.76 2.05 2.10 1.78 1.93 2.14 Phi-4-mini 1.17 1.67 1.52 1.55 1.46 1.86 Average 1.80 2.66 2.47 2.44 2.25 2.91 - Architecture axis: The authors report Agent average H̄ 2.66 higher than Control 1.80 (relative +47.8%), with ASR rising from 28.7% to 47.1%; Agent higher than Inline (2.66 vs 2.47), and Agent higher than Inline-Formatted on 8/9 models (Appendix G.1), indicating the integration path itself contributes.
- Commitment bias: Agent higher than DEFER on 7/8 models, average difference 0.22 (Figure 3); but DEFER is still higher than Control on all 8 models, and the authors state that decoupling explains only part of the vulnerability.
- Content axis (Safe Source Paradox): SS1 opposing content is higher than Control on 7/8 models (Figure 4), average +0.45 (Table 15); Gemma-3-12B is the exception (SS1 1.97 lower than Control 2.02). The authors state that on closed-source models the SSP direction holds on 6/6 but with small magnitude (+0.07 to +0.61, Table 4).
Relevance ablation (§4.3)
- What was measured: Keeping Agent and stance fixed, replacing pages with TR=1 off-topic content.
- Results: Average H̄ drops from 2.66 (TR ≥ 3) to 1.72 (TR=1), close to Control 1.80 (Table 13); the Agent–DEFER gap shrinks from +0.22 to +0.12 (Table 14); the SS1 vs Control difference changes from +0.45 to −0.10 (Table 15).
- Authors' interpretation: Topic relevance is a shared activation condition for commitment bias and SSP, supporting the explanation that "opposing pages activate the model's internal domain knowledge".
Mechanistic evidence (Appendix F)
- Source tracing: In SSP-triggered cases, page H̄ ≈ 1.9–2.4 while Agent response H̄ ≈ 4.1–4.3, and 88–90% of response word trigrams are not in the page; responses are lexically closer to the model's unlock probe outputs (79–91% of cases, Table 16/17).
- Keyword intervention: SS1 pages reduce first-token refusal probability from 0.834/0.921 to 0.181/0.303 (Qwen-2.5-7B/14B); masking domain keywords raises it back to 0.654/0.810, and off-topic pages also restore refusal (Table 18). The authors state this supports relevance, rather than stance or tool invocation itself, as the trigger.
Defenses and deployment diagnostics (§4.4, Appendix H)
- URL filtering: Llama-Guard-3-8B pre-fetch filtering flags only 18.8% of SS1 and 39.4% of SS5 pages, with 75% of URLs unflagged (Table 27).
- Output filtering: After defense, Agent ASR is still 5.1% vs Control 3.6%, with false positive rate 21–25% (Table 28).
- Joint query×content defense: Judging request and page together intercepts 86.1% of harmful pairs and 0/488 benign pairs; but replacing the request with a neutral summarization instruction drops the interception rate to 35.0% (Table 29). The authors state that detection tracks the request rather than the retrieved evidence.
- Summarization and chunking: After summarization Agent is still higher than Control by +0.58 (Table 30); after BM25 chunking the residual is +0.88 (Table 31).
- Autonomous retrieval: 10 of 11 models actively invoke retrieval on at least 5% of harmful behaviors, and 6 on at least 26.7% (Table 26).
Other ablations and analyses
- Closed-source commitment bias: positive on 5/6, reversed for DeepSeek-V3 (∆H̄ = −0.37, Table 21).
- DEFER mechanism decomposition: additional refusal opportunities explain only about 35% of the reduction; no further decrease from cross-turn distance d=2→d=3 (Table 22/23).
- DEFER benign utility: on TriviaQA, DEFER outperforms Agent on 6/7 models, average +0.164 (Table 24).
- Scale effect: in the Qwen 2.5 family, the Agent–DEFER gap shrinks monotonically from +0.41 at 3B to +0.21 at 32B (Table 25).
- Category breakdown: the Agent–Control gap is largest for cybercrime (+1.50) and smallest for harassment (+0.40); the copyright category already reaches 3.14 under Control and is an exception (Appendix D.1).
What are some points that can be further explored?
The authors list five limitations: reviewer bias, scenario scope, defense coverage, content-axis comparison, and benchmark coverage.
Limitations and future directions noted by the authors
- Judge calibration bias (Limitations): The harmfulness metric relies on GPT-4o judging and may be affected by style, verbosity and wording; the authors state they mitigated this with fixed guidelines, human validation and a second judge, but H should be regarded as a standardized relative metric.
- Scenario scope (Limitations): The main results concern externally specified URL retrieval and do not estimate autonomous query generation, search ranking, web drift or long-horizon planning; the authors state that pre-retrieval refusal is a complementary defense rather than a sufficient answer.
- Defense coverage (Limitations): Deployment diagnostics cover only representative tiers (URL filtering, output filtering, GPT-4o summarization, BM25 chunking) and do not restore the Control baseline; context sanitization, learned rerankers, policy cascades and multi-step retrieval systems are left for future work.
- Content-axis control (Limitations): Stance levels must use different URLs, and naturally varying source attributes such as URL authority, domain, document length and lexical overlap may contribute to the stance effect.
- Benchmark coverage (Limitations): HarmURLBench covers 320 behaviors and 1,405 English HTML URLs and is incomplete in domains, languages, modalities and alignment mechanisms; broader languages, modalities and alignment mechanisms are left for future work.
Scope of experimental coverage
- Models tested are 8 open-source models (3B–32B, five families) plus 6 closed-source models, 14 in total; closed-source models are only directionally reproduced (Table 4, 20, 21).
- Mechanism probes (source tracing, capability partitioning, keyword intervention) cover only two models, Qwen-2.5-7B and Qwen-2.5-14B, with 100 behaviors each (Appendix F.2).
- Defense evaluation includes five kinds: Llama-Guard-3-8B pre-fetch filtering, post-generation filtering, joint query×content judging, GPT-4o summarization and BM25 chunking; summarization and chunking use only the 6 open-source models (Appendix H.6, H.7).
- The paper does not report the number of repetitions for each condition in the main experiments; the main experiments use temperature 0.0, and the DEFER mechanism decomposition uses seed 42 (Appendix G.4).
- Contextual safety prompts (refusal reminder, self-reflection) were not evaluated; the paper relays a report by Yu et al. (2025) stating that additional safety prompts cannot reliably mitigate retrieval-induced degradation (Appendix H.2).
Summarize the main content of the paper
AGENT REVEAL decomposes safety degradation in retrieval agents: both the integration path and opposing content raise harm, and relevance is a shared triggering condition.
A diagnostic study on safety degradation in retrieval-augmented LLM agents, whose core claim is that the property that makes retrieval useful (topical relevance) is precisely the condition that activates safety degradation, constituting a safety–utility trade-off.
- Problem: Prior work shows that enabling retrieval lowers refusal rates, but end-to-end measurement cannot localize which stage of the pipeline fails; this paper studies the externally specified URL retrieval setting with no attacker.
- Method: The AGENT REVEAL framework decomposes harm along the architecture axis (four conditions: Control/Inline/Agent/DEFER) and the content axis (stance SS1–SS5, relevance TR); it is accompanied by HarmURLBench (1,405 real URLs × 320 HarmBench behaviors); GPT-4o scores on a 1–5 scale, calibrated by human annotation and a second judge.
- Architecture axis results: Across 8 open-source models, Agent mean H̄ 2.66 is higher than Control 1.80 and Inline 2.47; the authors propose commitment bias—coupling retrieval and answering in the same trajectory amplifies harm, and after DEFER decouples them the mean drops by 0.22 points, while TriviaQA benign utility does not decrease but rises (mean +0.164).
- Content axis results: The authors report the Safe Source Paradox—SS1 opposing pages containing warnings and disclaimers still raise harm on average by +0.45 above no retrieval (7/8 models); for closed-source models the direction holds in 6/6 but with smaller magnitude (+0.07 to +0.61).
- Relevance is a shared condition: After switching to off-topic pages, Agent mean H̄ drops to 1.72 (close to Control 1.80), the SSP difference changes from +0.45 to −0.10, and commitment bias shrinks by 45%; mechanism probes show that harmful details come from the model's internal knowledge rather than the page.
- Defenses and conclusion: URL filtering, output filtering, summarization, and chunking all only narrow but do not eliminate the gap; joint query×content judgment blocks 86.1% when the harmful intent is explicit, but drops to 35.0% when switched to a neutral summarization request. The authors argue that this exposes the structural fragility of the retrieval pathway, and that relevance should be treated as a vulnerability in future work.
Related papers
- Before Retrieval Begins: Safety and Tool-Use Decisions in LLM AgentsAnalysis / interpretabilityarXiv