AutoHijacker: Automatic Indirect Prompt Injection Against Black-box LLM Agents

Xiaogeng Liu, Somesh Jha, Patrick McDaniel, Bo Li, Chaowei XiaoOpenReview 2025 · Submission to ICLR 2025 · Rejected

Abstract

Although large Language Models (LLMs) and LLM agents have been widely adopted, they are vulnerable to indirect prompt injection attacks, where malicious external data is injected to manipulate model behaviors. Existing evaluations of LLM robustness against such attacks are limited by handcrafted methods and reliance on white-box or gray-box access—conditions unrealistic in practical deployments. To bridge this gap, we propose AutoHijacker, an automatic indirect black-box prompt injection attack. Built on the concept of LLM-as-optimizers, AutoHijacker introduces a batch-based optimization framework to handle sparse feedback and also leverages a trainable memory to enable effective generation of indirect prompt injections without continuous querying. Evaluations on two public benchmarks, AgentDojo and Open-Prompt-Injection, show that AutoHijacker outperforms 11 baseline attacks and achieves state-of-the-art performance without requiring external knowledge like user instructions or model configurations, and also demonstrates higher average attack success rates against 8 various defenses. Additionally, AutoHijacker successfully attacks a commercial LLM agent platform, achieving a 71.9% attack success rate in both document interaction and website browsing tasks.
BibTeX
@misc{liu2025autohijacker,
  author = {Xiaogeng Liu and Somesh Jha and Patrick McDaniel and Bo Li and Chaowei Xiao},
  title = {{AutoHijacker: Automatic Indirect Prompt Injection Against Black-box LLM Agents}},
  year = {2025},
  url = {https://openreview.net/forum?id=2VmB01D9Ef},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2025},
}

Loading related content...

Figure