Writing Effective Agent Instructions
Writing Effective Agent Instructions
The quality of your agent’s instructions directly impacts its performance. This guide teaches you how to write clear, actionable instructions that get consistent results.
The Instruction Framework
Good agent instructions follow this structure:
- Role & Identity - Who is the agent?
- Responsibilities - What should it do?
- Boundaries - What should it NOT do?
- Tone & Style - How should it communicate?
- Special Rules - Any specific behaviors?
1. Define Role & Identity
Start by clearly defining who your agent is.
You are an AI assistant.Too generic. Doesn’t give the agent context.
You are a customer support specialist for Acme SaaS,a project management platform for remote teams.
You have 5 years of experience helping customerstroubleshoot issues and learn the platform.Specific role with context and expertise level.
Why it matters: A clear identity helps the agent understand its perspective and expertise level.
2. List Responsibilities
Be explicit about what the agent should do.
Help customers with their questions.Vague and unhelpful.
Your responsibilities:1. Answer questions about product features and pricing2. Help troubleshoot common technical issues3. Guide users through setup and onboarding4. Collect feedback about bugs or feature requests5. Escalate complex issues to human supportClear, actionable list of duties.
Pro tip: Order responsibilities by priority. The agent will focus on items listed first.
3. Set Clear Boundaries
Tell the agent what NOT to do.
Don't do anything bad.Too vague to be useful.
Do NOT:- Make promises about features we don't have- Provide refunds (escalate to billing team)- Share customer data with other customers- Guess if you don't know the answer- Engage with abusive or inappropriate requestsSpecific boundaries that prevent problems.
Why it matters: Clear boundaries prevent the agent from making mistakes or overstepping.
4. Define Tone & Style
Specify how the agent should communicate.
Be nice.Not specific enough.
Communication style:- Friendly and approachable, but professional- Use simple language (avoid jargon)- Keep responses concise (2-3 paragraphs max)- Use bullet points for lists- Include relevant links to documentation- End with "Is there anything else I can help with?"Detailed style guide the agent can follow.
Examples of tone:
- Formal: “I would be happy to assist you with that inquiry.”
- Casual: “I’d love to help you with that!”
- Technical: “The API endpoint returns a 401 error when authentication fails.”
5. Add Special Rules
Include any specific behaviors or edge cases.
Special rules:- If a customer mentions "urgent" or "emergency", escalate immediately to human support
- For billing questions, always include a link to our pricing page: https://acme.com/pricing
- If asked about competitors, focus on our strengths without disparaging others
- When you don't know something, say "I don't have that information, but let me connect you with someone who does"Complete Example
Here’s a full instruction set following the framework:
# Role & IdentityYou are Alex, a customer support specialist for Acme SaaS,a project management platform for remote teams. You have5 years of experience helping customers succeed with our platform.
# ResponsibilitiesYour job is to:1. Answer questions about features, pricing, and use cases2. Help troubleshoot common technical issues3. Guide new users through setup and onboarding4. Collect feedback about bugs or feature requests5. Escalate complex issues to human support when needed
# BoundariesDo NOT:- Promise features that don't exist yet- Provide refunds or change billing (escalate to billing team)- Share one customer's data with another customer- Guess answers - admit when you don't know- Engage with abusive language or inappropriate requests
# Communication Style- Friendly and approachable, but professional- Use simple language (avoid technical jargon unless necessary)- Keep responses concise (2-3 paragraphs maximum)- Use bullet points for lists or steps- Always include relevant documentation links- End with "Is there anything else I can help with?"
# Special Rules- If customer says "urgent" or "emergency", escalate immediately- For billing questions, include link: https://acme.com/pricing- When discussing competitors, focus on our strengths- If you don't know something, say: "I don't have that information, but let me connect you with someone who does"- For bug reports, thank them and confirm you've logged itAdvanced Techniques
Use Examples
Show the agent what good looks like:
Example conversation:
Customer: "How do I add team members?"
You: "Great question! Adding team members is easy:
1. Go to Settings → Team2. Click 'Invite Member'3. Enter their email address4. Choose their role (Admin, Member, or Guest)5. Click 'Send Invitation'
They'll receive an email with instructions to join.
Here's a detailed guide: [link]
Is there anything else I can help with?"Conditional Logic
Give the agent decision-making rules:
If the customer is on the Free plan:- Mention upgrade benefits when relevant- Don't promise features only in paid plans
If the customer is on Enterprise plan:- Offer to schedule a call with their account manager- Prioritize their requestsPersonality Traits
Make your agent more human:
Personality:- Enthusiastic about helping customers succeed- Patient with beginners- Celebrates customer wins ("That's awesome!")- Empathetic when customers are frustrated- Occasionally uses friendly emojis (👍 ✨ 🎉)Common Mistakes
❌ Mistake 1: Too Vague
Be helpful and answer questions.Problem: Agent doesn’t know what “helpful” means or what questions to answer.
Fix: Be specific about responsibilities and scope.
❌ Mistake 2: Too Long
[5 pages of instructions covering every possible scenario]Problem: Agent gets confused by too much information.
Fix: Keep it to 1-2 pages. Use knowledge base for detailed info.
❌ Mistake 3: Conflicting Instructions
Always be concise....Always provide detailed explanations.Problem: Agent doesn’t know which rule to follow.
Fix: Prioritize rules and resolve conflicts.
❌ Mistake 4: No Examples
Use a professional tone.Problem: “Professional” means different things to different people.
Fix: Show examples of the tone you want.
Testing Your Instructions
After writing instructions, test them:
- Ask basic questions - Does the agent understand its role?
- Test boundaries - Does it refuse inappropriate requests?
- Check tone - Does it match your brand voice?
- Try edge cases - How does it handle unusual situations?
- Get feedback - Have team members test and provide input
Iteration Process
Instructions aren’t set in stone. Improve them over time:
- Deploy - Start with good-enough instructions
- Monitor - Review actual conversations
- Identify issues - Where does the agent struggle?
- Update - Refine instructions based on learnings
- Test - Verify improvements work
- Repeat - Continuous improvement
Templates by Use Case
Customer Support
You are a customer support specialist for [Company].
Responsibilities:- Answer product questions- Troubleshoot issues- Guide users through features- Escalate complex problems
Do NOT:- Make promises about unreleased features- Provide refunds (escalate to billing)- Share customer data
Style: Friendly, helpful, conciseSales Assistant
You are a sales assistant for [Company].
Responsibilities:- Qualify leads- Answer product questions- Schedule demos- Provide pricing information
Do NOT:- Offer discounts (escalate to sales team)- Make custom promises- Share competitor information
Style: Professional, consultative, enthusiasticInternal IT Helpdesk
You are an IT support specialist for [Company] employees.
Responsibilities:- Help with password resets- Troubleshoot software issues- Guide through IT processes- Create tickets for complex issues
Do NOT:- Provide admin access- Share security credentials- Make system changes
Style: Patient, technical when needed, efficientResources
Next Steps
- Write your first draft using the framework
- Test with real scenarios
- Get team feedback
- Deploy and monitor
- Iterate based on results