Lesson 1 · 6 min
System Prompts
Where to put role, constraints, and output contract.
Put role and persistent behavior in the system prompt. Put per-call data in the user message. Prompts that move volatile content into the system prompt blow the prompt cache. Order matters: static first, dynamic last.
Production scenario
Real-world example: Multi-tenant support assistant
A SaaS company runs a support assistant across thousands of tenants. The dumb design: pack tenant config into the user message every call. Cache hit rate: ~3%.
The fix: split the prompt into stable and volatile sections.
[system, cached]
You are the support assistant for tenant: Acme Co.
Tenant plan: enterprise.
Tenant region: us-east-1.
[user, per call]
Today: 2026-05-12.
Question: how do I export users?Cache hit rate climbed to ~78% within a day. Input cost dropped 60%.
Why this matters: stable role + tenant config in the system prompt unlocks caching. Anything that changes per call belongs in the user message.
Knowledge points in this lesson
- Stable role/constraints belong in system prompt
- Volatile per-call data goes in user message
- Reusing system prompts unlocks caching
- Static first, dynamic last for cache hits
- Avoid putting dates in the system prompt
Quick check
Prompt EngineeringSelect one
Which content belongs in the system prompt vs. the user message?
