Configure your AI’s behavior, personality, and capabilities
This guide walks you through writing effective guidance for your AI agent. Start with one general-purpose guidance rule, test it, then add targeted rules for specific scenarios as you learn from real conversations.
Write guidance as if you were training a new team member. Be specific about what to do, when to use tools, and how to communicate.
Copy
Good:"When a customer requests a refund, look up their order using `search_orders`.If within 30 days, process using `create_refund` and confirm. If outside 30 days,explain the policy and offer store credit."Avoid:"Help customers with refunds."
Set explicit boundaries for topics outside your AI’s scope:
Copy
"If users ask for legal, medical, or financial advice, explain you can't helpwith that and offer to connect them with the right team using `offer_handoff`."
For complex guidance covering multiple concerns, use XML tags to organize sections:
Copy
<use-language>Always respond in the customer's language. If they write in German,respond in German.</use-language><tone-and-style>Be professional yet friendly. Use clear, concise language.Avoid jargon unless the customer demonstrates technical expertise.</tone-and-style><escalation-criteria>Escalate to human support if:- Customer explicitly requests a human agent- Issue involves account security or billing disputes- You cannot resolve after 3 attempts</escalation-criteria>
XML tags work well when guidance exceeds 10–15 lines or covers multiple distinct areas. For short, focused guidance, skip them.
Configured tools (actions, search tables, Unitools) aren’t available to the AI by default. You must explicitly enable each tool on a guidance rule for the AI to use it in conversations matching that rule.The simplest way to enable a tool is to mention it with @ in your instructions (for example, @search_products). This enables the tool on that guidance rule automatically and follows the best practice of always explaining when to use an enabled tool:
Copy
When a customer asks about product availability or pricing, look upthe answer using @search_products before responding.
You can also enable tools manually in the Allowed Tools section of each guidance rule. Combine this with audience targeting to restrict tool access to specific customer segments or channels.
Only enable tools the AI needs for a given guidance rule. Extra tools add decision overhead and can lead to unnecessary tool calls.
Always greet the user by name: "Hello {{user.first_name}}, how can I help you today?"{% if user.external_attributes.plan == "enterprise" %}You are speaking with an enterprise customer. Prioritize their requestsand offer to schedule a call with their account manager if needed.{% endif %}
Channel-specific behavior:
Copy
{% if conversation.channel_type == "zendesk" %}You are assisting a support agent. Keep responses concise and factual.{% elsif conversation.channel_type == "slack" %}Keep messages brief and use casual, friendly language.{% else %}Use a professional yet warm tone for website visitors.{% endif %}
Store custom user data (subscription tier, company size, feature flags) in external attributes and access them via {{user.external_attributes.your_field}}.
Audience filters control which guidance rules and tools apply to a conversation. This is how you restrict instructions and capabilities to specific customer segments or channels. Without audience filters, every active guidance rule applies to every conversation.Click “Add Audience Filter” in any guidance rule to build targeting rules.User attributes:
Copy
User → Plan → equals → "enterprise"User → Location → starts with → "EU"User → Email → ends with → "@company.com"
(User.plan = "enterprise" OR User.plan = "business")ANDUser.location starts with "US"
Use audience filters instead of cramming conditional logic into one rule. Separate guidance rules per segment keep instructions focused and ensure the AI only has access to the tools each segment needs.
The AI receives all matching guidance rules as a single combined prompt. The list order in the UI determines the order they appear in that prompt. Drag rules to reorder them.Audience filters are the primary mechanism for scoping behavior. Order is secondary, but place the most important instructions first for clarity:
For multi-step processes that require strict sequencing and conditional logic, use procedures instead of guidance. Procedures let you define structured workflows with branching, code-based checks, and guaranteed enforcement of business rules.Use procedures for refund flows, identity verification, account changes, and other processes where steps must happen in the right order and eligibility checks must be deterministic.
Most agents use both: guidance for general behavior and procedures for structured workflows. Start with guidance and add procedures when you need enforced step-by-step processes.
Guidance 1: Enterprise SupportInstructions: "Provide detailed answers. Proactively offer resources.Use `search_advanced_docs` for technical details. Offer to schedulea call with the success team."Audience: User.plan = "enterprise"Tools: search_advanced_docs, search_web, offer_handoffGuidance 2: Standard SupportInstructions: "Help users solve common issues. Point to documentation.Escalate complex issues to the support team."Audience: EveryoneTools: search_docs, offer_handoff
Sales vs. Support
Copy
Guidance 1: Sales AssistantInstructions: "Focus on product benefits and use cases. Highlightfeatures relevant to the user's industry. Offer demos and trials."Audience: User.is_customer = falseTools: search_products, search_case_studies, search_webGuidance 2: Customer SupportInstructions: "Help customers use the product. Answer how-to questionsand troubleshoot issues. Search documentation first."Audience: User.is_customer = trueTools: search_docs, search_products, offer_handoff
Channel-Specific Behavior
Copy
Guidance 1: Zendesk Agent AssistInstructions: "You're assisting support agents, not end customers.Provide concise, factual information agents can relay. Includeticket number references and knowledge base links."Audience: Channel = "zendesk", Mode = "private"Tools: search_docs, search_ticketsGuidance 2: Website ChatInstructions: "Engage directly with website visitors. Be welcoming.Qualify leads by understanding needs before recommending solutions."Audience: Channel = "web"Tools: search_products, search_web, offer_handoff