System Prompts: Giving AI a Role and Instructions
See how a system prompt sets a model’s role, tone and rules, and what makes one work well.
Every chat app you’ve used was quietly talking to its model before you typed a word. Behind the scenes, each request starts with a system prompt: instructions from the app, not the user, that set up who the assistant is and how it should behave.
Remember the chat template from Track 2: a conversation is sent as a list of messages labelled with roles. The system message comes first, then alternating user and assistant messages. The user never sees the system message, and models are fine-tuned to give it extra weight, a bit like a manager’s brief that outranks a customer’s requests.
A good system prompt usually covers a handful of things:
- Role and purpose: who the assistant is and what it’s for.
- Audience and tone: children, lawyers, customers; playful or formal.
- Rules and boundaries: what it must always or never do, and what to do instead.
- Format: length, structure, language.
Specific beats vague. “Be helpful” changes nothing; “Never give the final answer to a homework question; guide the child with hints instead” changes everything. Saying what to do instead of only what not to do helps too, and explaining why a rule exists lets the model handle cases you didn’t foresee.
A system prompt is strong, not unbreakable. Determined users sometimes talk a model out of its instructions, so anything that truly matters, such as safety, permissions or money, needs checks outside the model too (Track 9).
Key takeaways
- The system prompt is the app’s hidden instruction message, sent first with every request.
- It sets role and purpose, audience and tone, rules and boundaries, and format.
- Be specific, say what to do instead, and explain why a rule exists.
- It is strong but not unbreakable: important rules also need checks outside the model.
Check your understanding
Go deeper (more technical)
Some providers formalise an instruction hierarchy: the provider’s own rules outrank the developer’s system prompt, which outranks the user, which outranks text that arrives from tools or documents. Models are trained to follow that order, which helps against prompt injection but doesn’t make it impossible.
Long system prompts are common in real products, often thousands of tokens of rules and examples. Because the same text starts every request, providers cache it (prompt caching, last lesson of this track) so it costs less and is processed faster.