# Prompt injection

**Prompt injection**: An attack in which text an AI agent reads, such as a web page, an issue or a file, contains instructions aimed at the agent, so it acts on someone else’s words as if they were yours.

Also called: prompt injection.

## Not the same as a bad prompt

A bad prompt is your own unclear request. Prompt injection comes from content you never wrote: the agent reads it while doing the task, and it cannot reliably tell the data it was asked to read from instructions hidden inside it.

## Where it bites

The more an agent can do, the more an injected instruction can do through it. An agent that reads untrusted pages and can also run commands or reach your secrets is the risky combination, so keep its permissions narrow and watch what it actually does.

Checked: 2026-10-22

## Covered in these lessons

- [MCP — connecting outside tools](https://zero2vibecode.com/learn/claude-code/3-3-mcp-servers)
- [Permissions, and being honest about the risk](https://zero2vibecode.com/learn/claude-code/3-4-permissions-safety)

Source: https://zero2vibecode.com/glossary/prompt-injection
