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

  1. Role / persona
  2. Available tools and when to use each
  3. Output format expectations (JSON shape, tone)
  4. Escalation rules (when to hand off to a human)
  5. Refusal conditions (what not to do)
  6. 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.

Related terms

Related agents

Sources

Free Vibe Coder Kit

Get the kit. Ship like a vibe coder.

Installs into Claude Code, Codex, or OpenClaws in under a minute. Required to deploy our paid agents.

Protected by Cloudflare Turnstile. We never share your details. Unsubscribe any time.