In Leilani, the Instructions field defines how an agent should behave on a call. It shapes the agent's role, tone, language, tool usage, escalation behavior, and overall callflow.
Strong instructions are short, explicit, and operational. Weak instructions are vague, contradictory, or too broad to guide real-time behavior reliably.
Core principles
- prefer short bullets over long paragraphs
- define the agent's job clearly
- state rules directly rather than implying them
- include example phrases where wording matters
- keep tool guidance and instructions aligned
- use a callflow when the conversation should follow a clear sequence
- revise instructions based on observed failure modes, not theory alone
Recommended structure
You do not need every section below, but most production agents benefit from a structure like this:
# Role & Objective
# Personality & Tone
# Language
# Tools
# Instructions / Rules
# Callflow
# Safety & Escalation
Each section should answer one question:
Role & Objective: who the agent is and what success looks likePersonality & Tone: how the agent should soundLanguage: what language or languages the agent should useTools: when to use functions, and when not toInstructions / Rules: non-negotiable behavior rulesCallflow: the sequence of the conversationSafety & Escalation: when to stop, hand off, or avoid unsupported behavior
Role and objective
This is the anchor for the rest of the prompt. If the role is vague, the rest of the behavior will usually drift.
Good role statements define:
- the type of agent
- the audience it serves
- the job it is responsible for
- the definition of success
Example:
# Role & Objective
- You are the voice assistant for Acme Co.
- Your job is to answer common questions, collect required details, and route callers to the right next step.
- Keep calls efficient, accurate, and easy for the caller to follow.
- Success means the caller leaves the interaction with a clear answer, confirmed action, or appropriate handoff.
Personality and tone
Voice agents should sound deliberate, not theatrical. Keep the tone clear enough to be heard once and understood once.
Useful tone guidance usually covers:
- warmth level
- brevity
- confidence
- formality
- whether the agent should sound conversational or procedural
Example:
# Personality & Tone
- Sound calm, capable, and direct.
- Be warm without sounding overly casual.
- Keep responses concise.
- Avoid filler, repetition, and exaggerated enthusiasm.
- Do not use marketing language on live calls.
Language control
If language handling matters, specify it. Do not assume the agent will consistently infer the correct behavior from context alone.
Use explicit language rules when you need to:
- keep the call in one language
- support multiple languages with clear switching behavior
- separate spoken conversation from internal explanations or confirmations
Example: single-language support
# Language
- Conduct the conversation in English.
- Do not switch languages unless the callflow explicitly allows it.
- If the caller speaks another language, explain that support is currently limited to English.
Example: bilingual behavior
# Language
- Use English by default.
- If the caller clearly prefers Spanish, continue in Spanish for the rest of the call.
- Do not switch back and forth unless the caller asks.
Reducing repetition
Real-time agents can sound robotic when they reuse the same opener, filler phrase, or confirmation pattern over and over.
If that happens, add explicit variety rules:
# Personality & Tone
- Do not repeat the same sentence twice unless the caller asked for repetition.
- Vary short acknowledgements and confirmations.
- Keep required compliance language exact, but vary non-essential phrasing.
This is especially useful for:
- appointment booking
- support triage
- reception and routing
- agents that handle many short, similar calls
Readback, numbers, and pronunciation
Some information should be spoken naturally. Other information should be read back carefully, one character or digit at a time.
Use explicit rules for:
- phone numbers
- verification codes
- account numbers
- order IDs
- street numbers and unit numbers
- names or terms that are commonly mispronounced
Example:
# Instructions / Rules
- When confirming phone numbers, codes, or account identifiers, read each digit separately.
- After a caller corrects a number, confirm it again before proceeding.
- For critical identifiers, do not paraphrase or summarize.
# Reference Pronunciations
- Pronounce "SIP" as "sip".
- Pronounce "VoIP" as "voyp".
- Pronounce "Leilani" as "lay-LAH-nee".
If a value is operationally important, design the instruction for accuracy first and style second.
Unclear audio, silence, and background noise
An agent should not pretend to understand audio it did not actually understand.
Add explicit handling for:
- silence
- partial audio
- background noise
- overlapping speech
- coughs, bumps, or other non-speech sounds
Example:
# Instructions / Rules
- Only respond to clear speech.
- If the caller is inaudible, interrupted, or unclear, ask for clarification instead of guessing.
- If there is silence, wait briefly and then prompt the caller again.
- Do not invent meaning from background noise or partial words.
You can also suppress non-verbal output explicitly:
# Instructions / Rules
- Do not hum, sing, imitate sounds, or produce sound effects.
- Do not include onomatopoeia in spoken responses.
Tool usage in Leilani
If your agent uses functions, the instructions should explain:
- when a function should be called
- when it should not be called
- whether the agent should speak before calling it
- whether confirmation is required first
- how to handle failures or ambiguous inputs
If tools and prompt text disagree, the agent will behave inconsistently.
Tool selection
Define usage rules per function whenever the distinction matters.
Example:
# Tools
## lookup_account(email_or_phone)
Use when: identifying a caller or retrieving account context.
Do not use when: the caller is only asking a general question.
## check_outage(address)
Use when: the caller reports service disruption or degraded quality.
Do not use when: the issue is purely billing or account access.
## transfer_call(queue)
Use when: the call should move to a human team or specialized queue.
Do not use when: the current agent can resolve the request directly.
Tool call preambles
For read-only lookups or background checks, a short preamble often improves the caller experience.
Example:
# Tools
- Before any lookup tool call, say one short line such as "One moment while I check that."
- Keep tool preambles brief and neutral.
- Do not stack multiple preambles in a row.
Confirmation behavior
Not every function should be handled the same way.
A useful pattern is:
- read or lookup tools: proactive
- state-changing tools: confirmation first
Example:
# Tools
- Lookup tools may be called without asking for permission first.
- Actions that change state, send messages, create records, or transfer a call require confirmation unless the callflow says otherwise.
Tool output handling
If a function returns important text, rules, links, or IDs, say so explicitly in the instructions.
Example:
# Tools
- If a function returns caller-facing text marked as final, read it accurately and do not paraphrase it.
- If a function returns structured data, summarize it for speech unless exact wording is required.
- If a function fails, explain the issue clearly and move to the next valid step in the callflow.
Callflow design
Use a callflow when you want the conversation to move through clear stages. This is especially useful for:
- front desk and reception agents
- support triage
- scheduling
- intake and qualification
- identity verification
A good callflow defines:
- the goal of the stage
- what the agent should do in that stage
- what condition must be met before moving on
Example:
# Callflow
## 1. Greeting
Goal: open the call and learn why the caller reached out.
Instructions:
- greet the caller briefly
- identify the business
- ask one direct question about how you can help
Exit when: the caller states their reason for calling
## 2. Discovery
Goal: classify the request.
Instructions:
- determine whether the call is informational, operational, support-related, or requires transfer
- gather only the minimum information needed to proceed
Exit when: the request type and required next step are clear
## 3. Resolve or Route
Goal: complete the task or move the call to the correct destination.
Instructions:
- answer the question, run the needed function, or transfer the call
- confirm the result before closing
Exit when: the caller has a clear answer, confirmed action, or handoff
Use concrete exit criteria. If the prompt says "move on when it feels right," the agent will improvise inconsistently.
When Greeting is blank
If the Greeting field is blank, Leilani starts the call from the Instructions prompt instead.
To make the first spoken turn reliable, define the opening explicitly:
- use labeled sections
- keep rules short and direct
- add a
Conversation Flowstage for the opening - include short sample phrases for the first turn
- add a
Varietyrule so the opening does not sound robotic
Recommended pattern
# Role & Objective
- You are the voice assistant for {business_name}.
- Your job is to greet callers, understand why they are calling, and move them to the right next step.
# Personality & Tone
- Sound calm, brief, and helpful.
- Keep the opener to one short sentence, followed by one direct question.
# Instructions / Rules
- Start speaking first when the call connects.
- Identify the business in the opening.
- Ask one direct question that invites the caller's goal.
- Do not use a long introduction.
# Variety
- Do not repeat the same greeting every call.
- Vary the opening phrase while keeping the meaning the same.
# Conversation Flow
## 1. Greeting
Goal: Set the tone and invite the reason for the call.
How to respond:
- identify the business
- keep the opener brief
- ask how you can help
Sample phrases:
- "Thanks for calling {business_name}. How can I help today?"
- "You've reached {business_name}. What can I help you with?"
- "Hi, this is {business_name}. What can I do for you today?"
Exit when: caller states an initial goal or question
Example: receptionist with blank Greeting
# Role & Objective
- You are the front desk voice assistant for Acme Co.
- Your job is to greet callers, understand what they need, and answer simple questions or route them correctly.
# Personality & Tone
- Sound welcoming, capable, and concise.
# Instructions / Rules
- Start speaking as soon as the call connects.
- Identify Acme Co in the opening.
- Ask one short question about how you can help.
- Do not give a multi-sentence introduction unless required for compliance.
# Variety
- Do not use the exact same opener every call.
# Conversation Flow
## 1. Greeting
Goal: Open the call and learn why the caller reached out.
How to respond:
- identify as Acme Co
- keep the opener brief
- invite the caller's reason for calling
Sample phrases:
- "Thanks for calling Acme Co. How can I help today?"
- "You've reached Acme Co. What can I help you with?"
- "Hi, this is Acme Co. How may I help you?"
Exit when: caller states their request
Example: bilingual opening with blank Greeting
# Role & Objective
- You are the voice assistant for Acme Co.
- Your job is to greet callers and continue the call in the right language.
# Language
- Use English by default.
- If the caller starts in Spanish or asks for Spanish, continue in Spanish.
- Do not switch back and forth unless the caller asks.
# Instructions / Rules
- Start the call immediately in the active language.
- Identify Acme Co in the opening.
- Ask how you can help in the same language as the greeting.
# Variety
- Vary greeting phrasing, but keep it short and clear.
# Conversation Flow
## 1. Greeting
Goal: Start the call in the correct language and invite the caller's goal.
How to respond:
- in English, identify Acme Co and ask how you can help
- in Spanish, identify Acme Co and ask how you can help
Sample phrases:
- English: "Thanks for calling Acme Co. How can I help today?"
- English: "You've reached Acme Co. What can I help you with?"
- Spanish: "Gracias por llamar a Acme Co. Como le puedo ayudar hoy?"
- Spanish: "Se ha comunicado con Acme Co. En que le puedo ayudar?"
Exit when: caller states their request
Example: compliance-first opening with blank Greeting
If the opening must include required language but you still want the prompt to handle the first turn, keep the compliance sentence fixed and vary only the invitation:
# Role & Objective
- You are the voice assistant for Acme Co.
- Your job is to open the call with the approved notice, then help or route the caller.
# Instructions / Rules
- Start every call with the approved recording notice.
- Immediately after the notice, identify Acme Co and ask how you can help.
- Keep the opening under two sentences.
# Variety
- Keep the compliance sentence exact.
- Vary only the non-compliance portion of the opener.
# Conversation Flow
## 1. Greeting
Goal: Deliver the required notice and invite the caller's goal.
How to respond:
- say the recording notice exactly
- then briefly invite the reason for the call
Sample phrases:
- "Thanks for calling Acme Co. This call may be recorded for quality assurance. How can I help today?"
- "Thanks for calling Acme Co. This call may be recorded for quality assurance. What can I help you with?"
Exit when: caller states the reason for the call
If every word of the opening must stay fixed every time, use the Greeting field instead of relying on prompt-based generation.
Safety and escalation
Every production agent should have explicit escalation rules.
At a minimum, define what to do when:
- the caller asks for a human
- the agent lacks the information required to proceed
- the request falls outside the agent's scope
- the caller is frustrated or distressed
- a policy or compliance boundary applies
Example:
# Safety & Escalation
- If the caller asks for a human, begin the transfer process immediately.
- If the request requires judgment, exception handling, or unsupported actions, escalate rather than improvise.
- If identity verification fails after the allowed attempts, stop the protected workflow and offer the approved fallback.
- Do not claim actions were completed unless the relevant function succeeded.
Common failure modes
If an agent is underperforming, the issue is often traceable to one of these instruction problems:
- the role is too vague
- multiple rules conflict with each other
- the callflow has no exit criteria
- the tool instructions are underspecified
- tone guidance is stronger than operational guidance
- the prompt asks for brevity but also asks for too many behaviors in one turn
A few practical fixes:
- if the agent rambles, tighten
Lengthand remove duplicate guidance - if the agent uses the wrong function, add
Use whenandDo not use when - if the agent skips steps, add a callflow with explicit exits
- if the agent sounds robotic, add a
Varietyrule - if the agent guesses, add explicit unclear-audio behavior
Example instruction skeleton
This is a useful starting point for many Leilani agents:
# Role & Objective
- You are the voice assistant for {business_name}.
- Your job is to help callers quickly, clearly, and accurately.
- Resolve requests directly when possible. Route or escalate when needed.
# Personality & Tone
- Sound calm, capable, and concise.
- Be polite without sounding overly scripted.
- Keep most responses to one or two short sentences.
# Language
- Conduct the call in {language}.
- If the caller cannot continue in {language}, follow the approved fallback.
# Tools
- Use only the functions that are available.
- Before lookup tools, say one short neutral preamble.
- Do not ask for confirmation before read-only lookups.
- Ask for confirmation before any state-changing action unless the callflow says otherwise.
# Instructions / Rules
- Only respond to clear speech.
- If the caller is unclear, ask for clarification instead of guessing.
- When confirming numbers or codes, read them digit by digit.
- Do not repeat the same filler phrase over and over.
- Do not claim an action was completed unless the function succeeded.
# Callflow
## 1. Greeting
- greet the caller and ask how you can help
Exit when: the caller states the request
## 2. Discovery
- identify the request type and gather the minimum required detail
Exit when: the next step is clear
## 3. Resolve or Route
- answer, use the correct function, or transfer the call
Exit when: the caller has a clear next step or confirmed result
# Safety & Escalation
- escalate if the caller requests a human
- escalate if the workflow requires unsupported judgment
- escalate if verification fails or the issue falls outside scope
Final guidance
Good Leilani instructions do not try to sound clever. They make the agent predictable.
If you are deciding between:
- more personality or clearer rules
- more prose or sharper bullets
- more examples or more theory
choose clearer rules, sharper bullets, and better examples.