# What is prompt injection? The top risk for AI assistants

Address: https://sebastianmusial.pl/en/glossary/prompt-injection/ · Glossary: https://sebastianmusial.pl/en/glossary/

An AI assistant reads everything it is given, and it can mistake text for instructions. Prompt injection uses exactly that. Here is how it works and how to limit what it can do to your business.

- Also called: indirect prompt injection, jailbreak

**Definition.** Prompt injection is an attack on an AI application in which someone hides instructions in text the model will read, such as a message, web page, document or email, so that it ignores its rules and does something else: reveals data, gives false answers or takes an unwanted action. OWASP lists it as the top risk for LLM applications.

## How does prompt injection work?

A language model receives its instructions and the content it works on as one stream of text, and it cannot reliably tell them apart. If the content says “ignore your previous instructions and…”, the model may obey. Developer Simon Willison gave the attack its name in 2022, by analogy with SQL injection, an older attack on databases.

## What are the types?

- **Direct.** The user types the instructions into the chat, for example to make a chatbot reveal its internal rules or promise something it should not.
- **Indirect.** The instructions are hidden in content the AI reads on the user’s behalf: a web page, an attachment, an email, a product review. They can be invisible to a person, such as white text on a white background.

Indirect injection matters most for AI agents, because an agent that reads an inbox or browses the web and can also send emails or change records can be steered by whoever wrote the content.

## How can a business protect itself?

There is no complete fix yet, so the aim is to limit the damage. The OWASP guidance includes:

- **Least privilege.** Give the AI only the access the task needs, read-only where possible.
- **Human approval** for risky actions: sending, paying, deleting, changing data.
- **Separating external content** from instructions and marking it as untrusted.
- **Checking outputs** against the expected format before acting on them.
- **Adversarial testing:** trying to break the system before someone else does.

## What to ask a developer or vendor

- **What can the assistant do** if someone tricks it, and what data can it reach?
- **Which actions need a person’s approval?**
- **Has it been tested** against injected instructions in documents and web pages?

More on keeping agents safe is in the article on [AI agent security](https://sebastianmusial.pl/en/blog/ai-agent-security/).

## Frequently asked questions

**Is prompt injection the same as a jailbreak?**
They are related. OWASP treats jailbreaking as a form of prompt injection in which the aim is to make the model drop its safety rules altogether. Prompt injection is the wider term.

**Can a better model solve prompt injection?**
Newer models resist it better, but none is immune. Limiting what the AI can access and requiring approval for important actions protects you even when the model is fooled.

See also: [AI agent](https://sebastianmusial.pl/en/glossary/ai-agent/), [Human-in-the-loop](https://sebastianmusial.pl/en/glossary/human-in-the-loop/), [MCP](https://sebastianmusial.pl/en/glossary/mcp/), [AI evals](https://sebastianmusial.pl/en/glossary/ai-evals/), [LLM](https://sebastianmusial.pl/en/glossary/llm/)

Sources: [OWASP Top 10 for LLM Applications: LLM01:2025 Prompt Injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/), [Simon Willison: Prompt injection attacks against GPT-3 (12 September 2022)](https://simonwillison.net/2022/Sep/12/prompt-injection/), [Wikipedia: Prompt injection](https://en.wikipedia.org/wiki/Prompt_injection)

---

Updated: 2026-12-02. Sebastian Musiał, kontakt@sebastianmusial.pl (I reply within 24 hours). Quote after a call, no price list on the site.
All pages: https://sebastianmusial.pl/llms.txt · The whole English text in one file: https://sebastianmusial.pl/en/llms-full.txt
