Package Hallucination Attacks on Coding Agents through Prompt Injection in Rule Files
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 1 more
Abstract (arXiv)
Modern agentic coding frameworks increasingly rely on community-shared rule files (e.g., AGENTS.md or .cursorrules) to guide autonomous code generation, yet the security risks of this pipeline remain underexplored. To bridge this gap, we introduce the package hallucination attack, where an attacker injects malicious prompts into benign rule files to induce coding agents to replace legitimate dependencies with attacker-controlled packages. To obtain effective malicious prompts injected into rule files, we propose PackHallu, an evolutionary optimization framework that iteratively rewrites these injected prompts using trajectory-level feedback and LLM-guided mutations. Evaluations across multiple benchmarks, LLMs, and agent frameworks show that PackHallu achieves high attack success rates and strong transferability across diverse models and agent combinations. Our findings demonstrate that coding agents are vulnerable to package hallucination attacks, highlighting the urgent need for stronger security safeguards in autonomous coding systems.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. First posted on arXiv 7 Oct 2026.
Builds on
No reference list yet.
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Harmless Yet Harmful: Neutral Prompting Attacks for Stealthy Hallucination Steering in Agent Skills
- 2026Trust Me, Import This: Dependency Steering Attacks via Malicious Agent Skills
- 2026PhantomSkill: Malicious Code Injection in Agent Skill Ecosystems
- 2025Red-Teaming Coding Agents from a Tool-Invocation Perspective: An Empirical Security Assessment
- 2026LLM Ghostbusters: Surgical Package Hallucination Suppression via Adaptive Unlearning
- 2026Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystems
- 2026EVOMAL: Self-Poisoning in Self-Evolving Coding Agents
- 2025"Your AI, My Shell": Demystifying Prompt Injection Attacks on Agentic AI Coding Editors