AI System Prompt Extraction (Guided)
Guided version for beginners: the steps are written out for you beside the lab. BrandBot was instructed never to reveal its system prompt. Direct requests are blocked. But translation, encoding, and 'repeat in [format]' tricks slip through. Get it to leak.
What is system prompt extraction?
System prompt extraction is getting an assistant to reveal the hidden instructions it was given. Direct requests are usually refused.
Indirect ones often succeed, because the model is asked to do an ordinary task, such as translating, summarising or reformatting, with its own instructions as the material. The model does not see the difference between describing its rules and disclosing them.
A real case
The system prompts behind several of Grok's AI personas were found exposed on its website and were reported by 404 Media. The text showed exactly how each persona had been instructed to behave.
The lab shows the conversational route to the same outcome. However the text gets out, the lesson is that hidden instructions do not stay hidden.
Source: 404 Media
How to fix it
- Write the system prompt as if it were public.
- Keep secrets and access rules in backend code, not in the prompt.
- Check outputs for long overlaps with the prompt text.
- Do not depend on a do-not-reveal instruction as a security control.
Questions people ask
Why do attackers want the system prompt?
It shows how the assistant is restricted, which makes it easier to plan a way around those restrictions. Sometimes it also contains secrets.
Does telling the model not to reveal it work?
It stops casual attempts. It does not stop a determined person.
Is system prompt leakage in the OWASP Top 10?
Yes, as LLM07 in the 2025 list for LLM applications.
Read the full Prompt Injection guide · All free labs · AI red team certification