Cinderpoint › Books › SAFEMACHINE Scams by AI › Indirect Prompt Injection
Mechanism 10 of 17  ·  SAFEMACHINE Scams by AI

Indirect Prompt Injection

From SAFEMACHINE Scams by AI: 17 Ways People Use AI to Fake Trust  ·  Waydell D. Carvalho

Described in SAFEMACHINE Scams by AI by Waydell D. Carvalho.

Definition
Hidden orders sit inside an email, page or file. An AI assistant that reads it obeys them as if its owner gave them.
How to Check
  • Trigger: An agent acts oddly right after it reads a file or page from outside.
  • Stress test: Open the raw file in a plain text viewer and search for hidden commands.
  • Failsafe: Fence the agent; no irreversible action without a person's approval.

Rule: Treat anything an AI agent reads with the suspicion due a command typed by a stranger.

An AI assistant cannot tell a document it was asked to read from orders hidden inside that document. To the assistant, both are just text. Indirect Prompt Injection hides orders in an email, a web page or a file, so the assistant obeys a stranger. The assistant holds its owner's access, so the stranger borrows it.

From a lab test to real cases

In February 2023 a team led by Kai Greshake posted a paper on a new way to attack apps built on language models. They hid instructions in web pages and let assistants fetch them. In one test on Bing's chat, the hidden text told the assistant to steer the user toward a link and ask for the user's real name. The assistant did so, in friendly small talk. In another test, an email told a test assistant to send copies of itself to every contact. The team called it a worm written in English. They ran live tests only on systems they controlled.

Real cases have followed. Version 1.84.0 of the Amazon Q Developer extension, released July 17, 2025, carried instructions telling the agent to wipe a system and delete cloud resources. AWS says a threat actor added the code through an overly broad GitHub token, and that a syntax error stopped it from running. In December 2025, Unit 42 reported a scam ad page that held 24 hidden attempts to fool an AI ad reviewer. Unit 42 knows of no confirmed case where such an attack worked on a live ad checker.

Why data used to be safe

In older software, data and code stayed apart. A spreadsheet program treated a file as values to show, never as commands. That wall is one of the oldest in computing, and breaking it took a real flaw and real skill. A language model takes orders in plain language. It cannot tell, by structure, whether an order came from its owner or from a document. The attacker needs only a sentence hidden in a file.

The products did filter what users typed into the chat box. Those filters did not fire when the order arrived through retrieved data. The user never saw the hidden text and was not watching when the assistant acted. Hiding text is also common in small ways. A study of nearly 200,000 resumes found that about 1 percent held hidden prompts aimed at the AI that screens applicants.

The check is to open the file in a plain text viewer and search for command words, such as "ignore previous instructions." A clean search does not clear the file, because orders can be reworded or encoded. So the agent needs a fence. If untrusted content can reach it, it gets no power to send, move data or call outside services on its own. A person approves each action. The full case and the others are in Scams by AI.

This mechanism is examined in full in SAFEMACHINE Scams by AI: 17 Ways People Use AI to Fake Trust by Waydell D. Carvalho. All 17 Mechanisms are developed and connected in the complete book.
About the book
Cite this concept
Carvalho, W. D. (2026). Indirect Prompt Injection. Cinderpoint. https://cinderpoint.com/library/scams-by-ai/indirect-prompt-injection/