System prompt
In one sentence The system prompt is the standing instruction a model receives before any user message, defining its role, rules and boundaries.
Updated
A system prompt is the instruction placed before the conversation begins, telling the model what it is, how to behave, and what rules to follow.
It is the briefing a new employee gets before the shop opens: "You are the pharmacy counter assistant. Be polite, answer in Hindi or English as the customer prefers, never recommend prescription medicines yourself — refer those to the pharmacist." Customers never hear the briefing; they experience it in every interaction. The system prompt is that briefing for a model, and the user's messages arrive after it.
Technically, it is text occupying a reserved role in the chat template. Models learn during instruction-tuning to weight this role's instructions above conflicting user requests — a hierarchy, not a guarantee.
messages = [
{"role": "system", "content": "You are a support agent for Meesho. Answer only from the provided policy text. If unsure, say so and offer to escalate."},
{"role": "user", "content": "Can I return a kurta after 40 days?"}
]For builders, this is the cheapest control surface in the stack: persona, tone, output format, tool rules and safety boundaries, changeable without touching the model. Practical craft: be specific, state what to do instead of only what to avoid, and put long reference material in RAG context rather than bloating the system prompt. Its known weakness is adversarial pressure — users coaxing the model to ignore its briefing — which is the territory of prompt-injection and jailbreaks. Treat the system prompt as steering, never as a security boundary.
Where to go next
- Full lesson: Prompt engineering
- Related terms: prompt, prompt-injection, context-window, instruction-tuning