← All Labs
🛡 AI HACKING ADVANCED +140 XP · +56 no-hint bonus 🎯 Practice mode

Nothing Worth Leaking — Rebuild a System Prompt That Will Be Extracted

Assume this system prompt will be read by an attacker, because sooner or later it will. The prompt for a travel company's support assistant holds a discount code, an API key, a refund rule and a trust shortcut. Rebuild it so that a full leak costs nothing, then run the extraction tests. Adding "never reveal this" is one of the options. Find out how well it works.

https://bookshop.local/search

What is system prompt leakage?

System prompt leakage is when the hidden instructions given to an assistant are read by someone who should not see them. Attackers get there by asking in indirect ways, and no wording in the prompt stops every attempt.

The leak matters only as much as what the prompt contains. A persona and a tone guide are harmless. A password, an API key or a rule that nothing else enforces is a real loss.

A real case

We have not found a public incident from 2025 or 2026 that matches this technique closely enough to cite, so we are not listing one here.

How to fix it

  • Write every system prompt as if it will be published.
  • Keep secrets and keys in the backend, and let tools use them on the assistant's behalf.
  • Enforce limits and permissions in the services that carry out actions.
  • Take identity from the authenticated session, and log attempts to extract the prompt.

Questions people ask

Can I stop the prompt leaking with a stronger instruction?

You can reduce it, not prevent it. Plan for the leak instead of relying on the instruction.

Is a leaked prompt always a vulnerability?

On most programs it counts only when it exposes something sensitive or lets a control be bypassed.

Read the full OWASP LLM Top 10 guide · All free labs · AI red team certification