Separating System Prompts from User Prompts
This lesson explains the two kinds of prompt that shape a generative model's behaviour: the system prompt, which sets the rules for the conversation, and the user prompt, which makes each request. Putting each kind of content in the right place is the foundation of prompt engineering.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the elements of a good system prompt.
- Describe what a user prompt contains in an application.
- Decide whether an instruction belongs in the system prompt or the user prompt.
The system prompt
The system prompt, also called the system message or instructions, is written by the developer and applies to every turn. A good system prompt usually covers the following elements.
- Role and audience: You are a support assistant for Contoso's home-insurance customers.
- Task and scope: what the assistant does and which topics it declines.
- Grounding rules: Answer only from the policy text provided. If the answer is not there, say so.
- Tone and style: formal or friendly, length, reading level.
- Output format: bullet points, a table, JSON with given fields.
- Safety rules: what never to do, such as giving legal advice.
Instructions in the system prompt are not a security control: users can try to override them, so guardrails and application logic enforce the rules that must never be broken.
Write a system prompt
The user prompt
The user prompt is the specific request in each turn: a question, a document to summarize, text to classify. In an application, it often combines the user's words with content the application adds, such as retrieved documents or the text to analyze. Earlier turns of the conversation are also sent so that the model can resolve references such as it or the second option.
Where each instruction belongs
Put persistent behaviour in the system prompt and per-request content in the user prompt. A rule written only in one user prompt is forgotten when the user asks something else, and a document pasted into the system prompt is sent with every request even when it is not relevant, which wastes tokens. The following table recaps the split.
| Content | Belongs in |
|---|---|
| Role, tone, scope and output format rules | System prompt |
| What to do when the answer is unknown | System prompt |
| The question or task for this turn | User prompt |
| The text, document or data to process this turn | User prompt (delimited) |
The following diagram shows the system prompt applying to every turn of a conversation.

Misplaced instructions
Fixing an inconsistent assistant
A travel assistant sometimes answers in long paragraphs and sometimes in lists, and occasionally gives medical advice about vaccinations. The developer has been adding answer in three bullet points to some user prompts.
Formatting and scope rules belong in the system prompt so they apply to every turn: Answer in at most three bullet points. Do not give medical advice; for health questions, recommend consulting a travel clinic. A guardrail can additionally block clearly harmful content, but the scope rule is an instruction matter rather than a content-filter matter.
Can a rule in the system prompt be relied on as enforcement?
Show answer
No. System prompt rules are guidance. Hard rules are enforced with guardrails and code.
Exam Tips
Remember for the exam
- The system prompt sets role, scope, tone, grounding rules and format for every turn.
- The user prompt carries the request and the content for one turn.
- System prompt rules are guidance, not enforcement; guardrails and code enforce hard rules.