Agent attacks assemble harmful prompts from incomplete fragments

Divide and Inject: Can Agents Reconstruct an Indirect Prompt Injection from Fragments?

Artificial Intelligence

Summary

Advanced AI systems can be tricked into doing harmful things even if attackers don’t give a full harmful instruction all at once. Instead, attackers hide small pieces of a bad instruction scattered across different places. The authors created a method called AdaLCPI that breaks up attack instructions into parts and shows how an AI agent can put them back together. Their technique fooled AI at much higher rates than other approaches, suggesting AI safety tests should check for these kinds of hidden, combined attacks.

What this means in practice

  • For ai safety engineers: Evaluate AI agents to detect vulnerabilities when malicious instructions are split and combined from partial fragments over long contexts.
  • For security teams in software companies: Design robustness tests for AI systems handling external tool data to prevent multi-fragment prompt injection attacks.

Authors

Michael Lee, Zhipeng Wei, Yue Dong, N. Benjamin Erichson

Abstract

Agentic systems are now being widely used to orchestrate tools and reason over long contexts. However, the improving capabilities of the large language models powering these agents also create new attack surfaces for indirect prompt injection. In particular, an attacker may not need to place a complete malicious instruction in retrieved content if the agent can reconstruct the objective from incomplete fragments distributed across a long context. In this work, we introduce adaptive long-context prompt injection (AdaLCPI), which combines long-context fragmentation with adaptive search. AdaLCPI splits an attack objective into incomplete fragments, embeds them in external content retrieved through the agent's tools, and uses a reconstruction cue to prompt the agent to combine them. It then iteratively refines the fragments and cue with OpenEvolve using graded scoring and natural-language execution feedback from the target agent. Empirically, AdaLCPI achieves higher attack success than strong adaptive baselines, reaching 61.4\% macro-average ASR compared with 32.8\% for Trojan Hippo-style and 30.0\% for AgentVigil. Safety evaluations should therefore test whether agents remain robust when harmful objectives must be reconstructed from incomplete fragments.