Skip to content
Finic
AI and agents

What is prompt injection?

Prompt injection is an attack in which text given to an AI model contains instructions that override what its developer or user intended, so the model leaks data or takes unwanted actions.

Also called: Indirect prompt injection, Jailbreak

How it works

A large language model reads its instructions and its data in the same stream of text. It cannot reliably tell the two apart. An attacker who can put text in front of the model can write something that looks like an instruction, and the model may follow it.

In direct prompt injection, the attacker types the text into the chat. In indirect prompt injection, the text hides in content the model reads later: a web page, an email, a PDF, a product review or a tool response.

Why it matters for agents

The risk grows when the model can act. An AI agent with access to email, files, payments or an internal API can be told by a hidden instruction to send data out, change settings or make a purchase. The agent's owner did not approve the action, but the agent had the permission to take it.

Examples

These are hypothetical cases of the attack.

  • A web page contains hidden text telling a browsing agent to ignore its task and visit a phishing link.
  • A support ticket tells an AI triage tool to mark the sender's account as verified.
  • A document uploaded for review instructs a model to say it passed all checks.

How teams defend against it

No single fix exists, so teams layer controls. They give agents the least access they need, require human approval for sensitive actions, keep untrusted content apart from system instructions, and check model output before it triggers an action.

Logging what the model read and what it did helps teams find an injection after the fact. For high-risk decisions, a model's output should be one input among several, not the final word.

← 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