Skip to main content
AIRed Team Framework GitHub
← All attack patterns
ATK-007 Output handling

Prompt Leakage — System Prompt Exposure

Applies to: LLM, Agentic AI, Multi-modal · Last reviewed 2026-05-01

Prerequisites

  • Target system uses a system prompt that conveys business logic, restricted information, or sensitive guardrail instructions.
  • System does not have output-side detection for system-prompt content disclosure.

Test approach

With written authorization, the tester asks the model to: repeat its previous instructions, summarize the conversation, translate the conversation, output debug information, or roleplay as a system that introspects its instructions. The tester uses both direct and indirect framings. The objective is to determine whether the system prompt or restricted business logic can be elicited.

Expected evidence

  • Full request/response logs.
  • Model output containing partial or full system prompt content.
  • Comparison to the actual system prompt to assess fidelity of disclosure.

Detection signals

  • Outputs containing tokens, structure, or phrasing matching the system prompt (use embedding similarity against the known system prompt).
  • Outputs with unusually high overlap with internal documentation.

Defensive recommendations

  • Apply output-side detection comparing responses to the system prompt (similarity threshold).
  • Avoid placing sensitive business logic in the system prompt; move it to deterministic code where possible.
  • Use prompt-level instructions explicitly forbidding disclosure, combined with output filtering — neither alone is sufficient.
  • Include prompt-leakage testing in pre-production evaluation.

Framework mappings

  • OWASP LLM Top 10: LLM06:2025, LLM01:2025
  • MITRE ATLAS: AML.T0057
  • NIST AI RMF: MEASURE-2.7

Related AI Controls Catalog entries

These controls provide the audit test procedures that validate defences against this attack pattern.

References