OWASP LLM02
LLM02 Sensitive Information Disclosure: Stop LLMs Leaking PII and Secrets
OWASP LLM Top 10 · 2025 edition · Updated 25 November 2026 · Independent educational guide
New to LLMs, classifiers or RAG? Read the beginner FAQ and terminology.
Building an action-taking agent? Read the full agent runtime security guide for execution-time boundaries, safe tests and OWASP mapping.
Read the dated field-test post.
What is sensitive information disclosure in LLM applications?
Sensitive information disclosure occurs when an LLM reveals personal data, credentials, proprietary code or confidential records in its responses. Leaks come from prompts, training data, retrieved documents and logs. Prevention combines redaction before and after the model, strict data access scoping and careful logging policies.
How do LLMs leak sensitive information?
Common paths include users pasting secrets into prompts, retrieval systems returning documents the user should not see, models repeating memorised training data, and logs storing full prompts. An attacker can also use prompt injection to ask the model to reveal context it was given, such as other customers' records.
Should I redact PII before or after the model?
Both, where practical. Redacting before the model keeps personal data out of third-party providers and logs. Checking responses afterwards catches data that came from retrieval or memorisation. Pattern matching is fast for emails, card numbers and keys; named-entity models catch names and addresses at some extra latency.
How do I audit my app for OWASP LLM02?
Map where personal and secret data enters the system, which provider receives it, and where it is stored. Test whether the model returns data from another user or tenant. Confirm secrets never sit in prompts, logs are minimised, and your privacy notice describes what is actually sent to model providers.
What does this OWASP LLM risk look like in practice?
Illustrative scenario: A customer assistant retrieves another customer's order and includes it in an answer.
How can I test it safely?
Create two fictional customers with distinct records. Sign in as each and ask for the other's data through both ordinary and adversarial prompts. Verify retrieval permissions independently of response redaction.
What evidence should I keep?
Keep cross-user access results, redaction misses and confirmation that prompt logs do not retain credentials or unnecessary personal data.
LLM02 audit checklist
- Redact PII and secrets from prompts and responses
- Scope retrieval to the signed-in user or tenant
- Keep API keys and credentials out of prompts entirely
- Minimise and protect prompt logs
- Review provider data retention settings
Control to consider: PII and secret redaction. Some controls run outside the request path; model inline checks, then measure your own deployment.
General guidance only, written with AI assistance and human oversight. Verify against your own system and the official OWASP project before relying on it.
Sources and scope
- OWASP Top 10 for LLM Applications — authoritative risk definitions; this guide follows the 2025 edition.
Examples and checklists are our explanatory guidance, not an official OWASP audit, endorsement or a test of your application. Calculator values are modelled assumptions, not detector benchmarks.