Safety & security

System Prompt Leakage

AI-assisted editorial review:

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?

Case 1

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]

Case 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

  1. Do not put API keys, passwords, internal system names or per-employee permission information in the system prompt.
  2. Check whether the content would be safe to share if the full instructions became public.
  3. Handle rules such as "Only tell administrators" through sign-in and permission systems, not through AI instructions.
  4. 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?

2023.02
Bing Chat instructions exposed
A chatbot's hidden instructions and internal code name are revealed just by asking questions.
2024.07
System prompts published
Anthropic begins publishing the system prompts of its apps in official documentation.
2024.11
System Prompt Leakage
It is added as the new entry LLM07 in OWASP's top 10 LLM risks for 2025.

Which concepts are related to System Prompt Leakage?

  • Target
    System promptOperating instructions a service puts into the AI in advance
  • Main method
    Prompt injectionA typical attack used to extract the instructions
  • Similar concept
    JailbreakAttempts to get an AI to bypass its restrictions
  • Countermeasure
    GuardrailsMechanisms outside the AI that check input and output

What to Put in a System Prompt vs What to Leave Out

ComparisonOK to includeDo not include
RoleScope of support, toneInternal system structure
InformationPublic product and policy informationAPI keys, passwords, database names
RulesTopics it will not answerCriteria for deciding each user's permissions
TestContent that is fine if made publicContent that would cause harm if leaked

Which sources explain System Prompt Leakage?

  1. OWASP GenAI Security Project — LLM07:2025 System Prompt Leakage (accessed 2025) — https://genai.owasp.org/llmrisk/llm072025-system-prompt-leakage/
  2. 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
  3. 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/
  4. Anthropic — System Prompts (accessed 2026) — https://platform.claude.com/docs/en/release-notes/system-prompts