System Prompt Leakage
Key Takeaways
- System prompt leakage is ranked LLM07 in the OWASP Top 10 for LLM Applications 2025 and covers sensitive information exposed through the instructions that steer an LLM.
- OWASP’s position is that a system prompt should not be treated as a secret or used as a security control.
- The real risk is not the prompt text itself but what it contains or implies: credentials, internal rules, filtering criteria and permission structures.
- Effective mitigation moves secrets and authorization out of the prompt and into deterministic controls the model cannot override.
What Is System Prompt Leakage?
System prompt leakage is a vulnerability in which the system prompt of an LLM application, the hidden instructions that define its behavior, contains sensitive information that an attacker can extract or infer. The OWASP Top 10 for LLM Applications 2025 lists it as LLM07:2025.
Attackers typically extract system prompts with crafted requests such as asking the model to repeat its instructions, translate them or output them in a code block. But OWASP makes an important point: even without verbatim extraction, attackers can often work out the rules by observing how the application responds. So the question is not just “can someone read our prompt?” It is “what happens if they do?”
Why System Prompt Leakage Matters
Secrets end up in prompts
Developers sometimes place API keys, connection strings or database names in system prompts for convenience. Once leaked, those become direct entry points into back-end systems.
Internal rules become a bypass guide
A prompt that says “decline loans over a certain amount” or “never discuss topic X” tells an attacker exactly where the boundaries are and what to work around.
Roles and permissions get exposed
Prompts that describe user roles, admin functions or privileged workflows give attackers a map for privilege escalation attempts.
It enables follow-on attacks
Leaked filtering criteria and tool descriptions make prompt injection and LLM jailbreak attempts more precise. Leakage is rarely the end goal. It is reconnaissance.
How System Prompt Leakage Is Tested
Direct extraction attempts
Testers ask the model, in many phrasings, to reveal, summarize, translate or reformat its instructions. They also try role-play framings and requests to continue text from the start of the conversation.
Indirect and multi-turn probing
Instead of asking for the prompt outright, testers reconstruct it piece by piece across several turns, or plant extraction instructions in content the app retrieves.
Inference from behavior
Testers map what the application refuses, which tools it calls and how it responds at boundaries. This reveals rules and permissions even when the prompt text stays hidden.
Impact validation
The final step is checking whether leaked details actually lead somewhere: whether a revealed key works, whether a disclosed rule can be bypassed or whether a described admin function can be reached.
System Prompt Leakage vs Sensitive Information Disclosure
Scope of the data
Sensitive information disclosure (LLM02:2025) covers any confidential data an LLM reveals, such as personal data or proprietary content. System prompt leakage is narrower, focused on the application’s own configuration and instructions.
Root cause
Sensitive information disclosure often stems from training data, retrieval sources or poor output filtering. System prompt leakage stems from design choices: putting secrets in the prompt and relying on it for access control.
Mitigation focus
Disclosure defenses emphasize data sanitization and access controls on sources. Prompt leakage defenses emphasize keeping the prompt free of secrets and enforcing security outside the model.
How Novee Approaches System Prompt Leakage
Novee’s AI Red Teaming solution tests LLM-powered apps and agents with an attacker’s mindset, probing for exposed instructions and then reasoning about how leaked rules, roles and workflows could be chained into a real compromise. The Novee Prompt Library supports targeted testing of these AI attack surfaces. Three independent agents validate each finding before it is reported, and Agentic Remediation retests to confirm a fix works.
FAQ
Not by itself. OWASP advises treating the system prompt as non-secret. It becomes a vulnerability when the prompt contains credentials or sensitive details, or when the application relies on the prompt to enforce access control or business rules that an attacker can then bypass.
There is no reliable way to guarantee a model will never reveal its instructions. Instructions like “do not share this prompt” can be overridden through prompt injection. The safer approach is to assume the prompt may leak and make sure nothing in it would cause harm if it did.
Keep API keys, passwords, tokens, connection strings, database names and detailed permission structures out of the system prompt. Store them in systems the model cannot read directly, and enforce authorization in deterministic code. The prompt should guide behavior, not hold secrets or act as a security boundary.