When a new employee joins a shop, you don't re-explain the shop to them before every customer. You brief them once — who we are, how we speak to people, what we never promise, when to call the manager — and then they handle customers one at a time.
The system prompt is that briefing. Everything you've learned so far applies to this request; the system prompt applies to every request, forever, until someone edits it. Which makes it the highest-leverage and highest-risk text in your application.
System vs user prompt
response = client.messages.create(
model=MODEL,
system="You are ShopKart's support assistant. ...rules...", # every turn
messages=[
{"role": "user", "content": "Where is my order ORD10024?"} # this turn
],
)| System prompt | User prompt | |
|---|---|---|
| Written by | you, the developer | the person using the app |
| Applies to | every turn of every conversation | this one request |
| Contains | role, rules, tone, boundaries, format defaults | the actual question |
| On conflict | weighted more heavily by the model | — |
That last row is the practical reason the separation exists. Models are trained to treat system instructions as the operator's standing configuration, so "never quote a delivery date you weren't given" survives a user insisting otherwise far better in the system slot than glued onto each message.
What belongs in it
- Identity — what this assistant is and what it covers.
- Scope — what it should decline, and what to say instead.
- Tone and register — stated as observable rules, see below.
- Grounding rules — "use only the facts in the CONTEXT block; if a detail is missing, say so".
- Default format — length caps, list rules, whether emoji are allowed.
- Escalation — the exact sentence to produce when a human must take over.
What does not belong: anything about this particular request (that's the user turn), and anything secret. More on the second in a moment.
Adjectives aren't specifications
Nearly every weak system prompt fails the same way. It is a list of adjectives.
You are a helpful assistant. Be polite and professional.
Answer questions well. Be concise but complete."Concise" means 40 words to one person and 400 to another, so the model picks an average — a different average each time, which the team experiences as "inconsistent".
Answer in at most 4 sentences. If the answer is a process, use a
numbered list of at most 5 steps instead.
Never state a delivery date, refund amount or order id that is not
in the ORDER block.
For payment disputes or legal notices, reply exactly:
"Let me connect you to a human agent." and stop.
No emoji. Do not apologise more than once in a reply.If a reviewer can't check whether a rule was followed, the model can't either. Anything countable — sentences, steps, forbidden phrases, exact escalation wording — actually constrains behaviour. Adjectives decorate.
Personas — and what they can't do
"You are a patient teacher." "You are a strict code reviewer." A persona is a compact way to set vocabulary, depth and what the answer assumes the reader knows.
The trap, repeated from lesson 2 because interviewers keep testing it: a persona changes register, not knowledge. "You are a senior tax consultant" does not unlock tax expertise the model lacks — it makes uncertain answers sound authoritative, which is a net negative if you were hoping for accuracy.
Where personas genuinely earn their tokens:
| Task | Persona? | Why |
|---|---|---|
| Explaining a concept to a beginner | Yes | reader's background decides what a good answer looks like |
| Writing in a company's voice | Yes | tone is the deliverable |
| Extracting fields into JSON | No | one right answer; schema and examples do the work |
| Checking whether code is correct | No | correctness isn't a matter of register |
💡 The higher-value move is usually describing the reader instead of the speaker. "Explain to a second-year student who knows Python but has never seen SQL" shapes the answer far more than "You are an expert".
Wait — isn't the system prompt a security control?
It is guidance, not enforcement, and confusing the two is how teams get hurt. Two specific consequences.
Rules can be argued around. A determined user, or a poisoned document your app fetched, can steer the model past a system instruction. It is text competing with other text. Lesson 9 is entirely about this.
It isn't secret. "Users can't see the system prompt" is false in practice — extraction attempts succeed often enough that you must assume anything in context is potentially disclosable. So: no API keys, no internal pricing formulas, no other customers' data, nothing you'd be embarrassed to see screenshotted.
The corollary, worth stating in an interview: if a rule has real consequences — money moving, data leaving, a promise being made — put a check outside the model that inspects the output before it reaches anyone.
When system prompts get long
Real ones grow. A rule per incident, added by whoever handled it, for two years. Then the symptoms start: the model follows some rules and ignores others, apparently at random, and nobody can say which rule is authoritative.
This is contradiction and dilution, not a hidden length limit. The fixes are unglamorous and effective:
- Audit for duplicates and conflicts; delete rather than add.
- Resolve genuine conflicts explicitly — "if the length rule and the completeness rule conflict, completeness wins".
- Move situation-specific instructions out of the standing prompt and into the turn that needs them.
- Group rules under headings so related ones sit together.
- Put the non-negotiables near the start and restate the two or three that matter most at the end.
🎯 Selection-round radar: "What's the difference between a system prompt and a user prompt?" is a near-certain question. Give the definition, then the two lines that show experience: "models weight system instructions more heavily on conflict — but it's guidance, not a security boundary, so anything consequential also gets a check outside the model."
Structuring one for production
## Identity
You are the support assistant for ShopKart, an Indian e-commerce
site. You help with orders, returns, refunds and delivery.
## Grounding
Use only the details in the ORDER block. If a detail is missing,
say what is missing and ask for it. Never invent an order id,
date, amount or policy number.
## Format
At most 4 sentences, or a numbered list of at most 5 steps.
End with one concrete next action. No emoji.
## Scope and escalation
Payment disputes, account deletion and legal notices ->
reply exactly: "Let me connect you to a human agent." and stop.
Anything unrelated to ShopKart -> one line declining, then offer
to help with an order.
## Conflicts
If the format rule and the escalation rule conflict, escalation wins.Two structural notes. Keep this text byte-identical across requests and put it first — prompt caching works on a stable prefix, and a timestamp at the top quietly destroys that (lesson 8). And if you run several products on the same logic, factor it: one shared behaviour block, a small swappable tone block per product. Forked copies drift.
Common mistakes
- Filling it with adjectives instead of checkable rules.
- Believing a persona grants knowledge.
- Putting secrets in it because "users can't see it".
- Treating it as a security boundary rather than guidance.
- Letting it grow to hundreds of contradictory accumulated rules.
- Putting per-request details in it instead of in the user turn.
- Prefixing it with a timestamp or username, killing prompt caching.
Quick recap
| Concept | One-liner |
|---|---|
| System prompt | standing configuration for every turn; weighted above the user turn on conflict |
| Good rules | countable and checkable — sentences, steps, exact escalation wording |
| Personas | set register and audience assumptions; never knowledge |
| Not a guardrail | guidance, not enforcement — and not secret either |
| Long prompts fail by | contradiction and dilution; audit and resolve conflicts explicitly |
| Keep it stable | byte-identical prefix, first position — caching depends on it |
Practice Zone — PYQs from real selection rounds
Six MCQs, then two tasks: rewrite a vague system prompt as a specification, and decide where a persona actually helps.
What is the practical difference between a system prompt and a user prompt?
Asked in

Your support bot's system prompt says "be helpful". Users complain the answers ramble. The best fix is:
Asked in

Assigning a persona ("You are a senior tax consultant") mainly changes what?
Asked in

A system prompt has grown to 900 lines of accumulated rules. Symptoms: the model follows some rules and ignores others, unpredictably. The most likely cause is:
Asked in

Where should a rule like "never give medical dosage advice; redirect to a professional" live?
Asked in

Your assistant must sound formal for banking customers and casual for a student app, but the logic is otherwise identical. Best structure?
Asked in

Hands-on tasks:
This system prompt is in production and the team complains the bot is "inconsistent". Rewrite it so every instruction is checkable. Keep it under 15 lines.
Asked in

You are a helpful assistant for ShopKart customer support.
Be polite and professional. Answer questions well.
Don't say anything wrong. Be concise but complete.For each task, decide whether assigning a persona actually helps, and say in one line why: (1) summarising a legal contract for a first-time renter, (2) extracting invoice totals into JSON, (3) writing a rejection email to a candidate, (4) checking whether a SQL query is correct.
Asked in

FAQ
How long should a system prompt be?
As long as it takes to state the rules that matter, and no longer. Plenty of good production prompts are 30–80 lines. What matters isn't the count but whether every line is checkable and non-contradictory — 500 lines of clear, non-overlapping rules beats 50 lines of adjectives.
Can users override the system prompt?
They shouldn't be able to, and models resist it — but "resists" is not "prevents". Treat override attempts as expected traffic, and back any rule with real consequences with a check outside the model (lesson 9).
Should the system prompt include few-shot examples?
Yes when the examples apply to every conversation — a tone reference, your labelling conventions. That also makes them part of the cacheable prefix. Examples chosen per request belong in the user turn instead.
Next lesson: the reusable moves — delimiters, decomposition, self-critique, instruction placement — Lesson 7: Prompt Patterns →


