Skip to content

Learning path · Foundations · 05

System Prompts

Persistent instructions that define role, rules, and tone across turns, separate from the user's immediate request.

Why it matters

  • Encodes product behaviour once instead of repeating it every message.
  • Primary place for safety, brand, and domain constraints.
  • Mutable system prompts are a common prompt-cache miss pattern in production.

Key ideas

  • Standing rules
  • Role definition
  • Versioning

System prompts set the constitution of an assistant: what it may do, how it cites sources, when it escalates. Keep them specific and testable—"refuse medical diagnosis" beats "be safe." Version system prompts like code. If you mutate the system string per tenant or per request, you may forfeit prefix-cache savings on providers that cache stable prompt prefixes. Separate stable global rules from dynamic per-user inserts when optimizing latency and cost. Review system prompts in the same release process as API schema changes, because they are behaviour contracts customers experience directly.

Updated 2026-08-09 · Full learning path