Ask the model to reveal hidden instructions, role text, tool policies, or developer notes.
LLM07:2025
System Prompt Leakage
System prompt leakage happens when hidden instructions, policy text, tool rules, internal routing logic, or operational context is exposed through model responses.
Step 01
Input
Step 02
Model
Step 03
Tool / Data
Step 04
Impact
What it is
Users may extract or infer system instructions. The security issue is what those instructions expose, such as credentials or authorization rules that exist only in prompt text. Prompt secrecy should not be a security control.
Why it matters
Exposed credentials can grant access; exposed prompt-only rules can reveal a route around weak authorization. A disclosed tool name or instruction does not by itself establish a security breach.
Failure path
One way this failure can develop.
Use this example to locate the input, permission or application check that would interrupt the sequence in your system.
Use translation, formatting, role-play, error paths, or indirect prompt injection to bypass refusal patterns.
Use exposed controls to tune follow-on prompts or map internal behavior.
Defenses
Controls worth checking.
Check where each control runs, who owns it and how you will test it again after a prompt, model or workflow change.
Do not store secrets in prompts
Treat system prompts as potentially exposed. Keep credentials, private endpoints, and sensitive operational details out of prompt text.
Move controls to code
Use server-side policy, authorization, and validation instead of relying on hidden instructions as the only guardrail.
Limit prompt detail
Keep prompt instructions focused on behavior, not internal architecture, vendor details, credential paths, or exact detection logic.
Signals and control gaps
- Responses that include role text, internal tool descriptions, policy fragments, or routing instructions.
- Error messages that reveal hidden prompt or chain configuration.
- Prompts containing secrets, endpoint names, or sensitive operational details.
Questions for your team
- What would be exposed if the system prompt became public?
- Which controls depend only on hidden text?
- Can the system operate safely if prompt text is inferred?