System prompt
A system prompt is high-priority context that sets an AI assistant's role, boundaries, style, and response rules before the user's request is handled.
A system prompt is the application author’s standing instruction to a chat model. It can establish the assistant’s job, allowed scope, tone, output format, and what to do when information is missing. The user prompt supplies the current task inside that frame.
Chat APIs split a conversation into messages with roles. OpenAI spells out how those roles rank. Its own rules sit at the top, the app builder’s instructions come next, and the person typing comes after that. When two messages disagree, the higher one wins. Pasted documents and tool results get no authority as rules, so text from a web page is meant to be treated as information, not as new house rules. That is an intention, not a lock: the same spec admits that hidden instructions can be very hard for a model to tell apart from the developer’s own. Other providers name their roles differently: Gemini, for instance, takes a separate system instruction field.
So a system prompt steers the model; it does not force it. The same prompt can act differently on another model or version, and a clash with user content can change behaviour, especially in long chats. Teams therefore write rules plainly, try them on ordinary and hostile inputs, and add filters and evaluation around the model.
An application needs consistent behaviour across many different user requests.
Follow one request through the instruction stack.
- 1 · setThe application supplies standing instructions that define the assistant's job, scope, tone, and fallback behaviour.
- 2 · askThe user adds a request as a separate message with lower instruction authority.
- 3 · resolveThe model follows the instruction hierarchy when messages point in different directions.
- 4 · answerThe model generates a response shaped by both the standing rules and the current request.
A system prompt is part of the control stack, not a guarantee of compliance.
| Who | What they ask | What it works with |
|---|---|---|
| Support product | “Help me diagnose this error” | A support role, product scope, and escalation rule |
| Writing assistant | “Rewrite this announcement” | House style, audience, and length limits |
| Data extractor | “Pull the contact details from this note” | Required fields and missing-value behaviour |
| Tutor | “Explain why my answer is wrong” | Teaching level, tone, and hint policy |
- It gives many requests the same role, scope, tone, and output expectations.
- It can state what the assistant should do when information is missing or a request is out of scope.
- Message roles let an application keep developer guidance separate from user content.
- System prompts influence behaviour but do not guarantee that every rule will be followed.
- They do not replace filters, evaluations, permissions, or application-side validation.
- Long or contradictory instructions can consume context and create inconsistent behaviour.
Sources used
This explainer is written in original language. The links below support its factual claims.
- officialModel Spec (2026/08/18), OpenAI · read 27 Sept 2026
- docsDeveloper quickstart, OpenAI · read 27 Sept 2026
- docsPrompting best practices, Anthropic · read 27 Sept 2026
- docsText generation, Google AI for Developers · read 27 Sept 2026
- docsSystem message design, Microsoft · read 27 Sept 2026