# What is prompt injection?

Prompt injection is an attack where instructions meant for an AI are hidden in content it reads, such as a web page, email, document or a tool's result, to make it do something the user didn't ask for, like leaking data or misusing a connected tool.

## Direct and indirect

- **Direct**: someone types the instructions into the chat themselves.
- **Indirect**: the instructions arrive inside content the AI reads for you. This is the one that matters most once assistants browse, read email and call tools.

## What vendors say

Anthropic's help center warns that malicious MCP servers can embed hidden instructions in what they return. OpenAI warns that an untrusted server can trick ChatGPT into misusing tools. Claude Code's docs warn that servers fetching outside content expose you to prompt injection.

## Limiting the damage

Keep approvals on for tools that write, connect fewer and trusted servers, and read what an agent wants to do before you allow it. The lesson [prompt injection](https://ai-powered.com/academy/ai-basics/prompt-injection) has five habits.

## Sources

Official documentation, checked on 19 November 2026:

- [Custom connectors using remote MCP (Claude Help Center)](https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp)
- [Add custom MCP server (OpenAI developer docs)](https://developers.openai.com/api/docs/guides/developer-mode)
- [Connect Claude Code to tools via MCP (Claude Code docs)](https://code.claude.com/docs/en/mcp)

## Related terms

- [Tool call](https://ai-powered.com/academy/glossary/tool-call): A tool call is a structured request from an AI model to run one of the functions it was given, with arguments that match the function's input schema. The app runs the function, sends the result back to the model, and the model uses it to answer or to decide its next step.
- [MCP](https://ai-powered.com/academy/glossary/mcp): MCP (Model Context Protocol) is an open standard for connecting AI applications to outside tools and data. An AI app connects to small programs called MCP servers, asks each one what it offers, and calls those tools when a task needs them.
- [AI agent](https://ai-powered.com/academy/glossary/ai-agent): An AI agent is a system in which a language model decides, step by step, which tools to use and what to do next to finish a task, checking the result of each step before the next. A fixed script decides nothing; an agent directs its own process.
- [Tool annotations](https://ai-powered.com/academy/glossary/tool-annotations): Tool annotations are optional hints an MCP server attaches to each tool: whether it is read-only, destructive, idempotent or reaches the open world. Apps use them to decide what to ask you before running a tool, but they are hints, not guarantees.
