‘Repeat-After-Me’ Trick Hijacks AI Agent Tools

CSO Online · Medium sophistication
Last updated October 15, 2026

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
Try Mirage

Mirage safely runs attacks like this one against your own team, so you find out what happens before a real adversary does.

Get a demo

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.

Categories

Similar attacks

Brevo Hack Injects Fake Cloudflare “Verify” Prompts

Brevo Hack Injects Fake Cloudflare “Verify” Prompts

Attackers compromised Brevo’s Cloudflare setup using a long-lived API key found in source code, then altered website content at the CDN edge. Visitors were shown fake Cloudflare verification prompts to run Windows commands, and logged-in WordPress admins were targeted with a hidden backdoor plugin…

September 22, 2026
Hidden ChatGPT Channel Stole Gmail Data

Hidden ChatGPT Channel Stole Gmail Data

Check Point Research described a covert cross-account channel in OpenAI’s internal JFrog Artifactory that could let an attacker sneak hidden instructions into another user’s ChatGPT session. In their demonstration, the victim saw normal chatbot output while the model quietly pulled data (like Gmail…

September 8, 2026
Hidden ChatGPT Tasks Leak Data Across Accounts

Hidden ChatGPT Tasks Leak Data Across Accounts

Check Point researchers demonstrated a real proof-of-concept where a victim’s ChatGPT session could be tricked into running hidden, attacker-controlled tasks in parallel with the user’s normal request. In the demo, the attacker used a covert cross-account channel to make ChatGPT access the victim’s…

September 8, 2026
RovoBlast Link Seeds AI to Leak Internal Data

RovoBlast Link Seeds AI to Leak Internal Data

Researchers disclosed a one-click flaw in Atlassian’s Rovo AI assistant where a specially crafted link could pre-fill attacker instructions into a user’s active Rovo chat. After a user clicks once, Rovo’s autonomous agent features could pull sensitive data from connected systems (like Confluence,…

August 8, 2026
Fake Free COD Points Scam Steals Logins and 2FA

Fake Free COD Points Scam Steals Logins and 2FA

A real phishing campaign targeted Call of Duty Mobile players by promising free in-game currency. Victims were tricked into entering their email and password, then providing a 2FA code on a follow-up page, enabling attackers to take over accounts.

August 2, 2026
Phished npm Maintainer Led to Debug/Chalk Hijack

Phished npm Maintainer Led to Debug/Chalk Hijack

Amazon says North Korea-linked actors compromised widely used npm packages (including debug and chalk) by tricking a trusted maintainer into signing in through a lookalike npm domain. After gaining that trusted access, the attackers published malicious updates that altered crypto wallet…

July 30, 2026