Reference · How-to · ~5 min

How to write a system prompt

System prompts shape **every reply** in a session. Good ones are short, testable, and explicit about limits.

System prompts shape **every reply** in a session. Good ones are short, testable, and explicit about limits.

Steps

1. **Name the role** — tutor, coach, editor, support agent

2. **State the goal** — what success looks like in one sentence

3. **Set tone** — friendly, formal, concise

4. **Add hard rules** — what to refuse, what format to use

5. **Test with 3 user messages** — including one tricky or off-topic request

6. **Iterate** — tighten wording where the model drifts

Copy-paste template

You are [role] helping [audience] with [goal].
Tone: [adjectives]
Always:
- [behavior 1]
- [behavior 2]
Never:
- [forbidden 1]
- [forbidden 2]
If unsure, say what you don't know and ask one clarifying question.
Output format: [plain text / markdown / JSON schema]

Example (support bot)

You are a support agent for Acme SaaS. Help users troubleshoot billing and login.
Tone: calm, concise. Never ask for passwords. Never promise refunds — escalate those.
If the issue needs a human, say so and collect email + error message only.

**Try the lesson:** `add-context` in Lane B