Microsoft Research has identified a security flaw in AI agents that can be exploited through recursive prompt injection. Attackers can embed hidden commands in tool outputs, forcing autonomous agents into infinite, resource-intensive loops that bypass system prompts and drain API budgets.
The vulnerability occurs when malicious instructions are nested within the agent's internal thought-chain, leading to repeated cycles that evade existing safety filters. According to Microsoft, current security measures are focused on the wrong part of the stack, leaving agents exposed to recursive attacks.
"The flaw highlights the need for a fundamental rethinking of AI agent security, particularly in how tools and outputs interact with the agent's core reasoning," the researchers noted.
This finding underscores the growing challenges in securing autonomous AI systems against sophisticated prompt injection techniques.