What is the difference between a system prompt and a user prompt?
The system prompt holds standing instructions from the developer, such as role, tone, rules and format, and applies to the whole conversation. The user prompt is the per-turn request. Models give system instructions higher priority, but that is not a security guarantee.
Explain it simply
In a restaurant, the owner's rules, "no outside food, serve vegetarian only", are the system prompt. The customer's order of the moment is the user prompt. The waiter follows both, and if they clash, the owner's rule wins.
Developers use the system prompt to set the assistant's role, tone, language, limits and output format once. Users then send ordinary messages. The model is trained to weigh system-level instructions more heavily.
Do not treat this as a lock. A determined user can sometimes talk a model out of its rules, and system prompt text can sometimes be coaxed out. Do not put secrets such as API keys in it, and enforce critical rules in application code too.
Example
System: You are a support assistant for an online bookstore.
Answer in under 80 words. Never promise refunds.
User: Can I get my money back for a damaged book?What to say in the interview
"The system prompt is developer-set, persistent guidance on role, rules and format; the user prompt is the turn-by-turn request. Models prioritise the system role, but it is not a security boundary, so I never place secrets there and I enforce important rules outside the model."