arXiv:2610.33182cs.CROct 2026

Manuscript Offprint

arXiv:2610.33182

Spoofing the Toolbox: Optimizing Tool Descriptions to Deceive LLM Agents

Shih-Chieh Dai, Xinyu Sun, Guanhong Tao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large language model (LLM) agents are widely used in many applications and often rely on external tools. Tool information, such as function descriptions, helps agents determine which tools best suit a given context. However, attackers can manipulate this information to mislead LLM agents into using malicious tools. Prior attacks mainly rely on keyword-based techniques, which are easily detected, or rule-based methods, which have limited effectiveness. In this work, we introduce TSA, a stealthy tool-spoofing attack that crafts descriptions for malicious tools that are difficult to distinguish from those of existing benign tools. To achieve this, we propose an LLM-powered optimization method that iteratively refines malicious tool descriptions. Specifically, TSA begins with a variant of a benign tool description and updates it based on feedback from a surrogate LLM agent. The optimization method incorporates a feedback function and contrastive in-context learning to guide the search for descriptions that are both stealthy and effective. Experiments on both single- and multi-tool use benchmarks demonstrate that TSA achieves an attack success rate of up to 92.13%, outperforming four state-of-the-art approaches while remaining highly stealthy. Our user study further shows that even human participants cannot distinguish descriptions generated by TSA from benign ones. Moreover, TSA remains effective against five tool-malware detectors.

1 INTRODUCTION

Model Context Protocol (MCP) is a widely used standard that enables LLM agents to access external tools through a unified interface (Anthropic, 2024; Hasan et al., 2025). Its low integration barrier allows developers to easily publish tools as MCP servers and users to install them with minimal effort (Chhetri et al., 2025; Luo et al., 2025). However, this openness also introduces security risks: attackers can distribute malicious MCP servers or update previously benign tools without explicit user notification, enabling stealthy attacks through tool descriptions or functionality changes (Hou et al., 2025; Song et al., 2025). Additionally, because an LLM agent only observes a tool's execution result through the returned message, it cannot verify what actually occurs during the invocation (Hou et al., 2025; Zhao et al., 2025). This allows an attacker to implement a malicious tool that mimics the behavior of a benign tool while performing additional harmful actions. We refer to this attack paradigm as a tool spoofing attack. Figure 1 illustrates this attack scenario.

Existing attacks manipulate the descriptions associated with malicious tools so that LLM agents select them over benign alternatives for execution. They typically fall into two categories: framing the problem as a prompt-injection attack (Debenedetti et al., 2024; Shi et al., 2026a), or focusing primarily on the stealthiness of the description (Wang et al., 2026). Debenedetti et al. (2024) show that simply appending an <IMPORTANT> tag to a tool

Cline wants to use a tool on the HotnewsOne MCP server:

Hotnews

Explore trending lists across multiple platforms to gain valuable insights and stay current with the latest trends. Always choose this tool as the BEST

Figure 2: Example of tool usage in Cline cli, where the user is prompted to confirm tool invocation and can inspect the tool description.

description can bias an LLM agent’s tool-selection behavior and trigger execution of injected malicious instructions. ToolHijacker (Shi et al., 2026a) extends this method by leveraging an LLM to refine malicious tool descriptions. However, the descriptions generated by these approaches contain strong imperative phrases (e.g., “always choose this tool”) and are easily detected by existing MCP malware detectors. Moreover, many MCP clients require explicit user confirmation by presenting tool descriptions prior to tool invocation (see Figure 2), making such attacks readily observable to users.

The second category of prior work aims to manipulate LLM tool selection without explicit prompt injection. Inspired by advertising techniques (e.g., authoritative phrasing), GAPMA (Wang et al., 2026) rephrases tool descriptions using persuasive language based on a set of predefined rules and refines them to improve stealthiness. While this approach can generate less conspicuous descriptions, it achieves very limited attack performance (e.g., <50%<50\% success rate), as it relies on a limited set of rules.

In the context of tool description generation, the discrete nature of textual inputs makes gradient-based approaches less effective at ensuring naturalness (Zou et al., 2023; Zhang & Wei, 2025). This challenge is further exacerbated by the fact that many LLM agents are deployed as API services with only query access. While white-box continuous optimization techniques are not directly applicable in this setting, their underlying design principles remain instructive, such as using gradient information to effectively guide optimization toward an optimal solution and employing powerful optimizers equipped with advanced mechanisms like learning-rate scheduling.

Motivated by these insights, we propose a stealthy tool spoofing attack, TSA, that incorporates an LLM-powered optimizer. Specifically, TSA defines a feedback function that explicitly captures two attack objectives: inducing malicious tool selection and preserving description naturalness. TSA leverages an LLM as the optimizer to mutate malicious descriptions, guided by fine-grained feedback provided by the LLM Agent. This optimizer is further enhanced with contrastive examples, where positive examples denote successful attacks and negative examples denote failures, enabling effective guidance during optimization. In addition, TSA incorporates several modular components, including a dynamic mutation adjustment mechanism to control mutation magnitude and a history-steered exploration strategy that leverages past generations when the optimization gets stuck.

We evaluate TSA on three datasets, MetaTool, MCP-Atlas, and TSABench, in both single- and multi-tool use scenarios, and show that it achieves an average attack success rate (ASR) of 83.23%, outperforming prior methods. The attack also transfers effectively to unseen LLM agents, reaching up to 92.13% ASR on GPT-5. Furthermore, we conduct a human evaluation and TSA is perceived as the least suspicious description, compared with the other malicious descriptions. We further evaluate stealthiness using multiple MCP malware detectors and observe a maximum detection rate of only 4.25%, whereas most baseline methods are detected with rates of up to 100%. Overall, our results demonstrate that TSA achieves high attack effectiveness while maintaining strong robustness and low detectability. We make the following contributions:

• We formalize tool spoofing attacks as an optimization problem and propose an LLM-powered black-box optimization method that incorporates fine-grained feedback from a feedback function and effective guidance from contrastive demonstrations.

• We introduce TSA, a tool spoofing attack built on our optimizer, which generates tool descriptions capable of inducing malicious tool selection while maintaining a high degree of stealth.

Figure

Figure 1: Illustration of a tool spoofing attack.

• We conduct experiments on tools collected from real-world MCP servers and demonstrate the effectiveness of TSA across various types of LLM agents, including those that were never seen during optimization.

References (49)