← Back to Library

QueryIPI: Query-agnostic Indirect Prompt Injection on Coding Agents

Authors: Yuchong Xie, Zesen Liu, Mingyu Luo, Zhixiang Zhang, Kaikai Zhang, and Yuanyuan Yuan, Zongjie Li, Ping Chen, Shuai Wang, Dongdong She

Published: 2025-10-27

arXiv ID: 2510.23675v2

Added to Library: 2026-01-14 03:01 UTC

Red Teaming

📄 Abstract

Modern coding agents integrated into IDEs orchestrate powerful tools and high-privilege system access, creating a high-stakes attack surface. Prior work on Indirect Prompt Injection (IPI) is mainly query-specific, requiring particular user queries as triggers and leading to poor generalizability. We propose query-agnostic IPI, a new attack paradigm that reliably executes malicious payloads under arbitrary user queries. Our key insight is that malicious payloads should leverage the invariant prompt context (i.e., system prompt and tool descriptions) rather than variant user queries. We present QueryIPI, an automated framework that uses tool descriptions as optimizable payloads and refines them via iterative, prompt-based blackbox optimization. QueryIPI leverages system invariants for initial seed generation aligned with agent conventions, and iterative reflection to resolve instruction-following failures and safety refusals. Experiments on five simulated agents show that QueryIPI achieves up to 87% success rate, outperforming the best baseline (50%). Crucially, generated malicious descriptions transfer to real-world coding agents, highlighting a practical security risk.

🔍 Key Points

  • Introduction of QueryIPI, an automated framework for query-agnostic indirect prompt injection attacks on coding agents, significantly enhancing the capabilities of such attacks.
  • The methodology leverages internal prompt characteristics as system invariants to craft malicious payloads that reliably bypass agent defenses irrespective of user queries.
  • Experimental results show QueryIPI achieving up to 87% success rates across simulated coding agents, outperforming baseline methods which achieved maximum success rates of 50%.
  • QueryIPI demonstrates practical transferability to real-world coding agents, highlighting serious security implications for widely used IDE-assisted coding systems.
  • The research identifies significant vulnerabilities in high-privilege coding agents and presents a clear strategy for enhancing LLM security against such advanced indirect prompt injection attacks.

💡 Why This Paper Matters

This paper presents critical advancements in the field of AI security by introducing a new attack paradigm with QueryIPI, which poses a substantial threat to modern coding agents. By systematically exploiting internal prompts, the study not only establishes the vulnerability of coding agents but also sets a precedent for future defensive measures. Recognizing the potential for these attacks to impact real-world applications underscores the urgency for enhanced security protocols in AI development.

🎯 Why It's Interesting for AI Security Researchers

For AI security researchers, this paper is significant as it uncovers vulnerabilities in state-of-the-art coding agents that are widely adopted in development environments. The methodology detailed in the study could serve as a basis for developing more robust defense mechanisms against indirect prompt injection attacks, making it crucial for the advancement of safe and secure AI systems.

📚 Read the Full Paper