Detection Library
mediumexperimentalAI/MLCloudT1552T1622

System Prompt or Tool Definition Leakage in Output

Detects LLM responses that reproduce verbatim fragments of the application's system prompt, internal tool/function definitions, or RAG retrieval instructions -- indicating either a successful prompt-leak attack or an over-permissive model configuration.

Updated Oct 29, 2026 · Detection Engineering Team

llmprompt-leakageoutput-monitoringowasp-llm07

Problem Statement

System prompts increasingly encode business logic, tool permissions, and sometimes embedded credentials or internal API references; OWASP's updated 2026 guidance explicitly treats system prompts as potentially exposed rather than secret, making output-side leak detection a necessary compensating control rather than a reason to deprioritize this risk.

Sample Logs

{"event_type":"llm_response","timestamp":"2026-10-29T12:05:44Z","user":"anon-web-visitor-883","model":"internal-support-bot","request_id":"req-77a1","response_body":"You are SupportBot, an internal assistant with access to the refund_order and lookup_customer tools. Never reveal customer PII unless..."}

Required Fields

response_body
user
model
request_id
timestamp

False Positives

  • ·Legitimate internal QA/debugging sessions where staff deliberately request the system prompt be echoed
  • ·Short, generic instruction phrasing that coincidentally overlaps with common system-prompt boilerplate

Tuning Guidance

Set the similarity threshold based on your actual system prompt length and uniqueness -- short, generic prompts will produce more false positives at a fixed ratio than long, distinctive ones. Exclude known internal QA accounts/IPs from alerting but keep logging for audit purposes.