Sensitive PII Pattern in LLM Response Content
Scans outbound LLM API response bodies for regex-matched PII (SSN, credit card PAN, private key headers, API key patterns) before they leave the application boundary -- output-side DLP for OWASP LLM02 Sensitive Information Disclosure, distinct from input-side prompt filtering.
Updated Oct 29, 2026 · Detection Engineering Team
Problem Statement
LLMs can reproduce fragments of memorized training data or echo sensitive context pulled into a prompt via RAG without the application ever intending to expose it to the end user. OWASP's 2026 LLM Top 10 explicitly extends this risk to tool-call records and retrieval results, not just chat completions -- making output-side scanning a necessary complement to input filtering and access-controlled retrieval.
Sample Logs
{"event_type":"llm_response","timestamp":"2026-10-29T09:44:10Z","user":"svc-reporting-bot","model":"gpt-4.1","request_id":"req-88f2","response_body":"Based on the records, the customer's SSN on file is 078-05-1120 and..."}Required Fields
False Positives
- ·Documentation/test-fixture generation requests where synthetic PII-shaped data was explicitly requested
- ·A user pasting their own real data into the prompt and asking the model to reformat/summarize it (same-session, same-user round-trip)
Tuning Guidance
Suppress when the matched pattern also appears verbatim in the corresponding prompt (same session) -- that's an echo, not a disclosure, and is a materially different risk than the model surfacing PII it was never given. Validate credit-card matches with a Luhn checksum to cut noise from random 13-16 digit sequences.