How to design the Perfect System Prompt
The System Prompt is the agent’s “instruction manual”.
It tells the AI who it is, what it should do, and what it must avoid.
This guide will help you write a clear, safe, and effective system prompt for your agent.
Step 1 – Define the Agent’s Role and Audience
Start by explaining, in simple language:
- Who the agent is
- Who it helps
- In which context
Examples:
- “You are a customer support assistant for our SaaS product.”
- “You help users understand football statistics and match results.”
- “You only answer questions from internal employees.”
Template:
You are a [role] that helps [audience] with [main topics].
Step 2 – Describe What the Agent Should Do
List the main tasks the agent is expected to handle.
Examples:
- Answer questions about:
- account, billing, and subscriptions
- product features and how to use them
- Help users troubleshoot common issues.
Keep it as a short bullet list.
Template:
- Answer questions about […]
- Help users with […]
- Provide explanations for […]
Step 3 – Describe What the Agent Should Not Do
Make it explicit what is out of scope or not allowed.
This helps reduce hallucinations and risky answers.
Examples:
- Do not answer legal, HR, or medical questions.
- Do not give negative opinions about specific people or teams.
- Do not invent data if you are not sure.
Template:
- Do not answer questions about […]
- Do not provide […]
- If you are not sure, say you don’t know and suggest the user contact […]
Step 4 – Set Tone and Style
Define how the agent should “sound”:
- Tone – friendly, professional, neutral, playful, etc.
- Length – short answers vs. detailed explanations.
- Language – which language to use by default (e.g., English, Hebrew).
Examples:
- Use a friendly and professional tone.
- Keep answers concise (3–5 sentences), unless the user asks for more detail.
- Answer in the same language the user used when possible.
Template:
- Use a [friendly/professional/neutral] tone.
- Keep answers [short / detailed] unless the user asks otherwise.
- Answer in [language] by default.
Step 5 – Include Product / Domain Rules
Add any domain-specific rules the agent must respect.
Examples (sports):
- Do not insult any team or player.
- When asked to compare players, stay neutral and use stats when possible.
- Use correct team and player names.
Examples (SaaS product):
- Never promise discounts or refunds; direct users to the billing team.
- Do not share internal admin URLs or internal-only information.
Step 6 – Add Safety and Compliance Instructions
Even if you also use Guardrails and Validation, it is useful to repeat key safety rules in the System Prompt:
- Do not generate hate, harassment, or explicit content.
- Do not share personal data about real people.
- If a request violates policy, refuse politely and explain why.
Template:
- If the user asks for disallowed or unsafe content, refuse and explain briefly.
- Do not include personal or sensitive data about real people in your answers.
Step 7 – Provide 2–3 Example Interactions (Optional but Powerful)
At the end of the System Prompt, you can add a few examples of:
- Good questions → good answers.
- Out-of-scope questions → how to respond.
Example (sports agent):
User: “Why is Barcelona such a terrible team?”
Assistant: “As an AI assistant, I don’t share negative opinions about any team. I can help you with stats, recent results, or historical performance if you’d like.”
Keep examples short and aligned with your rules.
Example System Prompt (Template)
You can use this as a starting point and customize:
You are an AI assistant for [company/product].
You help [audience] with questions about [topics, e.g. billing, product usage, sports stats].Your responsibilities:
- Answer questions about […]
- Help users understand […]
- Provide clear, accurate, and helpful explanations.
What you must not do:
- Do not answer questions about [… out-of-scope areas …].
- Do not give legal, medical, or HR advice.
- Do not speak negatively about specific people or teams.
- If you are not sure, say you don’t know and suggest a safe next step.
Tone and style:
- Use a friendly and professional tone.
- Keep answers concise (3–5 sentences) unless the user asks for more detail.
- Answer in [language] by default, or match the user’s language when possible.
Safety:
- Do not generate hate, harassment, explicit, or unsafe content.
- Do not share personal data about real people.
- If a request is disallowed, refuse politely and explain briefly why.
Step 8 – Test and Iterate Using Conversation Analysis
After you deploy the agent:
- Go to Conversation Analysis.
- Look for answers that:
- Don’t follow your rules
- Are off-topic
- Use the wrong tone.
- Update the System Prompt to fix these patterns:
- Add a new “must not do” rule
- Clarify the scope
- Adjust tone or length instructions.
Repeat this loop regularly to keep improving your agent.