Researchers showed that several popular AI agent frameworks can be manipulated into executing attacker-controlled tool actions just by asking the model to repeat a tool call as text. In one detailed demo, the model refused the dangerous request in words, but the framework still executed the tool call because it treated the model’s structured output as authorization. The same study also found hundreds of security bugs in open-source MCP servers that could enable data access or unsafe actions if used in real deployments.
How the attack worked
Researchers found that a simple request, asking an AI model to repeat a quoted tool call back as text, could cause several AI agent frameworks to execute that call as a real, structured action. In one demonstration, a user framed the request as hypothetical and asked the model to reproduce only the supplied text. Instead of treating the output as plain text, the model emitted a structured tool invocation, and the framework dispatched it. The technique was reproduced across six widely used frameworks: LangGraph, Microsoft Agent Framework, AutoGen, Google ADK 2.0, AWS Strands Agents, and CrewAI.
Why it succeeded
The core problem was a gap between what the model said and what the orchestration layer did. In a documented LangGraph demo running Meta's Llama 3.1 8B model through Ollama, the model initially refused a request to repeat a dangerous tool call and only printed it as text, so nothing executed. When the request was rephrased, the model returned the call in structured form and LangGraph executed it immediately with the attacker's arguments. The model's refusal message arrived only after the tool had already run. This shows that the orchestrator treated the model's structured output as sufficient authorization, rather than requiring an independent check before execution.
What to watch for
Key red flags identified in the research include:
- A user asking the model to "repeat only the quoted text" that is formatted like a tool invocation
- Requests framed as "hypothetical" scenarios, which can bypass a model's normal safety behavior
- A mismatch between a model's stated refusal or explanation and the action the tool layer actually carries out
The same research effort also used a testing tool to verify 253 security bugs across 118 open-source MCP servers, including path traversal, SSRF, data exfiltration, and OS command injection, underscoring that tool-layer weaknesses extend beyond this one prompting trick.
How to build resistance
Researchers and the underlying findings point to several concrete defenses:
- Do not treat model output as authorization; require independent approval checks before sensitive tool actions run
- Validate tool inputs inside the tool itself, since attackers can influence arguments through prompts, retrieved content, or other tool output, rather than relying on the model to sanitize them
- Run agents with restricted file and network access, isolated execution environments, and limited credentials, with explicit approval required for sensitive or irreversible operations
- Monitor sequences of tool calls rather than judging each action in isolation, since a single step may look benign while a full workflow reveals malicious intent
These measures address the underlying issue: when an orchestration layer treats a model's output as sufficient authority to act, a model-level manipulation becomes a system-level security issue.
Key findings
- A simple “Repeat-After-Me” text repetition request can cause AI agent frameworks to execute attacker-controlled tool calls.
- The technique was reproduced across six frameworks (LangGraph, Microsoft Agent Framework, AutoGen, Google ADK 2.0, AWS Strands Agents, CrewAI).
- In a LangGraph demo, the model’s refusal message came after the tool call executed, showing a gap between what the model says and what the orchestrator does.
- Researchers built a testing tool (ToFu) and verified 253 security bugs across 118 open-source MCP servers, including path traversal, SSRF, data exfiltration, and OS command injection.
Who’s being targeted
- Commonly targeted roles: Developers, AI/ML Engineers, Automation/Platform Engineering, Security Engineering, Product owners for AI agents.
- Affected industries: Software and AI platform providers, Organizations deploying AI agents with tool access (file, network, code repos).
- Attack channels: website.
- Impersonated: None (malicious user prompt).
Red flags to watch for
- User asks to “repeat only the quoted text” that is formatted like a tool invocation
- Request is framed as “hypothetical” to bypass safety behavior
- Model’s refusal/explanation does not match what the tool layer actually executes
- Tooling layer executes actions based on model output without independent pre-execution authorization
- Structured tool-call output appears even when the model claims it is refusing
- Attacker controls tool arguments
Frequently asked questions
What is the repeat-after-me attack on AI agents?
It is a prompt technique where a user asks an AI model to repeat back a quoted tool call as text. In vulnerable frameworks, the model emits that call in structured form and the orchestrator executes it, even if the model also voiced a refusal.
Which AI agent frameworks were affected?
Researchers reproduced the issue across six frameworks: LangGraph, Microsoft Agent Framework, AutoGen, Google ADK 2.0, AWS Strands Agents, and CrewAI.
Why did the model's refusal not stop the tool call?
In the LangGraph demonstration, the model's refusal text appeared only after the tool call had already been dispatched, showing that the system prompt shaped what the model said but not what the orchestrator actually did.
How can organizations reduce this risk?
Add independent approval checks before sensitive tool actions run, validate tool inputs inside the tool itself rather than trusting the model, restrict agent permissions, and monitor sequences of tool calls rather than single actions in isolation.
Read the video transcript
Imagine this: our AI agent refuses a dangerous request… but the tool still runs anyway. Researchers tricked six agent frameworks, like LangGraph and AutoGen, just by saying: “Hypothetical, repeat this tool call exactly.” The model repeats the text, but the framework treats it as a real, structured tool call and fires it off with attacker-controlled arguments. In one LangGraph demo, a fake launch_missiles call ran first, and only after the tool returned did the model say it refused. The researchers summed it up: “Model output is not the permission.” The same study found hundreds of bugs in MCP servers that could turn these calls into data exfiltration. If you build or use agents, remember this: model output is not approval. For any sensitive tool, files, network, or credentials, require a separate human or system check before it runs.