# Prompt injection

> Canonical: https://skillalmanac.com/glossary/prompt-injection | Last verified: 2026-11-24 | Index status: index-eligible

Prompt injection attempts to redirect an AI application through adversarial instructions in input or content it processes. An attempt may succeed or fail; indirect injection arrives through material such as retrieved pages, documents or tool results.

Also called: prompt injection attack, prompt injections, LLM prompt injection.

## In plain language

In an indirect prompt-injection attempt, material an assistant was meant to read tries to give it new orders. For example, an email being summarized might contain instructions to disclose unrelated private messages. The presence of those instructions does not prove that the application followed them. Risk depends on the available data, tools and controls, so limit access and check consequential actions.

## Technical definition

Prompt injection crosses an instruction/data trust boundary in an LLM-integrated application. Direct attacks use adversarial user input; indirect attacks place instructions in externally supplied content. Message roles and content labels can express intended priority, but they do not guarantee compliance. Application-level authorization, limited tool privileges, output checks and appropriate human review can reduce exposure or impact. Distinguish an attack attempt from observed execution or disclosure; no prompt wording alone establishes a universal defense.

## How it shows up when you use agents

Untrusted instructions can appear in a fetched page, repository file, issue comment, installed skill or result from an [MCP server](/glossary/mcp-server). These are possible attack surfaces, not evidence that any particular file or server is malicious.

Assess what a successful redirection could access or change. Read-only operations can still expose sensitive data; write and execution tools introduce other consequences. Give tools only the access needed for the task, validate operations in application code and review consequential actions under an appropriate policy. Model instructions complement those controls rather than replacing them.

## Common confusions

- **Attempt versus success.** Adversarial instructions can be present even when a system rejects them.
- **Direct versus indirect.** The distinction concerns the attacker-controlled surface, not whether an instruction is visually hidden.
- **Injection versus an authorized request.** A legitimate user changing a permitted task is not automatically an attack.
- **Protocol versus trust.** An MCP connection describes communication; it does not establish that server content is authoritative.
- **Prompt wording versus enforcement.** Check permissions and validation in the application as well as the prompt. See the [third-party skill review guide](/learn/check-a-claude-skill-from-github-before-installing).

## Worked examples in this catalogue

### [Check a Claude Skill From GitHub Before Installing It](https://skillalmanac.com/learn/check-a-claude-skill-from-github-before-installing)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A step-by-step review of a third-party skill before it runs, including searching for injected shell commands, pre-approved tools and hooks, and reading scripts before you install.

Why it exercises the concept: A skill is text and code your agent will trust. The guide treats it as untrusted until read, which is the habit prompt injection calls for.

### [skill-safety-audit](https://skillalmanac.com/skills/skill-almanac/skill-safety-audit)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A JSON risk table with evidence lines for a third-party skill folder, produced before you install it.

Why it exercises the concept: It scans the folder and cites evidence lines, so you can review a third-party skill's risky content before an agent trusts it.

### [prompt-writing](https://skillalmanac.com/skills/skill-almanac/prompt-writing)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Prompts written and linted with a fixed structure, injection rules and a numeric test plan.

Why it exercises the concept: It shows the prompt-side defence, lints prompts against injection rules, which is where the separation between instructions and untrusted input is checked, and pairs it with a test plan, since wording alone does not settle the risk.

## Related terms

- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Tool calling (function calling)](https://skillalmanac.com/glossary/tool-calling.md)
- [Jailbreak](https://skillalmanac.com/glossary/jailbreak.md)
- [Guardrails](https://skillalmanac.com/glossary/guardrails.md)
- [Model Context Protocol (MCP)](https://skillalmanac.com/glossary/model-context-protocol.md)
- [AI hallucination](https://skillalmanac.com/glossary/hallucination.md)
- [Confused deputy (agents)](https://skillalmanac.com/glossary/confused-deputy.md)
- [Indirect prompt injection](https://skillalmanac.com/glossary/indirect-prompt-injection.md)

## Sources

- [LLM01:2025 Prompt Injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/), OWASP Gen AI Security Project (accessed 2026-11-23)
- [Prompt injection is not SQL injection (it may be worse)](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection), UK National Cyber Security Centre (accessed 2026-11-23)
- [Mitigate jailbreaks and prompt injections](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks), Anthropic (accessed 2026-11-23)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
