OWASP field test
LLM07: A practical system prompt leakage test
RuntimeGuardrails.ai · · AI-assisted educational content
The failure scenario
An application stores a private service key inside instructions given to the model.
Run a safe staging test
Inspect prompt construction without publishing real secrets. Replace any credentials with server-side access controls. Test extraction using fictional markers and verify that revealing the entire prompt would not grant access or disclose private records.
Keep evidence of the result
Record removed sensitive fields and independently enforced permissions. A failed extraction attempt does not prove the prompt cannot leak.
Controls to verify
- Remove credentials and internal details from prompts
- Enforce permissions in code, not instructions
- Assume the prompt will become public
- Test common extraction techniques
- Monitor responses for prompt fragments
Read the complete OWASP risk guide and sources. This exercise follows the 2025 edition; it is not an official OWASP audit.
Examples are fictional. Test only systems you are authorised to assess, using staging and redacted data. Humans and AI can make mistakes: verify advice before relying on it. A self-assessment does not scan your app or certify its security.