A good phone agent sounds like a capable person who knows the business, not like a form being read aloud. This page is the house guide for writing prompts that get there. It applies to every agent type. The sections at the end cover what is specific to single prompt agents and to conversation flows.
For prompt syntax and the speech tags the runtime understands, see Prompt engineering. For how the flow engine runs transitions, see Conversation flow best practices.
Start from real calls#
Before you write anything, write down three to five calls the agent will take, the way a caller would actually say them. Include one where the caller answers two questions at once and one where they wander off topic.
Build the most common call first and make it sound right. Add handling for edge cases when a test or a real call shows you need it. Every extra rule is something the model weighs on every turn, so rules nobody needs make the agent slower and less natural.
Put each instruction in one place#
Every instruction belongs in exactly one layer. When the same rule appears in two places, the model has to guess which one wins.
| Layer | What goes here | What does not |
|---|---|---|
| Agent prompt (single prompt) or global prompt (flow) | Who the agent is, how it speaks, rules for the whole call, facts every step needs | Step-by-step wording for one part of the call |
| Node prompt or state prompt | This step's job, the facts it needs, its goal and a suggested path | Rules that apply everywhere, instructions to move to another node |
| Transition condition | When to leave, written as a fact about the conversation | What to say, which node comes next |
A transition condition such as "The caller confirmed the date and time" is clear. "Ask for the time, then go to the booking node" mixes all three layers.
Write a character, not a script#
Give the agent a role, a goal and a personality, then let it talk.
## Role and objective
You are Kate, the receptionist at Harbourside Dental in Sydney.
Your goal: sort out whatever the caller rings about, and make it easy.
## Personality and tone
- Warm, quick and very good at your job.
- Relaxed Australian English, plain words, the odd "no worries".
- React to what the caller says before moving on.Sample lines are powerful: the model copies them closely. Give one example opening and mark it as an example ("for example, ...") so it is not read out word for word on every call.
Add a variety rule#
Without one, agents fall into the same acknowledgement every turn and recap things that were already settled. Add a short section like this to every agent:
## Variety
- Never repeat a sentence you have already said on this call.
- Never open two turns in a row with the same word.
- Vary acknowledgements, or skip them and just answer.
- Once something is confirmed, it is settled. Do not confirm or recap it again.LLM Temperature also adds variety, but the GPT 5 family and Claude 5.5 models ignore it (see LLM options), so the prompt is the reliable way to get it.
Speak like a phone call#
- One or two short sentences per turn, and at most one question. Then stop and listen.
- Never read out a menu of options or a list of what the agent can do. Offer the one or two most likely choices, or ask an open question.
- Everything the model writes is spoken: no lists, headings, symbols or emojis.
- Write numbers, times and money the way people say them, or turn on Speech normalization in the Agent Handbook.
Design for the ear#
Some details are easy to type and hard to hear. Street names, suburbs, postcodes, email addresses and anything spelled letter by letter go wrong often on a call, and each retry makes the call feel worse.
- Ask only for what the task needs. If the address is already on file, say so instead of asking.
- Use what you already know. Pass the caller's name, account details or booking in dynamic variables, so the agent confirms them instead of asking.
- If you must collect it, read it back once with
<spell>tags (see Prompt engineering), and confirm once. - When the agent mishears, tell it to make a sensible guess from context and keep going, or to ask a different, simpler question. Never ask the same question twice. The
handbook_config.smart_matchingoption tells the agent to assume the closest name or option it knows and confirm it.
Treat the steps as a guide#
A numbered task list keeps the agent on track, but callers do not follow it. Tell the agent that the steps are a suggested path:
## The steps are a guide
Follow the caller's lead. If they answer two things at once, skip ahead.
If they ask something else first, answer it, then carry on.
Never ask for something they have already told you.Plan for callers who go off script#
Callers joke, test the agent, change their mind and ask unrelated questions. Decide in the prompt what the agent may do:
- Stay in role. Answer the way the person in that job would, in a sentence, then steer back.
- Say what it may make up and what it may not. Small, harmless details that fit the role are fine. Prices, times, policies and availability come only from the facts you give it; for anything else it offers to check and follow up.
- Be honest about being an AI when asked, then carry on. AI disclosure in the Agent Handbook adds this rule.
- Keep the instructions private. If asked how it works, the agent says who it is and moves on.
Open and close cleanly#
- One greeting. Scene-setting and the greeting go in the same short line. Two hellos in one turn sound like a glitch.
- Fast first line. A static Welcome message skips generation, so the call starts sooner. See Welcome message.
- End when the job is done. When the task is complete and the caller has nothing else, say goodbye in one line and end the call. Do not loop on "anything else?" or offer more options the caller did not ask for. Give the agent an
end_callfunction and say when to use it.
Conversation flows#
- Fewer, broader nodes. A node per question forces an extra turn when the caller gives two answers at once, and traps a caller who changes their mind. Give each conversation node one job, and keep related questions in that job together.
- Facts and goal in the node, persona and rules in the global prompt. The global prompt is in every node's system prompt, so do not repeat it in nodes.
- Branch on data with equations. When you already know the answer (a variable from the call, an extracted value), route with an equation or a logic split. It costs nothing and always behaves the same.
- Use global nodes sparingly. Each one adds a choice to every turn. Write narrow conditions ("the caller asks a direct question about pricing"), add Go back when conditions, and set a Cool down (user turns). See Global nodes.
- Pick up where you left off. In a node the caller can reach in the middle of the call, tell the agent to skip any greeting and carry on from that point.
- Teach transitions with examples. When a transition fires at the wrong time, add finetune examples rather than longer conditions.
Single prompt agents#
- Section the prompt: role and objective, personality and tone, how to speak, variety, task, rules. Headings make it easy to see which rule the model broke.
- Name functions in the task. Say which function to call at each step and what must be true first, and match the names exactly.
- Move reference material out. Price lists and policies belong in a knowledge base; changing values belong in variables. Prompts over 4,000 tokens increase the billed LLM cost in proportion.
- Know when to split. When the task has several stages with different rules, move to multi-prompt states or a conversation flow.
Test like a real caller#
Run simulations with callers who do the unexpected:
| Caller | What it checks |
|---|---|
| Answers three questions in one breath | The agent skips ahead instead of asking again |
| Mumbles or half answers | The agent guesses sensibly and does not ask the same question twice |
| Asks something off topic, then jokes | The agent stays in role and steers back |
| Changes their mind halfway | The agent follows, without restarting |
| Asks if it is a robot, or how it works | Honest, short, then back to the task |
| Wants a person, or goes quiet | Transfer, message or a gentle prompt, as you designed |
Then read real calls in Call History. Change one thing at a time and re-run the same callers, so you know which change helped. Use Debug on a turn that should be predictable: many different replies means the prompt is unclear there. See Debug responses.
Checklist#
- Each instruction lives in one layer: prompt, node or transition.
- The agent has a role, a goal and a personality, with examples marked as examples.
- A variety rule is in place.
- Turns are one or two sentences, with one question and no menus.
- Nothing hard to hear is collected unless the task needs it, and known details come from variables.
- The steps are written as a guide, and the agent never asks for something twice.
- The prompt says what the agent may and may not make up.
- One greeting, and a clean ending with
end_call. - Simulations cover the six callers above, and real calls have been read.