What is a system prompt?
Instructions the builder of an AI app gives the model before you type anything. It sets the role, the tone and the rules, and it outranks what users say.
beginner · Also called System Message, Developer Message, Instructions
Every AI app you use has been briefed before you arrive. A support bot knows it works for one shop. A coding assistant knows to answer in code. That brief is the system prompt: text the app's builder puts in front of every conversation, usually out of your sight.
Anthropic calls it the system prompt. OpenAI calls the same thing developer messages, or instructions. The idea is identical.
What goes in one
A system prompt usually covers:
- A role. "You are a helpful coding assistant who specialises in Python." Anthropic notes that even a single sentence like this changes the model's focus and tone.
- Rules. What to do, what not to do, and how to say no.
- Context. Today's date, the product, the customer's account level.
- Format. Short answers, plain language, no tables, always cite sources.
Why it outranks you
Models are trained to give the builder's instructions more weight than the user's. OpenAI's documentation says it plainly: developer messages are prioritised ahead of user messages. That is what lets a bank's chatbot refuse to write your essay. It was told to stick to banking, and your request ranks below that.
It is also why a system prompt should say that text from web pages, files and tool results is information, not orders. That line is one of the defences against prompt injectionPrompt InjectionAn attack that hides instructions in text a model reads, such as a web page, an email or a file, so the model follows the attacker instead of you..
What it is not
A system prompt is not a safe. OWASP, the security group, says it should not be treated as a secret or used as a security control. Users do sometimes coax a bot into repeating its instructions, so builders should keep passwords and keys out of it and enforce real limits in code.
It also takes up room. The system prompt sits in the context windowContext WindowEverything a model can see at once while it writes an answer, counted in tokens. When the window is full, something has to be left out. on every turn, so a long one costs tokens on every message.
Using the idea yourself
You can write your own. If your chat app has a setting for custom or standing instructions, that is your system prompt. Keep it short and specific: who you are, what you want, what to avoid. Calm wording works better than capitals. Anthropic warns that "CRITICAL: you MUST" style prompts can make newer models overdo the thing you asked for.
Sources
Where each fact comes from
This page was last checked against these sources on 14 October 2026.
- 1Prompting best practices
Anthropic, Claude API documentation · 14 October 2026
Setting a role in the system prompt focuses Claude's behaviour and tone, and even a single sentence makes a difference. The example system prompt is "You are a helpful coding assistant specializing in Python." Some models are more responsive to the system prompt than earlier ones, and aggressive wording in capitals, such as "CRITICAL" and "You MUST", can make them overtrigger.
- 2Text generation
OpenAI API documentation · 14 October 2026
Developer messages are instructions from the application developer, prioritised ahead of user messages. User messages come from an end user and are prioritised behind developer messages. Instructions given in the instructions parameter take priority over the prompt in the input.
- 3Mitigate jailbreaks and prompt injections
Anthropic, Claude API documentation · 14 October 2026
System prompts can set ethical and legal boundaries and tell the model how to refuse. The system prompt should state that content returned from tools, documents or searches is untrusted and must never override the system prompt or the user's request.
- 4LLM07:2025 System Prompt Leakage
OWASP Gen AI Security Project · 14 October 2026
The system prompt should not be considered a secret, nor should it be used as a security control. Credentials and connection details should not be contained in the system prompt.
- 5Context windows
Anthropic, Claude API documentation · 25 September 2026
The question, instructions, tool definitions and tool results all count toward the context window.