Definition
What is a system prompt?
Last updated
Definition
A system prompt is the instruction message that establishes an LLM's role, tone, constraints, and tools — separate from the user's message and typically given higher priority by the model.
System prompts are where most agent behavior lives. A well-crafted system prompt defines the agent's persona, available tools, output format, escalation rules, and refusal conditions. Modern LLMs treat system messages as higher-priority than user messages, which is why prompt-injection defenses rely on the system/user message distinction. Production agents typically have system prompts in the 200–2,000 token range.
Anatomy of a production system prompt
- Role / persona
- Available tools and when to use each
- Output format expectations (JSON shape, tone)
- Escalation rules (when to hand off to a human)
- Refusal conditions (what not to do)
- Examples of correct behavior (few-shot)
Why structure matters
LLMs follow ordered, explicit instructions better than buried prose. A system prompt with numbered sections and examples consistently outperforms one with the same information written as a paragraph.