Prompt injection is an attack where instructions are placed into an LLM's input so the model treats them as commands instead of data.
Large language models process prompts as a single stream of text. When system guidance, user requests, and external content are mixed together, the model can give unintended weight to instructions that were meant to be treated as plain data.
Prompt injection appears in chatbots, AI assistants, and agent workflows where the model reads or summarizes documents, emails, or web pages. It can be direct (a user message) or indirect (instructions hidden inside content the model reads).
This differs from traditional injection flaws because filtering input alone is not enough. Defenses focus on separating instructions from data, limiting tool permissions, validating outputs, and monitoring for unexpected behavior.