A Lightweight Defense Architecture Against Indirect Prompt Injection in Tool-Calling AI Agents
The rapid integration of Large Language Models (LLMs) into autonomous agent workflows has introduced significant security challenges, most notably Indirect Prompt Injection (IPI). As agents increasingly rely on external tools and protocols such as the Model Context Protocol (MCP) to fetch data from APIs, web searches, and databases, untrusted content can subvert the agent’s core instructions, leading to unauthorized actions. While foundation-model evaluators offer a potential defense, their deployment is often hindered by high inference latency (400–1200 ms) and substantial operational costs. This paper proposes a lightweight multi-stage guardrail architecture, "LightGuard-Agent," designed to secure the tool-calling loop without compromising system performance. Our approach utilizes a tiered defense pipeline, ranging from deterministic syntactic sanitization to high-speed semantic intent classification and an execution policy action firewall. Empirical evaluation across 50 adversarial and benign scenarios demonstrates that LightGuard-Agent reduces the Attack Success Rate (ASR) from 100.0% to 0.0% while introducing zero false positives and maintaining an average processing latency of just 0.059 ms.
Authors
- Tarek gamal khallaf mohamed
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-13
- DOI
- https://doi.org/10.5281/zenodo.22731104
- Primary Topic
- Adversarial Robustness in Machine Learning
- Type
- article
- Field-Weighted Citation Impact
- 0.00