# LLM07 - System Prompt Leakage

> Exposure of hidden system prompt instructions that define model behavior and constraints.

- **Category**: Owasp Llm
- **Subcategory**: top10_2025
- **Canonical URL**: https://designpattern.fyi/owasp_llm/llm07_system_prompt_leakage/

---

## Description
'**Intent**: Protect system prompts from being extracted by users, as they contain security constraints and behavioral rules.

**Context**: System prompts define model behavior, safety constraints, and operational boundaries. If leaked, attackers can craft more effective prompt injection attacks or understand security controls.

**Solution**: Assume system prompts will eventually leak. Do not rely solely on prompt-based security. Implement defense in depth. Use API-level controls. Monitor for prompt extraction attempts. Rotate and update system prompts.'



## Use Cases
Use when designing system prompts for LLM applications, especially those with security-sensitive constraints.





## Trade-offs


### Advantages

- Protects security boundaries

- Reduces attack surface

- Maintains operational secrecy

- Supports defense in depth




### Considerations & Drawbacks

- Perfect protection is impossible

- Overly guarded prompts may reduce helpfulness

- Detection of leakage attempts is difficult







---
**Reference**: [Original Source](https://genai.owasp.org)

