Misusing Tools in Large Language Models With Visual Adversarial Examples
Xiaohan Fu, Zihan Wang, Shuheng Li, Rajesh K. Gupta, Niloofar Mireshghallah, Taylor Berg-Kirkpatrick, Earlence Fernandes
TL;DR
The paper reveals a security risk in multimodal LLMs that integrate tools by showing that carefully crafted visual adversarial examples can coerce the model into invoking attacker-chosen tools, potentially harming user resources. It introduces a gradient-based, white-box adversarial image optimization framework that balances stealth and attack success, and generalizes across unseen prompts using prompt–response data from GPT-4 and Alpaca. Empirical results on an open-source multimodal LLM (LLaMA Adapter) show high attack success and image similarity while preserving conversational quality, with measurable declines in user-perceived utility and transfer to out-domain prompts. The work highlights practical defense implications and calls for guarded tool authorization, while acknowledging limitations and proposing future work on black-box transferability and broader model evaluation.
Abstract
Large Language Models (LLMs) are being enhanced with the ability to use tools and to process multiple modalities. These new capabilities bring new benefits and also new security risks. In this work, we show that an attacker can use visual adversarial examples to cause attacker-desired tool usage. For example, the attacker could cause a victim LLM to delete calendar events, leak private conversations and book hotels. Different from prior work, our attacks can affect the confidentiality and integrity of user resources connected to the LLM while being stealthy and generalizable to multiple input prompts. We construct these attacks using gradient-based adversarial training and characterize performance along multiple dimensions. We find that our adversarial images can manipulate the LLM to invoke tools following real-world syntax almost always (~98%) while maintaining high similarity to clean images (~0.9 SSIM). Furthermore, using human scoring and automated metrics, we find that the attacks do not noticeably affect the conversation (and its semantics) between the user and the LLM.
