Prompt injection attack is a technique that manipulates an AI system by placing malicious instructions into user input, documents, web pages, or other data the model reads. The injected text tries to override system instructions, change behaviour, or make the model reveal information or call tools in unsafe ways.
How Prompt Injection Works
Prompt injection is dangerous because the attacker does not need to break the model’s underlying code, only to influence what the model reads and follows. The malicious text can sit in a chat message, hidden in a webpage, embedded in a document, or placed inside tool output, then compete with the system prompt for control of the model’s next action.
This matters most when the model has access to sensitive context or tool permissions. A successful injection can redirect the model’s reasoning, expose private instructions or data, and make it act on behalf of the attacker rather than the user. That is why prompt injection is a control-plane problem as much as a content problem.
Direct, Indirect, and Multimodal Injection
Direct prompt injection targets the conversation itself, for example by telling the model to ignore prior instructions or reveal hidden context. Indirect prompt injection hides the malicious instruction inside external content the model ingests later, such as a webpage, email, file, ticket, or retrieved document. Multimodal variants place the instruction in images, screenshots, OCR text, or other non-text channels that still become model input.
Indirect attacks are especially difficult because the malicious payload may look like ordinary content to a human reviewer. The model does not need to “understand” the instruction in the attacker’s intent, it only needs to treat the instruction as higher priority than the safety or system rules it should have preserved.
Why Prompt Injection Becomes a Security Boundary Issue
Prompt injection turns untrusted content into a potential command channel. In an agentic workflow, that can lead to tool misuse, unsafe data retrieval, or action execution under a privileged session. NHIMG’s Prompt Injection Guide covers the main attack forms and the layered defences that reduce this risk.
For agentic systems, the problem compounds when the model can browse, retrieve, send, write, or execute. OWASP’s OWASP Agentic AI Top 10 and NHIMG’s OWASP Agentic Applications Top 10 both treat prompt injection as part of a wider trust and privilege problem, not just a model-quality defect.
Common Failure Modes and Defences
Prompt injection succeeds when the system lets untrusted text influence authority-bearing decisions. Typical failure modes include instruction hierarchy confusion, overbroad tool permissions, weak separation between retrieved content and trusted policy, and insufficient output validation before action is taken. The attack becomes more effective when the system can leak hidden context, chain tools, or preserve memory across sessions.
Defences work best when they reduce the model’s ability to treat untrusted input as instruction. That includes isolating system instructions, limiting what the model can do with tools, constraining what context it can see, and validating any action that would disclose data or change state. In practice, a prompt filter alone is not enough, because the attack often arrives through retrieval, content ingestion, or tool output rather than a visible user message.
Risk and Threat Considerations
Prompt injection can expose secrets, manipulate decisions, trigger unsafe tool use, or cause an assistant to reveal private context that should never be user-controlled. The risk rises sharply when the model has access to customer records, internal documents, email, code repositories, or operational tools, because the attacker is effectively trying to smuggle instructions into a trusted execution path.
Failure mechanism: The model treats attacker-supplied text as more authoritative than its system or policy instructions, then follows that text into retrieval, disclosure, or tool actions.
Impact: The result can be data exfiltration, unsafe automation, fraudulent actions, or a wider compromise of the agent’s trust boundary and downstream systems.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST AI RMF sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | ASI02 — Tool Misuse | Prompt injection can steer an agent into unsafe tool use. |
| ASI03 — Identity & Privilege Abuse | Prompt injection often works by abusing an agent's authority and access. | |
| Recommendation — Constrain tool invocation so untrusted instructions cannot trigger privileged actions. Separate trusted policy from user-controlled input before an agent acts. | ||
| MITRE ATT&CK | T1204 — User Execution | Prompt injection relies on a victim system following attacker-supplied instructions. |
| T1059 — Command and Scripting Interpreter | Injected instructions can drive scripted or automated behaviour through a model. | |
| Recommendation — Map prompt-driven misuse paths to user-execution-style abuse and monitor for triggered actions. Detect model-triggered command paths that should never be reachable from untrusted text. | ||
| NIST AI RMF | GOVERN — Govern | Prompt injection is an AI governance and accountability issue for unsafe model actions. |
| Recommendation — Assign ownership for prompt-risk governance and acceptable-use boundaries. | ||
Practitioner Guidance
Why practitioners should care: Prompt injection is not just a model safety issue, it is a governance issue for any AI system that can read untrusted content and take actions. Treat every tool-enabled model as a system with an attack surface, not a passive text generator.
What to watch for: Review cases where the model can browse external content, process uploaded documents, or call tools without a separate policy check. Those are the conditions where injection becomes operationally meaningful, especially when the action path includes authentication material, shared sessions, or privileged APIs.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org