System prompt leakage occurs when hidden instructions, internal policies, or privileged context are revealed through prompt manipulation or model behavior quirks. Exposure of internal control logic helps attackers craft more effective bypass strategies. Leakage also risks disclosing operational details and sensitive governance controls.
Keep sensitive policy controls outside prompt text wherever possible and enforce external policy engines for critical checks. Use response filtering and leak-detection tests to prevent hidden prompt disclosure. Segment privileged context and monitor extraction attempts as security events.
The same feature written the risky way, then with the fix applied.
How this risk has ranked in each OWASP release.
2025Latest
#07llm07-2025 System Prompt Leakage