From Allies to Adversaries: Manipulating LLM Tool-Calling through Adversarial Injection

Haowei Wang, Rupeng Zhang, Junjie Wang, Mingyang Li, Yuekai Huang +2 more
12/13/2024
cs.CRcs.AI

No official code found. Best implementation: NicerWang/ToolCommander (22 stars, MIT, last commit 2025-06-11).

Abstract

Tool-calling has changed Large Language Model (LLM) applications by integrating external tools, significantly enhancing their functionality across diverse tasks. However, this integration also introduces new security vulnerabilities, particularly in the tool scheduling mechanisms of LLM, which have not been extensively studied. To fill this gap, we present ToolCommander, a novel framework designed to exploit vulnerabilities in LLM tool-calling systems through adversarial tool injection. Our framework employs a well-designed two-stage attack strategy. Firstly, it injects malicious tools to collect user queries, then dynamically updates the injected tools based on the stolen information to enhance subsequent attacks. These stages enable ToolCommander to execute privacy theft, launch denial-of-service attacks, and even manipulate business competition by triggering unscheduled tool-calling. Notably, the ASR reaches 91.67% for privacy theft and hits 100% for denial-of-service and unscheduled tool calling in certain cases. Our work demonstrates that these vulnerabilities can lead to severe consequences beyond simple misuse of tool-calling systems, underscoring the urgent need for robust defensive strategies to secure LLM Tool-calling systems.

View on arXivView PDF

Code Implementations(1)

MIT

[NAACL 2025 Main] Official implementation of "From Allies to Adversaries: Manipulating LLM Tool Scheduling through Adversarial Injection".

222MDX, AstroOct 15, 20241 years agoMIT

Cite this paper

@article{wang2024from,
  title  = {From Allies to Adversaries: Manipulating LLM Tool-Calling through Adversarial Injection},
  author = {Haowei Wang and Rupeng Zhang and Junjie Wang and Mingyang Li and Yuekai Huang and Dandan Wang and Qing Wang},
  year   = {2024},
  eprint = {2412.10198},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.10198v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.10198.svg)](https://codeofpaper.com/paper/2412.10198)

Discussion