Research Article

I ndirect P rompt I njection A ttacks on LLM A gents and D efense Mechanisms

Zijia Guo*
Shandong Xiehe University

* Corresponding author: [email protected]

Abstract

LLM agents are becoming deeply involved in real-world tasks through tool calling and external retrieval; however, by merely contaminating the external content read by these agents, such as web pages and emails, attackers can remotely hijack their execution logic. This threat is known as indirect prompt injection (IPI). This paper presents a systematic survey of IPI research on LLM agents from three perspectives: attacks, defenses, and evaluation. On the attack side, a three-layer taxonomy of attack entry, attacker goals, and attack outcomes is established, covering seven categories of entry paths, five categories of hijacking mechanisms, and five categories of harms. On the defense side, existing defenses are organized by their point of intervention into a five-layer system spanning the input, processing, behavior, training, and output layers, and their effectiveness and deployment costs are compared horizontally. In addition, representative evaluation benchmarks such as BIPIA and InjecAgent are reviewed, and a three-dimensional evaluation metric system covering the attack side, the defense side, and the system side is proposed. The survey shows that existing defenses significantly improve robustness against direct prompt injection, whereas the improvement against indirect prompt injection is at most 7.5 percentage points, and every single-layer defense has blind spots. Multi-layer coordinated defense-in-depth and a unified evaluation framework are therefore key directions for future research.

Keywords: LLM agents; indirect prompt injection (IPI); prompt injection defense; retrieval-augmented generation (RAG); tool calling
Published: October 27, 2026
DOI: 10.54254/2755-2721/2026.38107
Volume: ACE Vol.264
pp. 124-134
Download PDF

References

  1. Mialon, G., Dessì, R., Lomeli, M., Nalmpantis, C., Pasunuru, R., Raileanu, R., Rozière, B., Schick, T., Dwivedi-Yu, J., Celikyilmaz, A., Grave, E., LeCun, Y., & Scialom, T. (2023). Augmented language models: A survey.Transactions on Machine Learning Research. https://openreview.net/forum?id=jh7wH2AzKK
  2. Greshake, K., Abdelnabi, S., Mishra, S., Endres, C., Holz, T., & Fritz, M. (2023). Not what you've signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. InProceedings of the 16th ACM Workshop on Artificial Intelligence and Security(pp. 79–90). Association for Computing Machinery. https://doi.org/10.1145/3605764.3623985
  3. Zhan, Q., Liang, Z., Ying, Z., & Kang, D. (2024). InjecAgent: Benchmarking indirect prompt injections in tool-integrated large language model agents. InFindings of the Association for Computational Linguistics: ACL 2024(pp. 10471–10506). Association for Computational Linguistics. https://doi.org/10.18653/v1/2024.findings-acl.624
  4. Deng, G., Liu, Y., Wang, K., Li, Y., Zhang, T., & Liu, Y. (2024). PANDORA: Jailbreak GPTs by retrieval augmented generation poisoning. InProceedings of the Workshop on AI Systems with Confidential Computing (AISCC 2024). Internet Society. https://doi.org/10.14722/aiscc.2024.23018
  5. Wu, F., Liu, X., & Xiao, C. (2023). DeceptPrompt: Exploiting LLM-driven code generation via adversarial natural language instructions. arXiv. https://doi.org/10.48550/arXiv.2312.04730
  6. Hines, K., Lopez, G., Hall, M., Zarfati, F., Zunger, Y., & Kıcıman, E. (2024). Defending against indirect prompt injection attacks with spotlighting. arXiv. https://doi.org/10.48550/arXiv.2403.14720
  7. Chen, Y., Li, H., Sui, Y., He, Y., Liu, Y., Song, Y., & Hooi, B. (2025). Can indirect prompt injection attacks be detected and removed? InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)(pp. 18189–18206). Association for Computational Linguistics. https://doi.org/10.18653/v1/2025.acl-long.890
  8. Yi, J., Xie, Y., Zhu, B., Kiciman, E., Sun, G., Xie, X., & Wu, F. (2025). Benchmarking and defending against indirect prompt injection attacks on large language models. InProceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.1(pp. 1809–1820). Association for Computing Machinery. https://doi.org/10.1145/3690624.3709179
  9. Jia, F., Wu, T., Qin, X., & Squicciarini, A. (2025). The task shield: Enforcing task alignment to defend against indirect prompt injection in LLM agents. InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)(pp. 29680–29697). Association for Computational Linguistics. https://doi.org/10.18653/v1/2025.acl-long.1435
  10. Wallace, E., Xiao, K., Leike, R., Weng, L., Heidecke, J., & Beutel, A. (2024). The instruction hierarchy: Training LLMs to prioritize privileged instructions. arXiv. https://doi.org/10.48550/arXiv.2404.13208
  11. Manakul, P., Liusie, A., & Gales, M. (2023). SelfCheckGPT: Zero-resource black-box hallucination detection for generative large language models. InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing(pp. 9004–9017). Association for Computational Linguistics. https://doi.org/10.18653/v1/2023.emnlp-main.557
  12. Debenedetti, E., Zhang, J., Balunović, M., Beurer-Kellner, L., Fischer, M., & Tramèr, F. (2024). AgentDojo: A dynamic environment to evaluate prompt injection attacks and defenses for LLM agents. InAdvances in Neural Information Processing Systems(Vol. 37, pp. 82895–82920). Curran Associates, Inc.