Skip to main content

How to Design a System Prompt

Guide · about 7 min · refs checked 2026-11-03 (reference links and dates only)

A system prompt is the invisible spec of your product's behavior. What to put in it, what to leave out, and how to test whether it actually holds.

How to
Standing rules only: identity, tone, boundaries, refusal policy. One-off tasks go in the user message — don't mix them in. Write checkable clauses: "cite a link when quoting external information" beats "be honest" — it's enforceable and testable one by one. Give boundary clauses an exit: refuse with a reason plus an alternative; a bare "don't do X" yields robotic refusals. A system prompt is not a security boundary: a motivated user can always get around it; the real defenses sit in permissions and tools. Test clause by clause: each rule gets one should-trigger and one should-not-trigger input; re-run on every revision. Version it like a prompt: system-prompt edits need model-version records and regression runs too.

Example and interpretation

A teaching scenario, not a measured or executed site test.

A lasting rule can require source-grounded answers with unknowns for missing facts; the user message supplies this event's material. An instruction embedded in quoted material is not a new rule. Validate output beyond the system prompt.

How to check your practice

Explain the example in your own words, inspect input constraints, then verify against the source. Revisit concepts if you cannot explain why; supply missing dates, fields or permissions; withdraw unsupported conclusions.

For this topic, start with missing input · See all six scenarios and their reasoning

Sources
  • Anthropic Claude prompting best practices ↗
  • OpenAI Prompt engineering guide ↗
  • Google Gemini prompting strategies ↗