Aligning Tool Descriptions and Implementations to Detect Prompt Injections in LLM Agents
Abstract
Tool-integrated large language model (LLM) agents enable functionalities such as accessing information, managing databases, and sending emails. Because many third-party tools come from untrusted online sources, attackers can exploit tool interactions to launch prompt injection attacks via tools, potentially causing harm through harmful code execution. In this work, we propose a defense that detects prompt injection attacks by comparing tool descriptions with summaries of their corresponding code. To evaluate our approach, we constructed a dataset of 503 tool examples, consisting of 377 prompt injected and 126 benign tools collected and adapted from open-source repositories and existing benchmarks. We evaluate our method across five LLMs and compared its performance against existing prompt injection defenses such as PromptArmor, DataSentinel, LLM-Based Detection, and Perplexity Filter. The experimental results show that our method achieves an overall detection accuracy of 93.8\%. This work highlights the potential benefits of implementing a description and implementation consistency verification as an additional security mechanism for LLM agents in a tool-integrated environment.
Create a lesson
Related papers
Prompt Injection Detection using DeBERTa-v3: A Position-Neutral Dataset for AI Security
Shared title terminologycs.CRMirza Akhi
Kernel-Layer Runtime Defense for LLM Agents Against Indirect Prompt Injection
Shared title terminologycs.CRAravinda Kashyap, Basavesh Ammanaghatta Shivakumar, Danfeng Yao et al.
AETHON: Deterministic Pre-Inference Defense for LLM Prompt Injection
Shared title terminologycs.CRLeonardo Bruscagini de Lima, Jorge Valverde-Rebaza, Alexandre de Barros Barreto et al.
Now You See It, Now You Don't: Manipulating Perception and Attention in Code Vulnerability Detection LLM Agents
Shared title terminologycs.CRShanquan Yang, Boyu Kuang, Chunyi Zhou et al.
Prompt Injection in Aviation NOTAM Assessment: Relayed Authority, Expert Adjudication and Coded Field Defences
Shared title terminologycs.CRAlex Brooker
DefenseComposer: Knowledge-Guided Defense Stacking Against Indirect Prompt Injection
Shared title terminologycs.CRJiahe Chen, Mengdi Li, Junjie Huang et al.