Research · AI security · Prompt injection · AI agents

Prompt injection for cloud teams: 6 real AI agent hijacks and the 5 fixes

An AI agent can't reliably tell data from instructions. Six real attacks shown by researchers (logs, forms, PDFs, GitHub issues, email, browser extensions) and the controls that stop all of them.

7 min read

Short answer

An AI agent can't reliably tell data from instructions, so anything it reads (a log, a form, a PDF, a GitHub issue, an email) can carry a command it then runs with your access. That is indirect prompt injection. Treat every tool result as untrusted, require human approval for risky actions, give agents short-lived least-privilege tokens, block data exfiltration paths, and audit every MCP server and extension.

If your team gives an AI agent real access (a terminal, a CRM, your email, your GitHub token), there’s one thing to understand before anything else:

An AI agent can’t reliably tell data from instructions.

To the model, it’s all text. So anything the agent reads can carry a command, and the agent may run it with your access. That’s indirect prompt injection. Here are six real cases, all shown by security researchers.

The six hijacks

Six places the command hid

1An error logJun 2026
2A website contact formSep 2026, patched
3Invisible text in a PDFAug 2026
4A GitHub issueMay 2025
5An email nobody openedJun 2025, fixed
6A browser extensionSep 2026
All six were shown by security researchers. Details and fixes are in the table below.
# Where the command hid What happened Fix
1 An error log (agentjacking, Jun 2026) A fake error sent to Sentry carried a “fix”: run this command. A coding agent asked to fix the latest issues ran it on the developer’s machine. Never let an agent run commands without approval.
2 A website contact form (SalesBleed, Sep 2026) Hidden instructions in a form became a CRM lead. Later the agent read the lead, looked up customer accounts and leaked them via an image link. Patched. Anything a stranger can type is untrusted. Limit what that agent can reach.
3 Invisible text in a PDF (Aug 2026) Tiny transparent text told an agent to collect Jira and Confluence data and send it out. Turning off web search didn’t stop it. Limit what the agent can fetch. Treat every upload as untrusted.
4 A GitHub issue (May 2025) An issue on a public repo told an agent, via the GitHub MCP server, to read private repos and publish them in a public pull request. Give agents tokens scoped to one repo.
5 An email nobody opened (EchoLeak, Jun 2025) An assistant pulled an unopened email into its answer, followed its hidden instructions and leaked data through an image link. Zero clicks. Fixed by Microsoft. No auto-loading images or links in AI answers.
6 A browser extension (BragJack, Sep 2026) A malicious extension took over AI assistants built into browsers and fed them its own prompts. Keep browsers updated. Remove extensions you don’t use.

The 5 fixes that work against all six

  1. Treat everything a tool returns as untrusted. Logs, tickets, web pages, files and emails are data, never instructions.
  2. Human approval before anything with side effects: running commands, sending data, changing records.
  3. Least privilege, short-lived. One repo, one mailbox, one project. Tokens that expire in hours, not months.
  4. Block the way out. No automatic image or link loading. An allow-list of domains the agent can reach. Most of these attacks needed an exit to leak data.
  5. Audit every MCP server and browser extension you plug in, the same way you’d review a new third-party library.

The pattern under all of this is old security advice in a new place: don’t let untrusted input trigger privileged actions. We learned it with SQL injection. We’re learning it again with agents.

Watch the 5-minute video version: 6 Ways Hackers Hijack Your AI Agent.


Sources

Try it in a lab Op Hijack A planted note in an email takes over a support bot; fix it in layers and catch it. In your browser, about 25 minutes.

Every TSG course

Enroll: Monthly or Lifetime

Both plans open every course on the platform, with every lab and every future update, the day you join.

  • 34courses
  • 420+videos
  • 3clouds included
  • All 34 courses, from Learn 101 to AI Security Engineer
  • 420+ videos across AI Security Engineer and the cloud courses, plus reading pages, quizzes and handbooks
  • Browser labs, laptop labs and cloud labs on AWS, Azure and Google Cloud
  • A certificate for each course you finish, with a public verify link
  • New courses at no extra cost, and every future update

Already a member? Sign in

Choose your plan
Need an invoice for a company?

Paid by card in US dollars. Final price: nothing is added at checkout. You pay on Razorpay's secure page; we never see your card or bank details.

  • Paid on Razorpay's secure page: Card, in US dollars
  • Refund policy