System Prompt Leakage
A term used in AI security for the risk that the system prompt, the operating instructions hidden in a chatbot or AI service, is exposed to outsiders through users' questions or attacks.
What does System Prompt Leakage mean in simple terms?
AI chatbots built by companies contain instructions hidden from users, such as "Answer only customer inquiries" or "The discount rules are as follows." System prompt leakage refers to cases where a user gets these instructions word for word through cleverly worded questions. OWASP explains that the risk grows less from the instructions being revealed than from putting information such as API keys, passwords and internal permission rules in them. It therefore recommends not treating the system prompt as a secret or using it as a security control, and handling important permission checks in systems outside the AI. When building an in-house chatbot, the basic rule is to include only content that would cause no problem if the instructions were made public.
How can System Prompt Leakage be explained with an analogy?
It is like writing the safe's combination into a store's staff customer-service manual, so that the moment a customer peeks at the manual, the safe can be opened too.
Where is System Prompt Leakage used?
Microsoft Bing Chat — Internal instructions and a code name exposed
In February 2023, Stanford student Kevin Liu used prompt injection to make Microsoft's new Bing chatbot reveal its hidden operating instructions and its internal code name, "Sydney."[2] The OECD AI Incidents Monitor recorded this as an AI incident.[2]
Result: It became widely known that chatbot instructions can be revealed just by asking questions (per the OECD AI incident record).[2]
OWASP — Added as a new entry in the 2025 top 10 LLM risks
In the "Top 10 for LLM Applications 2025" released in November 2024, OWASP newly added system prompt leakage as LLM07.[1][3] OWASP said it added the entry because of real-world attacks and strong demand from the community, and concluded that the system prompt should not be treated as a secret or as a security control.[1][3]
Result: Set the standard that core controls such as privilege separation and authorization checks should not be left to the AI but handled in external systems (per OWASP).[1]
Learning steps, limitations and developments
- Do not put API keys, passwords, internal system names or per-employee permission information in the system prompt.
- Check whether the content would be safe to share if the full instructions became public.
- Handle rules such as "Only tell administrators" through sign-in and permission systems, not through AI instructions.
- Split tasks with different permission levels into separate AIs, each with only the permissions it needs.
Training a model not to reveal its instructions cannot by itself guarantee that leaks will be prevented.[1] On the other hand, some companies, such as Anthropic, publish the system prompts of their own services in official documentation, so what matters is less whether the instructions are made public than what is put in them.[4]
How has System Prompt Leakage evolved?
Which concepts are related to System Prompt Leakage?
- TargetSystem promptOperating instructions a service puts into the AI in advance
- Main methodPrompt injectionA typical attack used to extract the instructions
- Similar conceptJailbreakAttempts to get an AI to bypass its restrictions
- CountermeasureGuardrailsMechanisms outside the AI that check input and output
What to Put in a System Prompt vs What to Leave Out
Which sources explain System Prompt Leakage?
- OWASP GenAI Security Project — LLM07:2025 System Prompt Leakage (accessed 2025) — https://genai.owasp.org/llmrisk/llm072025-system-prompt-leakage/
- OECD AI Incidents Monitor — Bing Chatbot Exposes Confidential Instructions After Prompt Injection Attack (2023-02-10) — https://oecd.ai/en/incidents/2023-02-10-4440
- OWASP — OWASP Reveals Updated 2025 Top 10 Risks for LLMs (2024-11-17) — https://genai.owasp.org/2024/11/17/owasp-reveals-2025-top-10-risks-for-llms-new-sponsorship-program/
- Anthropic — System Prompts (accessed 2026) — https://platform.claude.com/docs/en/release-notes/system-prompts
Tell us what you think
Your feedback helps us improve the content.