Building with AI

System prompt

3 min readbeginnerUpdated 28 Sept 2026
1 · In one line

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.

1 · What it is

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.

2 · Why it exists

An application needs consistent behaviour across many different user requests.

Scope is unclearA specialist assistant needs to be told what it is and what it may and may not do.
Formats varyThe application may need a stable tone or output contract across a whole conversation.
Rules can conflictOpenAI's Model Spec, for example, ranks its own rules above developer instructions, and developer instructions above user requests.
3 · How it works

Follow one request through the instruction stack.

System prompt and user request pass through instruction priority Standing system instructions and a user request enter a highlighted priority resolver, which sends the resolved context to a model response. INPUT MESSAGES SYSTEM / DEVELOPERYou are a support agent.Scope: Acme productsFormat: 3 short steps USER“Help me reset my key.” KEY MECHANISMRank by authorityhigher levels outrank lower onesquoted text gets no authorityuser request fills in the task ASSISTANT RESPONSEAcme key reset1. Open Settings…2. Revoke the old key…3. Create and store… Separate application controlspermissions · filters · output validation · evaluation
The system prompt frames the request; the model then generates within that instruction context.
  1. 1 · setThe application supplies standing instructions that define the assistant's job, scope, tone, and fallback behaviour.
  2. 2 · askThe user adds a request as a separate message with lower instruction authority.
  3. 3 · resolveThe model follows the instruction hierarchy when messages point in different directions.
  4. 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.

4 · Where it's used
WhoWhat they askWhat 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
5 · What it solves, and what it doesn't
solves
  • 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.
doesn't solve
  • 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.
6 · Go deeper

Sources used

This explainer is written in original language. The links below support its factual claims.

  1. officialModel Spec (2026/08/18), OpenAI · read 27 Sept 2026
  2. docsDeveloper quickstart, OpenAI · read 27 Sept 2026
  3. docsPrompting best practices, Anthropic · read 27 Sept 2026
  4. docsText generation, Google AI for Developers · read 27 Sept 2026
  5. docsSystem message design, Microsoft · read 27 Sept 2026