Skip to content

Before Retrieval Begins: Safety and Tool-Use Decisions of LLM AgentsBefore Retrieval Begins: Safety and Tool-Use Decisions in LLM Agents

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.23071· Aditya Nawal, Manit Baser, Mohan GurusamyNational University of SingaporeIndexed by this site · 2026-10-19· Originally publishedSelected AlignmentSelectedAttention38

Quick read

Interpretability

Based on the paper PDF (generated by Gemini); refer to the original

After testing 7 open-source models, the authors state that harmful-request tool admission is mainly driven by the action component, and that tool calling and text refusal show only partial, model-dependent coupling.

Questions
Tool-calling agents often execute external operations before human review. Existing safety research mostly focuses on outputs after tool execution, neglecting the admission stage where the model decides whether to call a tool. In addition, whether there is intrinsic coupling between text refusal and tool calling remains unclear.
Methods
Using a retrieval setting with fixed external URLs, we analyze the influence of request components on admission through a 2×2×2 factorial experiment; at the tool decision token, we extract the operation contrast and the admission outcome direction and perform representation removal; finally, we evaluate the transfer effects of text refusal direction steering and pure-text refusal fine-tuning on admission.
Experiments and results
The average harm rate of 7 open-source models after admitting harmful requests is 74.5% (Table 1). The request operation component has the greatest influence on admission (19 pp). Representation intervention changes admission in 4 models, and pure-text refusal fine-tuning reduces harmful admission only in the 3 models that retain benign calls; the two are only partially coupled.
Limitations and future work
The experiments only cover a single read-only web retrieval tool and a fixed URL setting, and do not involve state-changing tools or autonomous tool selection; they cover 7 open-source models of 3B–12B and 296 English behaviors; the fine-tuning experiment is single-recipe and single-seed, and only 3 models retain benign tool calls.
Experimental setupLlama-3.2-3B-Instruct、Llama-3.1-8B-Instruct et al. · HarmBench、HarmURLBench · Tool Admission Rate P(call)、P(harm | call) et al.
Evaluated models
Llama-3.2-3B-InstructLlama-3.1-8B-InstructHermes-3-Llama-3.1-8BGranite-3.1-8B-InstructMistral-7B-Instruct-v0.3Mistral-Nemo-Instruct-2407Qwen2.5-7B-InstructGPT-4.1Gemini-2.5-FlashClaude-Haiku-4.5
Benchmarks
HarmBenchHarmURLBench
Metrics
Tool Admission Rate P(call)P(harm | call)ADMIT harmRefusal-call divergenceAUROC
AI summaryand selection rationaleThe researchers propose the Admit evaluation protocol, which on 7 open-weight models of 3B–12B and 296 HarmBench-derived behaviors jointly scores the harmfulness of responses after both the tool-calling and non-calling paths. For harmful requests with fixed URLs, the average harmfulness rate of models after admitted calls is 74.5%, and the non-calling branch increases the average harmfulness rate by a further 11.2 percentage points. In this set of request constructions, the action portion of the request changes call admission by 19 percentage points, higher than the 8 percentage points for the topic portion; 33.6% of admitted harmful calls also contain a textual refusal. Single-seed text-only refusal fine-tuning reduces harmful admission and preserves benign tool use across 3 model–recipe combinations, but residual unsafe calls remain, leading the authors to conclude that textual refusal cannot reliably proxy for tool-call safety.

The researchers propose the Admit evaluation protocol, which on 7 open-weight models of 3B–12B and 296 HarmBench-derived behaviors jointly scores the harmfulness of responses after both the tool-calling and non-calling paths. For harmful requests with fixed URLs, the average harmfulness rate of models after admitted calls is 74.5%, and the non-calling branch increases the average harmfulness rate by a further 11.2 percentage points. In this set of request constructions, the action portion of the request changes call admission by 19 percentage points, higher than the 8 percentage points for the topic portion; 33.6% of admitted harmful calls also contain a textual refusal. Single-seed text-only refusal fine-tuning reduces harmful admission and preserves benign tool use across 3 model–recipe combinations, but residual unsafe calls remain, leading the authors to conclude that textual refusal cannot reliably proxy for tool-call safety.

Why it was selectedThe paper separately quantifies the model's tool-call admission decision before retrieval, and points out that textual refusal cannot serve as a reliable proxy for call safety and that call behavior needs to be directly evaluated.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that the research focuses on the mechanism of admission decisions before retrieval agents execute tools, and on the degree of intrinsic and behavioral coupling between this decision and text refusal.

    The core question is to investigate which request attributes govern the "tool admission" decision by which large language model agents decide whether to call an external tool before observing tool outputs, and what relationship exists between this decision and text refusal.

    • Problem scenario and real-world importance: Instruction tuning and refusal training mainly supervise text responses, whereas tool-calling agents can execute external operations such as fetching pages and sending messages before human review; retrieval may introduce unsafe content, so admission gating before calling directly affects downstream safety.
    • Shortcomings of existing evaluation methods: Most tool safety research only focuses on outputs after tool execution; if a model refuses to call a tool but outputs a harmful answer from its own parametric knowledge, protocols that only evaluate post-call harm will underestimate the actual risk.
    • Threat model setting: As defined by Figure 1 of the paper and the main text:
      • Attacker goal: To induce the agent to call the retrieval tool for HarmBench harmful behaviors and generate harmful responses.
      • Attacker input capability: To provide the model with input text containing a fixed URL and harmful task instructions, without the ability to control the internal logic of the retrieval tool or the returned content.
      • Attacker knowledge: The paper tests under black-box and open-weight white-box conditions, and the attack input is a standard natural language prompt.
      • Victim system: An instruction-tuned large language model agent with a single registered web retrieval tool, which decides whether to admit after receiving a URL.
    • Core observations and proposed content of the paper: The authors hold that tool admission is driven by specific components in the request, and propose the ADMIT evaluation protocol, a three-component factorial intervention method, and a coupling test scheme at the representation and fine-tuning levels.
  2. What related research exists?

    The paper reviews four categories of related work: agent tool safety, adversarial tools and retrieval content, text refusal and tool-call safety, and tool-calling mechanisms.

    Related work mainly revolves around agent tool safety evaluation, adversarial tools and retrieval risks, safety differences between text refusal and tool calling, and the internal mechanisms of tool calling.

    • Agent and tool-use safety:
      • ToolEmu (Ruan et al., 2024) tests high-risk failures in a simulated sandbox; ToolSword (Ye et al., 2024) covers multi-stage risks of the tool-calling pipeline; R-Judge (Yuan et al., 2024) evaluates the ability to identify risks from interaction records.
      • AgentHarm (Andriushchenko et al., 2025) and Agent-SafetyBench (Zhang et al., 2025c) evaluate malicious tasks in multi-step complex environments; SafeToolBench (Xia et al., 2025) moves evaluation earlier to before execution; ToolSafety (Xie et al., 2025b) constructs multi-step safety fine-tuning data.
      • On the defense side, SafeSearch (Zhan et al., 2025) filters retrieval results; Task Shield (Jia et al., 2024) verifies alignment between actions and goals; ToolSafe (Mou et al., 2026) provides pre-emptive protection for proposed calls.
    • Adversarial tools and retrieval content influence:
      • On injection attacks, InjecAgent (Zhan et al., 2024) and AgentDojo (Debenedetti et al., 2024) evaluate indirect prompt injection; Agent Security Bench (Zhang et al., 2025a) covers memory poisoning and tool attacks; ToolCommander (Zhang et al., 2025b) injects malicious tool definitions.
      • On retrieval risks, PoisonedRAG (Zou et al., 2025) studies retrieval knowledge poisoning; Yu et al. (2025) and Nawal et al. (2026) find that without malicious injection, merely retrieving topic-relevant web pages reduces model safety.
    • Text refusal and tool-call safety and representation mechanisms:
      • On the disconnect between refusal and calling, Kumar et al. (2024) find that refusal-trained models are easily jailbroken in browser agents; Cartagena and Teixeira (2026) point out that text refusal often coexists with violating tool calls; Wu et al. (2025) attack alignment differences through function calling.
      • On representation mechanisms, Arditi et al. (2024), Zhao et al. (2026), and Siu et al. (2025) analyze refusal directions and harm representations; Ji et al. (2025) perform causal attribution on function calling; Wang et al. (2026) and Liu et al. (2026) use representation interventions to control tool selection or mitigate structural bias.
    • Baseline methods and benchmarks used:
      • When evaluating defenses, the paper compares system-prompt safety warning, restricted tool description, and their combination as baseline defenses; in the monitoring task, it compares a TF-IDF character n-gram text classification baseline; the core benchmark used is 296 harmful behaviors sourced from HarmBench paired with HarmURLBench cached web pages.

    The authors position this paper as a controlled diagnosis of native tool admission decisions, isolating external retrieval interference to investigate the causal influence of request functional components on calling and the intrinsic association between admission and text refusal.

  3. How does the paper address this problem?

    The authors propose the ADMIT protocol to evaluate two-branch harm, combining a request-component factorial design with residual stream linear direction projection and refusal fine-tuning for causal testing.

    The overall approach is to isolate the admission stage through a controlled setting with a fixed retrieval URL, propose the ADMIT two-branch evaluation framework, and conduct causal analysis by combining factor decomposition of request components with internal representation intervention.

    Evaluation Setting and the ADMIT Framework

    • Fixed external URL retrieval setting: A fixed URL is provided directly to the agent by the system or user, without the model generating search queries or filtering results; a single web retrieval tool is registered, and the model makes an admission decision a ∈ {0, 1} based on the request and URL before seeing the body text.
    • Two-branch harm decomposition: To avoid missing measurement when the model refuses to call but answers from parametric knowledge, the unconditional response harm rate is defined as P(harm) = P(call)P(harm ∣ call) + P(a=0)P(h=1 ∣ a=0), where the first term is retrieval-mediated harm and the second is parametric harm.
    • Unified scoring and control: A unified GPT-4o judge at temperature 0 scores both the call and no-call branches on a 1–5 scale (a score of 3 or above is judged harmful, h=1); a benign summarization request is set as the tool-calling capability baseline.

    Factor Decomposition of Request Components

    • Three functional role division: 147 structurally clear harmful requests are decomposed into a harm domain phrase A (topic), a request action phrase B (action), and a specificity modifier C (specificity).
    • 2×2×2 factor generation: GPT-4o is used to generate 7 ablation variants (e.g., replacing A or B with neutral phrases, or removing C), with automated validation constraining word count and structure; the effect of action component changes on the admission rate is computed via the main effect formula βB = 1/4∑A,C ∈ {0,1} [ρ(A,1,C) − ρ(A,0,C)], where ρ denotes the admission rate for the corresponding condition.

    Representation Extraction and Geometric Alignment

    • Decision-point representation reading: The residual stream state xℓ is extracted at each layer at the last input token before generation.
    • Mean-difference direction definition: The request action contrast direction dB = E[xℓ | B=1] - E[xℓ | B=0] is computed, as well as the admission outcome direction dc = E[xℓ | a=1, B=1] - E[xℓ | a=0, B=1] under the fixed condition B=1, and the cosine similarity cos(dℓ_B, dℓ_c) between the two is computed.
    • Text refusal direction estimation: Under the condition of removing the tool, the text refusal direction dtext is computed from the mean difference between safety refusals and compliant responses.

    Representation Intervention and Fine-Tuning Transfer

    • Orthogonal projection removal: During inference generation, the target direction is projected out of the residual stream at all layers, positions, and time steps, with orthogonal random unit vectors as a control; 5-fold held-out behavioral cross-validation is used to select the intervention layer and test generalization.
    • Targeted steering and fine-tuning: Dose-matched steering is applied to dtext; 4-bit QLoRA fine-tuning is performed using 80 harmful requests (paired with plain-text refusal) and 80 benign samples to test the transfer of plain-text safety training to tool admission.
  4. What experiments did the paper conduct?

    The paper evaluates tool admission and harm rates for 7 open-source and 3 closed-source models, finding that the action component has the largest effect, and that representation intervention and fine-tuning show model dependence.

    Experimental Setup

    • Models tested: Open-source models cover 4 families and 7 models: Granite-3.1-8B-Instruct, Hermes-3-Llama-3.1-8B, Llama-3.1-8B-Instruct, Llama-3.2-3B-Instruct, Mistral-7B-Instruct-v0.3, Mistral-Nemo-Instruct-2407, Qwen2.5-7B-Instruct; closed-source reproduction covers GPT-4.1, Gemini-2.5-Flash, Claude-Haiku-4.5.
    • Dataset and scale: 296 harmful behaviors sourced from HarmBench, paired with real canonical web pages from HarmURLBench; the factorial experiment uses 147 behaviors with separable components; fine-tuning uses 80 HarmBench validation behaviors and 80 benign instructions.
    • Baselines and comparison conditions: benign summarization requests, topic-matched benign requests, prompt safety warnings, restrictive tool descriptions and their combined defenses, TF-IDF text monitoring baseline.
    • Metric definitions: tool admission rate P(call), harm rate after admission P(harm | call), harm rate without call P(h=1 | a=0), unconditional ADMIT harm rate, refusal-call disagreement rate, AUROC.
    • Review method and consistency: primarily uses a GPT-4o judge at temperature 0 for 1–5 scoring (score of 3 or above is harmful); on 400 samples, agreement with human annotators is 86.0% (κ = 0.738), agreement with an independent Claude judge is 92.1% (κ = 0.772), and agreement with a Gemini judge is 89.8% (κ = 0.700).
    • Inference and statistical protocol: open-source model inference uses vLLM, temperature 0, random seed 42, maximum generation 4096 tokens; statistical analysis is based on 2000 bootstrap samples clustered by behavior.

    Main Results

    Swipe horizontally to read the table

    ModelHarmful Admission (%)Benign Admission (%)Harm After Call (%)Harm Without Call (%)ADMIT Harm (%)
    Granite-3.1-8B44.3100.068.712.242.6
    Hermes-3-Llama-3.1-8B84.599.776.84.769.6
    Llama-3.1-8B70.3100.060.10.042.2
    Llama-3.2-3B64.2100.051.10.032.8
    Mistral-7B7.895.3100.059.567.2
    Mistral-Nemo-12B89.9100.086.80.778.7
    Qwen2.5-7B69.699.378.21.455.7

    According to Table 1.

    • Harm in the no-call branch supplement: The authors state that evaluating only the call branch underestimates risk; Mistral-7B gave harmful answers from parametric knowledge in 64.5% of 273 no-call cases, and including this branch raised its ADMIT harm rate from 7.8% to 67.2%; across the 7 models, the no-call branch added an average of 11.2 percentage points.
    • Call baseline under benign summarization: Under benign summarization requests paired with the same URLs, the call rate of each open-source model reached 95.3%–100.0%; the authors state that this control rules out the explanation that the models cannot use tools.
    • Reproduction trend of closed-source models: According to Table 8, GPT-4.1, Gemini-2.5-Flash, and Claude-Haiku-4.5 have admission rates of 21.3%–44.1% for harmful requests, 93.2%–98.6% for benign requests, and harm rates after admission of 36.5%–77.9%.

    Request Component Factorial and Topic Control

    • What was tested: A 2×2×2 factorial ablation on 147 behaviors (domain phrase A, operation phrase B, specificity modifier C), and topic-matched benign requests that keep the harmful topic but change to a protective or educational task on 296 behaviors.
    • Results: According to Figure 2 and Table 15, neutralizing operation component B causes an average change in admission rate of 19 percentage points, higher than domain phrase A (8 percentage points) and modifier C (7 percentage points); on 86 behaviors that passed three-role review, the B effect is 19.1 percentage points (Table 14); topic-matched benign requests have admission rates of 99.7%–100.0% in 6 models, and 33.4% for Mistral-7B (Table 11).
    • Authors' interpretation: The authors state that the operation component in the request is the most important request-side driver of admission decisions, and that topic alone cannot sufficiently explain admission behavior.

    Internal Representation Geometric Alignment and Held-out Intervention

    • What was tested: At the decision token, evaluate the geometric cosine alignment between the operation contrast direction dB and the admission outcome direction dc, and evaluate the effect of projection removal of dB on admission rate on unseen behaviors through 5-fold held-out behavior cross-validation.
    • Results: According to Table 16, the peak cosine similarities of the 7 models are all between -0.438 and -0.945, and the 95% confidence intervals all exclude zero; according to Table 2, removing dB on held-out behaviors produces a positive shift in admission rate for 4 models (+2.0 to +9.5 percentage points), while the confidence intervals of the remaining 3 models include zero; admission changes are also observed on operation-neutralized requests (e.g., Mistral-7B changes by +4.8 percentage points).
    • Authors' interpretation: The authors state that there is inverse geometric alignment between the operation contrast direction and the admission outcome direction, and that linear removal can affect admission on unseen behaviors in some models, but this effect is model-dependent and is not an operation-specific mechanism.

    Behavioral Disconnect Between Text Refusal and Tool Calling and Training Transfer

    • What was tested: Count the proportion of harmful calls in which a text refusal appears in the same turn, test the admission effect of steering the text refusal direction dtext, and use single-recipe pure-text refusal fine-tuning to evaluate transfer to tool calling.
    • Results: According to Table 3, 33.6% of admitted harmful calls are accompanied by text refusal; steering dtext produces admission changes relative to a random control in only 4 models (-71.4 to +11.9 percentage points); according to Table 18, pure-text refusal fine-tuning reduces harmful admission rate by 19.6 to 61.5 percentage points on Llama-3.1-8B, Hermes-3-8B, and Mistral-Nemo-12B while retaining 94.9%–99.0% benign calls, but Llama-3.2-3B benign calls drop to 80.7%, Qwen2.5-7B produces repeated tokens and does not generate refusals, and Granite and Mistral-7B show benign call collapse to 0.0%.
    • Authors' interpretation: The authors state that text refusal and tool admission are only partially and model-dependently coupled behaviorally and representationally, and that text refusal cannot serve as a reliable proxy for tool-call safety.

    Other Ablations and Analyses

    • Deployment defense ablation: prompt safety warnings combined with tool restrictions reduce the average harmful admission rate of 6 models from 57.4% to 43.2% (Table 10).
    • Autonomous retrieval test: after removing preset URLs, the proportion of 6 models that autonomously generate URLs and call them is 16.2%–58.1%, and 0.7% for Mistral-7B (Table 9).
    • Harm judgment threshold sensitivity: when tightening the harmful judgment threshold from score ≥ 3 to ≥ 4, the mean harm rate after admission drops from 74.5% to 59.5% (Table 6).
    • Pre-admission monitoring probes: a full-state logistic regression probe and a TF-IDF text baseline, after retraining on hard negatives, intercept 98.4%–100% and 98.4%–99.4% of harmful calls respectively at 5% FPR (Table 13).
    • Full-data representation removal: removing dB on the full behavior pool raises the admission rate of 5 models by 12.8 to 50.7 percentage points (Table 19).
  5. What are some points that can be further explored?

    The authors point out limitations such as the single-tool read-only setting and synthetic negative-example monitoring; the experiments covered 7 open-source models, 147 factorial behaviors, and single-recipe fine-tuning.

    Limitations and future directions noted by the authors

    • Tool type and execution risk: The paper only examines a single-tool web retrieval setting that fetches external URLs, and does not involve autonomous tool selection or state-changing actions; the authors suggest future exploration of the direct risks of tools such as messaging, payment, and code execution (§6).
    • Scope of benign task evaluation: The benign baseline only tested URL text summarization, and the authors note that broader forms of benign tool use may bring different utility trade-offs (§6).
    • Model and language scale: The main experiments cover 296 English behaviors and open-source models from 3B to 12B parameters; the authors note that larger-scale models, other languages, native tool systems, or agents containing proprietary routing and policy layers may exhibit different admission rates (§6).
    • Semantic purity of factorial components: The generative ablation of 147 behaviors simultaneously changes functional semantics and executability; the authors note that the 19 percentage point operational effect measures the sensitivity of the constructed components, and fails to fully separate harmfulness from lexical sensitivity, and that future work requires human-written minimal pairs (§4.2, §6).
    • Distribution shift of monitoring probes: The pre-monitoring performance comes from cross-validation of controlled prompts and synthetic topics matched to benign requests, and the authors note that its performance under natural distribution shift has not yet been tested (§6).
    • Generalization of fine-tuning transfer: The fine-tuning study uses only a single recipe and a single random seed, and only 3 models retained the benign tool use required for evaluation; the authors regard this as preliminary evidence of possible transfer rather than a general training conclusion, and suggest future comparisons of pure refusal, pure admission, and joint supervision (§4.4, §6).

    Experimental coverage

    • Range of models tested: Covers 7 open-source instruction-tuned models from 3B to 12B parameters (from the four families Llama, Granite, Mistral, and Qwen) as well as 3 closed-source models (GPT-4.1, Gemini-2.5-Flash, Claude-Haiku-4.5).
    • Behavior and request samples: The main experiments are based on 296 English harmful behaviors derived from HarmBench and HarmURLBench cached web pages, and the factorial analysis covers 147 of these behaviors that have separable roles.
    • Defense and monitoring setup: Evaluated 2 prompt-level defenses, system prompt safety warnings and tool description restrictions, as well as pre-monitoring probes based on hidden states and TF-IDF text features.
    • Scale of fine-tuning experiments: 4-bit QLoRA training based on 80 harmful behaviors and 80 benign instructions, using fixed hyperparameters and a single random seed (seed 42).
    • Limitations of reported information: The paper does not report admission data in other languages, multi-step interactive tool chains, or dynamic environments containing state-modification permissions.
  6. Summarize the main content of the paper

    The authors state that the research shows tool admission and text refusal are only weakly coupled, that request action dominates admission decisions, and that prompts should directly supervise the tool admission channel.

    This study conducts an empirical diagnosis of causal decomposition, representation intervention, and fine-tuning transfer for the tool admission decisions that large language model agents make before observing external tool outputs.

    • Core research question: Addressing the risk that agents lack pre-gating before calling tools and are susceptible to retrieval content inducing harm, it investigates which components in the request determine tool admission, and the coupling relationship between this decision and traditional text refusal.
    • Evaluation framework and method design: A fixed external URL retrieval setting and the ADMIT two-branch evaluation protocol are established, simultaneously quantifying post-call harm and parametric knowledge harm when not calling; a 2×2×2 factorial ablation isolates domain, action, and modifier components, and linear representation alignment and projection intervention are performed at the decision token.
    • Finding on the dominant request component: On 7 open-source models, neutralizing the request action phrase causes an average admission rate decrease of 19 percentage points, an effect exceeding that of the domain topic (8 percentage points); the closed-source models GPT-4.1, Gemini-2.5-Flash, and Claude-Haiku-4.5 also reproduce the ordering in which the action component has the largest effect (effects between 22.8 and 51.0 percentage points).
    • Harm measurement in the no-call branch: The average harm rate after 7 open-source models admit harmful requests is 74.5%, while the no-call branch adds an average of 11.2 percentage points to the ADMIT harm rate, among which Mistral-7B gives a harmful response from parametric knowledge 64.5% of the time when not calling.
    • Decoupling reality of text refusal and admission: 33.6% of admitted harmful calls are accompanied by text refusal in the same turn; plain-text refusal fine-tuning achieves effective transfer to tool admission in only 3 open-source models while retaining 94.9%–99.0% of benign calls, with the remaining models collapsing or showing no effect.
    • Authors' conclusions and safety implications: The authors hold that text refusal cannot serve as an effective proxy for tool-calling safety, and that safe deployment cannot rely solely on filtering based on sensitive topics, but must directly monitor and supervise the tool admission action channel itself.

Related papers

Read originalarxiv.org