Prompt injection is an attack that tries to manipulate the model through user supplied or indirect input. System prompt leakage is the exposure of hidden instructions that define how the model should behave. Injection attempts to change behavior, while leakage reveals the rules the attacker can exploit. Both can undermine trust, but they require different defenses and testing.
Why This Matters for Security Teams
Prompt injection and system prompt leakage are often treated as the same risk, but they create different failure modes. Injection is about untrusted input influencing model behavior at run time. Leakage is about hidden instructions being exposed, copied, or inferred. The difference matters because one is primarily a control problem around input handling and tool boundaries, while the other is a confidentiality problem around prompt design, access, and response filtering. The OWASP OWASP Agentic AI Top 10 is useful here because it frames both issues as part of broader agentic application risk, not isolated model quirks.
Security teams get into trouble when they assume a strong system prompt is itself a security boundary. It is not. A model can still be steered by malicious content in documents, tickets, webpages, chat history, or tool outputs, even if the hidden instructions are never revealed. Equally, if the system prompt leaks, attackers gain insight into the guardrails, tone constraints, tool rules, and escalation paths they can target next. In practice, many security teams encounter prompt abuse only after an exposed instruction set has already been used to make the model easier to manipulate.
How It Works in Practice
Prompt injection usually enters through a channel the model is allowed to read: a user message, retrieved content, an email, a web page, or an agent tool result. The attacker tries to override the intended task by inserting higher-priority-looking instructions, deceptive formatting, or content that causes the model to follow the wrong objective. System prompt leakage, by contrast, happens when the model or surrounding application reveals hidden instructions directly or indirectly. That can occur through careless logging, overly permissive debug modes, weak response filtering, or an agent that repeats its internal context when asked the right way.
For defenders, the practical difference is where the control should sit. Prompt injection defenses focus on trust boundaries, content separation, tool permissioning, and output validation. Leakage defenses focus on prompt minimisation, secret handling discipline, access control around templates, and response redaction. Good programs test both under realistic attack paths, including retrieval-augmented generation, multi-step agents, and tool-using workflows. NIST’s NIST AI 600-1 Generative AI Profile is especially relevant because it encourages operational controls across governance, mapping, measurement, and management rather than relying on prompt text alone.
- Keep system prompts short and role-specific so there is less sensitive material to expose.
- Treat retrieved content, tool output, and external text as untrusted until validated.
- Separate instructions from data where possible, especially in agent workflows.
- Restrict logs, traces, and debug views that may capture hidden prompts or chain-of-thought adjacent material.
- Test for both behavior override and prompt disclosure, not just one or the other.
These controls tend to break down when the LLM is embedded in a high-privilege agent with broad tool access and weak context isolation, because a single successful injection can influence actions across multiple downstream systems.
Common Variations and Edge Cases
Tighter prompt controls often increase engineering overhead, requiring organisations to balance usability, observability, and security. That tradeoff becomes visible in real deployments where product teams want richer context for better responses, while security teams want less exposed instruction material and fewer chances for malicious content to steer the model.
There is no universal standard for this yet, but current guidance suggests treating indirect prompt injection as a system design issue, not just a content moderation issue. In agentic settings, the question is not only whether the model can be manipulated, but whether manipulated output can trigger actions through tools, APIs, or delegated workflows. That is why the agent layer matters as much as the model layer. The Anthropic — first AI-orchestrated cyber espionage campaign report is a reminder that attacker use of AI can be operational, persistent, and goal-driven rather than merely experimental. When the question shifts from chat to autonomous execution, leakage and injection can compound each other.
Another edge case is when a system prompt is partially leaked but the attacker still cannot directly override behavior. Even then, the leaked instructions can reveal safety thresholds, tool names, escalation logic, or refusal patterns that make later injection attempts more effective. Best practice is evolving toward layered defenses, because prompt secrecy alone does not prevent manipulation, and injection resistance alone does not prevent disclosure.
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, MITRE ATLAS and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST AI 600-1 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | LLM01 | Injection and prompt disclosure are core agentic AI attack paths. |
| NIST AI RMF | GOVERN | AI governance sets accountability for prompt handling and disclosure risk. |
| NIST AI 600-1 | GenAI profile guidance addresses misuse, exposure, and operational controls. | |
| MITRE ATLAS | AML.TA0002 | ATLAS covers adversarial manipulation methods that map to prompt injection. |
| CSA MAESTRO | MAESTRO helps structure threat modeling for agentic workflows and hidden instructions. |
Use ATLAS to model adversarial behaviors and test where input steering can alter model actions.
Related resources from NHI Mgmt Group
- What is the difference between prompt injection and LLM hijacking in security operations?
- What is the difference between prompt injection and data poisoning in LLM security?
- What is the difference between prompt injection and LLM remote code execution?
- What is the difference between prompt injection and jailbreaking in AI security?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 1, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org