Prompt injection
What is Prompt injection?
Prompt injection is an attack where text an AI agent reads -- a web page, a document, a tool's response -- contains instructions crafted to make the agent act against the user's intent, since models don't reliably separate trusted instructions from untrusted content. AdminKit's guide covers a related MCP confused-deputy risk.
By AdminKit team, Netbase JSC · Updated
Prompt injection is an attack where text an AI agent reads as part of its task — a web page, a document, a tool’s response — contains instructions crafted to manipulate the agent into doing something the user never asked for, because the model doesn’t reliably distinguish trusted instructions — including its own system prompt — from untrusted content the task involves. A direct injection targets the model’s own prompt interface; an indirect injection hides the instructions inside content the agent is only supposed to read, the more dangerous variant once agents have tool access, since a page the agent merely visits can trigger an unwanted email or API call. NIST’s adversarial machine learning taxonomy (AI 100-2) uses the same direct-versus-indirect split when classifying attacks on generative AI systems. It needs no software bug, since it targets instruction-following behavior directly, which is why defenses focus on treating read content as data rather than commands, scoping which tools an agent can call without confirmation, and validating tool outputs instead of filtering every malicious phrase. An MCP server’s elicitation requests are a related channel worth the same caution, since server-authored prompt text shown mid-session could just as easily be used to phish a user for information under a trusted-looking guise. Prompt injection is ranked among the top risks in OWASP’s Top 10 for LLM Applications; the MCP specification’s own security best practices page covers the tool-access angle specifically.
AdminKit groups prompt injection under its AI agents & MCP cluster — browse the AdminKit glossary index for other related terms.
Frequently asked questions
What's the difference between direct and indirect prompt injection?
A direct injection targets the model's own prompt interface, while an indirect injection hides the instructions inside content the agent is only supposed to read -- the more dangerous variant once agents have tool access, since a page the agent merely visits can trigger an unwanted email or API call.
Does prompt injection exploit a software bug?
No -- it needs no software bug, since it targets instruction-following behavior directly, which is why defenses focus on treating read content as data rather than patching a flaw.
How do teams typically defend against prompt injection?
Common defenses include treating content an agent reads as data rather than commands, scoping which tools an agent can call without confirmation, and validating tool outputs instead of trying to filter every malicious phrase.
Is prompt injection considered a top risk for LLM applications?
Yes -- it's ranked among the top risks in OWASP's Top 10 for LLM Applications.