Manuscript Offprint

arXiv:2610.13651

ToFu: Exploiting and Fuzzing the LLM-Orchestrator-Tool Trust Boundary

Md Nazmul Islam Ananto, Pierre Prevost-Avenel, Colin Smith, Kyungtae Kim, Taegyu Kim, Arslan Khan

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

MD NAZMUL ISLAM ANANTO, Pennsylvania State University, USA

PIERRE PREVOST-AVENEL, Université Montpellier, France

COLIN SMITH, Pennsylvania State University, USA

KYUNGTAE KIM, Dartmouth College, USA

TAEGYU KIM, Pennsylvania State University, USA

ARSLAN KHAN, Pennsylvania State University, USA

Large language models (LLMs) are increasingly deployed as agents that interact with external software through tools, with an orchestration layer translating model outputs into structured tool invocations. This architecture creates an LLM-orchestrator-tool trust boundary where tool semantics may go unenforced and LLM-generated arguments may be incorrectly treated as trusted. We present ToFu, a tool-aware framework that automatically derives semantic security checks for LLM tools from their existing metadata and a CWE-guided sanitizer corpus. ToFu specializes these checks to individual tools and automatically generates fuzzing harnesses and semantic oracles using runtime introspection and outcome sanitization. We evaluated ToFu across 273 MCP servers containing 3405 tools and identified verified bugs corresponding to CWE weakness classes in 343 tools across 118 of the servers. Our findings show that real-world tools frequently fail to enforce their documented input semantics, making it unsafe to treat LLM-generated arguments as trusted.

CCS Concepts: • Security and privacy → Software security engineering; • Computing methodologies → Intelligent agents; • Software and its engineering → Software testing and debugging.

Additional Key Words and Phrases: LLM agents, tool use, Model Context Protocol, fuzzing, semantic oracles, software security

1 Introduction

Large language models (LLMs) have demonstrated strong capabilities in natural language understanding and generation. An orchestration layer [21, 22, 28] enables an LLM to act as an agent by connecting it to tools, callable software functions that interact with the external world. The layer supplies the LLM with a user prompt alongside descriptions and input schemas of available tools. The LLM uses this information to reason about the prompt, plan actions, and generate structured tool calls specifying tool names and arguments. The layer executes these calls and returns their results as observations, allowing the LLM enabling agents to autonomously perform complex tasks, including web browsing [31], software development [5, 47], and workflow automation [41].

While tools extend the capabilities of LLMs from generating text to acting on external systems, their integration also exposes an attack surface at the LLM-tool interface. Existing work has investigated attacks that manipulate model behavior or tool use, including jailbreaks [52], indirect prompt injection [15], tool poisoning [1], tool hijacking [37], and cross-tool attacks [23].

Rather than focusing on prompt safety, we evaluate this boundary from a systems perspective: What level of trust should tools place in LLM-generated inputs? Our first insight is that a tool call is ultimately a structured model output that an orchestration layer interprets as an executable request. We exploit this interpretation through the Repeat-After-Me attack. Knowing the tool-call format recognized by the orchestration layer, an attacker constructs text specifying a target tool and attacker-chosen arguments, then instructs the LLM to repeat it verbatim. Although the LLM merely reproduces the supplied text, the orchestration layer interprets the resulting output as a tool call and dispatches it for execution. A seemingly benign text-repetition request thus gives

Md Nazmul Islam Ananto, Pierre Prevost-Avenel, Colin Smith, Kyungtae Kim, Taegyu Kim, and Arslan Khan

the attacker direct control over the tool invocation and its arguments. 1^{1} Conformity to a tool-call schema therefore does not establish the trustworthiness of the resulting request. Due to lack of any authentication, LLM-generated tool arguments must remain untrusted at execution time. Rather than inducing unsafe model outputs, we evaluate whether tool implementations safely handle potentially malicious inputs.

Additionally, the metadata description provided by a tool and the actual implementation often does not align. Either a flashier promise is provided to the LLM so that this tool gets chosen or the tool hides malicious intent behind a benign description. In both cases, checking code implementation to establish both semantic integrity and trust in such cases of description-code inconsistency [40][40] is becoming more and more important.

Under this threat model, we seek to uncover vulnerabilities in tool implementations that can be triggered by adversarial arguments. Existing techniques, however, are poorly suited to this task at scale. Current analyses of LLM tools primarily target predefined weakness classes, specific taint flows, or particular agent–tool attacks [1,16,17,23,24,34,43][1, 16, 17, 23, 24, 34, 43].

Fuzzing provides a natural starting point for exploring a broader range of adversarial inputs. However, conventional fuzzing oracles, such as crashes, memory-safety violations, and assertion failures, do not capture many tool vulnerabilities. A file tool may access a resource outside its intended workspace, or a network tool may contact a prohibited destination, while otherwise completing successfully. Detecting these violations requires understanding what an argument represents and the security constraints governing its use.

Our key insight is that the metadata that guides LLMs in using tools can also guide fuzzers in testing them. To support model-driven invocation, tools expose descriptions of their functionality, argument semantics, and intended usage. These descriptions provide semantic context beyond input schemas: two arguments may both have type string, yet one represents an SQL query and another a URL, requiring different adversarial inputs and security checks. We repurpose this metadata as a source of candidate security specifications, using it to guide both adversarial input generation and the construction of oracles that detect violations of the corresponding security constraints.

We realize our insights by designing ToFu, a tool-aware fuzzing framework for automatically discovering semantic security vulnerabilities in LLM tools. To achieve this, ToFu introduces semantics-aware sanitizers (§6.2), a reusable corpus that associates semantic input classes (path/URL/SQL etc.) with CWE-guided security properties, adversarial inputs, and the runtime as well as outcome observations needed to identify such violations. Given a registered tool, ToFu maps its arguments to applicable sanitizers using the semantics & purpose documented in the tool metadata. ToFu then automatically generates schema-valid fuzzing harnesses and semantic oracles. The use of an LLM, in ToFu, is confined within - assistance with interpreting natural-language metadata to map the sanitizers and generate initial fuzzing seeds only. The LLM is not used as the security oracle or judge. When implementation-level visibility is available while fuzzing, ToFu uses runtime introspection to observe security-sensitive effects and determine whether they violate the selected introspection-sanitizer. For opaque tools, it uses input-sanitizers and outcome-oracle checking to identify inconsistencies between the advertised contract and the actual implementation. Thus, rather than asking only whether an execution crashes, ToFu determines whether a tool behaves securely according to the semantics of its own interface. Our findings show that securing model behavior and orchestration alone is insufficient: the software ultimately executing LLM-generated actions frequently fails to enforce the security properties its interface advertises. Our contributions are as follows:

1^{1}We reproduced this behavior across six evaluated orchestration layers: LangGraph [21], MAF [29], ADK 2.0 [14], AutoGen [28], Strands [3], and CrewAI [9].

  • We establish description-code inconsistency as a form of semantic contract violation between an LLM and a tool from a security perspective, causing semantic security bugs. We build and incorporate 74 semantics-aware sanitizers to automatically check and report them.

  • We design ToFu, which derives tool-specific security properties from existing metadata, generates schema-valid fuzzing harnesses, and detects violations using runtime introspection and black-box differential checking.

  • We evaluate ToFu across 273 open-source MCP servers containing 3405 tools using semantics-aware sanitizers. ToFu discovered 253 verified bugs across 343 tools in 118 repositories, spanning arbitrary path traversal, log injection, exfiltration, command bypass and other security failures that a crash-based fuzzing analyzer cannot locate. Demonstrating that real-world LLM tools frequently fail to enforce the semantic contracts exposed by their interfaces.

References (23)