AI-901 lesson 7: system and user prompts
A system prompt holds the standing instructions that apply to every turn of a conversation, such as persona, tone, scope and refusals. A user prompt is the message for one turn, such as a question or a task. A third role, assistant, carries the model’s earlier replies. A chat model receives all three as one list of messages, so the quality of the first two decides most of what comes back, and an exam question that asks where an “always” or “never” rule belongs is asking about the system prompt.
The roles and what belongs where
| Role | Written by | Typical content | Lifetime |
|---|---|---|---|
| System | The developer or admin | Persona, scope, tone, language, refusals, output format | Every turn |
| User | The person using the app | The question or task, plus pasted material | One turn |
| Assistant | The model | Earlier replies in the conversation | History |
The test for where a sentence goes is simple: would it still be true in the next conversation? If yes, it is a system prompt rule. Safety-relevant restrictions are best backed by platform guardrails, not by wording alone.
Building an effective prompt
Good prompts remove guesswork. Five ingredients cover most needs:
- Role. Who the model is acting as: “a support assistant for a travel agency”.
- Task. What to do, stated plainly and first, because instructions near the start and end tend to carry more weight.
- Format. What the output should look like: three bullets, a table, a fixed set of labels, or a specified structure that another program will read.
- Constraints. Length, language, topics to avoid, and an “out” such as “say you do not know when the answer is not in the provided text”. Giving the model an out reduces invented answers.
- Examples. One or more sample inputs with the desired outputs. Few-shot examples guide only the current request and do not retrain the model, and a prompt with none is called zero-shot.
Clear separators between instructions and pasted material, such as headings or delimiters, help the model tell them apart. Sampling settings such as temperature are separate from the prompt text. The prompt engineering basics page extends these techniques.
Grounding with your own data
A model knows only what it learned in training, which has a cut-off and contains nothing about a company’s private documents. Left alone it may answer confidently and wrongly. Grounding fixes this by supplying the relevant facts at question time. The common pattern is retrieval-augmented generation (RAG), in four steps: the question is used to search a knowledge source, the best passages are retrieved, those passages are added to the prompt as context, and the model writes an answer based on them. The system prompt typically instructs it to answer only from the supplied text and to cite it.
Grounding differs from fine-tuning. Fine-tuning changes the model’s weights using extra training. Grounding leaves the model unchanged and changes only the input, so updated documents are used immediately. The topic pages on RAG and fine-tuning vs RAG vs prompting cover the trade-offs.
Worked example: a policy assistant that drifts
A 200-person firm deploys an assistant for its HR policies. Testers report that it switches language, chats about holiday destinations, and quotes a leave rule that does not exist.
The fixes map to the ingredients. The first two are standing behaviours, so they go in the system prompt: reply in English unless asked otherwise, discuss only HR policy, and politely decline other topics. The invented rule is a grounding problem. The policy documents are retrieved and added as context, and the system prompt adds the out: answer only from the provided policy text, and say so when the answer is not there. Leaving such rules to individual user prompts would be fragile.
Easy to confuse
- System prompt vs user prompt. Standing rules versus a single request.
- Prompt vs parameters. Wording shapes content, while temperature and similar settings shape how varied the sampling is.
- Grounding vs fine-tuning. Supplying facts at question time versus changing the model through extra training.
Common mistakes follow from these: vague tasks (“make it better”), conflicting instructions, burying the format request in a long paragraph, assuming the model remembers earlier conversations, and trusting an ungrounded answer without checking it.
Key points
- The system prompt sets standing behaviour for every turn, and the user prompt carries one request.
- Strong prompts state role, task, format, constraints and, where useful, examples.
- Giving the model permission to say it does not know reduces invented answers.
- RAG retrieves relevant passages and adds them to the prompt so the answer is grounded.
- Grounding changes the input, fine-tuning changes the model.
Check yourself
Question 1. A chatbot for a bank must never give investment advice, in any conversation, whatever a customer asks. Where should this rule be set?
- A. In each customer’s user prompt
- B. In the assistant messages of the history
- C. In the system prompt
- D. In the temperature setting
Show answer
Answer: C
A rule that must hold across every conversation is a standing instruction, which belongs in the system prompt, ideally backed by platform guardrails. Individual user prompts are easy to omit or contradict, the assistant role only holds previous replies, and the temperature setting controls variability, not rules.
Want more questions like this? Full AI-901 practice tests →
Question 2. An internal assistant keeps inventing details about last year's pricing contract. The contract PDFs are available in a search index. What is the most direct improvement?
- A. Retrieve relevant contract passages and add them to the prompt as context
- B. Increase the temperature
- C. Shorten every user question
- D. Move the contracts into the assistant role
Show answer
Answer: A
Retrieving the relevant contract passages and adding them to the prompt, with an instruction to answer only from them, grounds the answer in real data. Raising temperature increases variety and invention, a shorter user prompt does not supply facts, and the assistant role does not hold documents.
Want more questions like this? Full AI-901 practice tests →
Question 3. A developer wants the model to return product reviews labelled exactly as Positive, Negative or Neutral. Outputs currently vary in wording. Which change helps most?
- A. Add a friendly greeting to the system prompt
- B. Increase the deployment’s capacity
- C. Raise the temperature
- D. Specify the three labels as the format and add a few examples
Show answer
Answer: D
Stating the allowed labels as the format and adding a few input and output examples shows the model the exact pattern. A greeting, a larger deployment capacity or a higher temperature does not constrain the wording.
Want more questions like this? Full AI-901 practice tests →
This lesson sits in the implementation domain (55-60% of AI-901), after the Foundry basics and before agents. The domain recap is at Foundry implementation explained.