Skip to content
Finic
AI and agents

What is indirect prompt injection?

Indirect prompt injection hides instructions in content an AI system reads, such as a web page, email or file, so the model follows the attacker instead of its user.

Also called: cross-prompt injection, XPIA

How it works

Many AI tools read outside content: a browser agent loads web pages, an email assistant reads the inbox, and a retrieval-augmented generation system pulls in documents. A model cannot reliably tell data apart from instructions, so text in that content can act like a command.

An attacker plants instructions where the AI will find them. They can be hidden in white text, HTML comments, image alt text, metadata or a long document. When the model reads the content, it may follow those instructions with the user's access and tools.

Why it matters for fraud and trust

The risk grows with what the AI can do. A model that only writes text can be tricked into a wrong summary. An agent that can send email, make payments or read private files can be tricked into sending data or money to the attacker. The real user may never see the hidden text.

Example

A hypothetical shopping agent compares prices for a user. One product page contains hidden text that tells any AI reading it to add a gift card to the cart and ship it to a new address. If the agent has checkout access and no confirmation step, it may follow the instruction.

How teams defend against it

No single fix exists. Teams give agents the least access they need, treat all outside content as untrusted, and keep a human in the loop for payments, data sharing and account changes. Output checks and guardrails catch some attacks, and logs make it possible to trace what content the agent read before an action.

← All glossary terms

Ship fraud, bot and KYB checks in minutes.

Start with $5 of free credit, or copy a prompt and let your coding agent set Finic up.

Sign up See pricing