LLM07:2025
System Prompt Leakage
Slide 18 of 27
Part 4 · Prevention
Slide 18
PART 4
Prevention
Slides 18–25 · 6 mitigations, each grounded in real incidents
Slide 18 · Prevention Overview
Six OWASP mitigations. One unifying principle.
The principle: design so that extraction causes no harm.
🚫
M1 — Never store secrets in system prompts
Credentials, tokens, and API keys belong in secret managers — not in any layer the model can read.
🏛️
M2 — Don’t rely on prompt secrecy as a security control
Security must hold even if the full prompt is public. Design for that assumption.
🔍
M3 — Output filtering
Detect and block responses that echo or paraphrase system prompt content.
📦
M4 — Privilege separation
Keep sensitive logic in backend code. The model only sees what it needs to respond, not the full machinery behind it.
🎯
M5 — Red-team prompt extraction
Test your own system with all four extraction techniques before it ships.
🔐
M6 — Access controls and least privilege
Limit what context the model sees. The less it knows, the less it can reveal.
← Back
Next → M1 — Never store secrets in prompts