# Prompt injection

Prompt injection is text in an agent's input that the model follows as an instruction, in
place of the instructions its developer gave it. In a direct injection, the person typing
writes the instruction. In an indirect injection, it arrives inside content the agent reads
while it works: a web page, an email, a file, a retrieved document, or a tool result. A
jailbreak is a form of prompt injection whose goal is to make the model drop its safety rules.

It exists because a model has no reliable boundary between instructions and data. Everything
in the context is text, and a sentence in a fetched page can read exactly like a sentence from
the developer. Model behavior is probabilistic, and no known method prevents injection
completely.

The risk grows with what the agent can do. A chatbot that follows an injected instruction says
something wrong. An agent with tools can act on it: send an email, change a record, or call an
API. The worst case combines three capabilities, known as the lethal trifecta: access to
private data, exposure to untrusted content, and a way to communicate externally. An agent
with all three can be told by a stranger's text to send your data out. Agent benchmarks for
injection measure both whether attacks break the agent's security properties and whether it
still completes its tasks, and the OWASP Top 10 for LLM applications lists prompt injection
first.

Detection filters and guardrails catch many attacks but miss ones phrased in a way they didn't
expect, so a high catch rate still leaves a hole. The stronger defense is design: remove one
part of the trifecta, limit which tools a run can call after it reads untrusted content, and
require approval for actions that can't be undone.

## Questions answered under this concept

- [What is the lethal trifecta for AI agents?](https://tessary.ai/answers/prompt-injection/what-is-the-lethal-trifecta-for-ai-agents)

---

Source: https://tessary.ai/answers/prompt-injection
All concepts: https://tessary.ai/answers
From Tessary, agent reliability for AI agents in production: https://tessary.ai
