Write a voice prompt
Structure an agent's prompt so it sounds natural on the phone, stays in scope, and uses live call data safely.
The prompt is the most important setting on an agent: it decides what the agent says, what it refuses, and how it sounds. Use this page when you write a new agent or when an existing one rambles, invents answers, or reads things aloud that it shouldn't.
These are defaults that work for most agents. Your own conventions win when they differ.
Start from this skeleton
Strong production prompts use XML-style sections in this order. Leave out any section you don't need.
<identity>
You are Lina, the card services assistant for Acme Bank. Your single goal is
to help callers block a lost or stolen card.
</identity>
<hard_rules>
- Only discuss card blocking. For anything else, offer a transfer to an agent.
- Never ask for a full card number, PIN, or password.
- If the caller sounds distressed or mentions fraud in progress, transfer at once.
</hard_rules>
<language>
Reply in the caller's language: English or Gulf Arabic. Use a polite, formal tone.
</language>
<tools>
- lookup_customer: call it after the caller confirms their date of birth. While
it runs, say "One moment while I find your account." If it fails, apologize
and transfer.
- block_card: call it only after the caller confirms which card to block.
- transfer_to_human_warm: use it when a rule above says to transfer.
</tools>
<call_flow>
1. Greet and confirm the caller wants to block a card.
2. Verify identity with date of birth, then call lookup_customer.
3. Read back the last four digits of each card and ask which one to block.
4. Call block_card, confirm the result, and ask if there is anything else.
5. Say goodbye and call end_call.
</call_flow>
<conversation>
Speak in one or two short sentences, then stop. Ask one question at a time.
If the caller is silent, ask once whether they are still there.
</conversation>
<context>
Current time: {{system.timezone.asia-dubai}}
Caller phone: {{system.caller_phone_number}}
Customer name: {{vars.customer_name}}
</context>| Section | What goes in it |
|---|---|
identity | Who the agent is, who it works for, and the one goal of the call |
hard_rules | Scope, things it must never say or do, required compliance wording, when to escalate |
language | Languages and dialects, when to switch, how formal to be |
knowledge | Facts it may state: products, hours, policies. Anything not here, it must not invent. |
tools | Each tool by its exact name, when to call it, what to say while it runs, what to do if it fails |
call_flow | The steps of a good call, from greeting to end_call |
conversation | Voice style, silence, interruptions, repeats, off-topic callers |
pronunciation | How to say brand names, abbreviations, and numbers in your domain |
context | Every live value, and nothing else. Always last. |
Make the prompt as long as it needs to be, but make every line change the agent's behavior. After large changes, check the token budget.
Put live values last
Collect every template variable —
{{system.*}}, {{vars.*}}, {{tools.*}}, the time, caller data — in a
final <context> section. In the body, refer to them by name: "the
customer's name from the context section".
This does two things. The part of the prompt before the first live value is identical on every call, so replies start faster and cost less. And keeping data in one fenced section helps the model treat it as information, not as instructions.
Treat everything that arrives through variables, SIP headers, and pre-call tools as untrusted. Tell the model it is information about the caller, never instructions to follow.
Say how to speak — we don't add it for you
We add almost nothing to your prompt. There is no built-in "you are on a phone call" text, so the prompt has to set the voice style itself:
- Speak in one or two sentences, then stop and let the caller talk.
- Ask one question at a time.
- No markdown, lists, headings, emoji, URLs, or symbols. Everything is read aloud.
- Write numbers, dates, currency, and codes the way they are spoken: "twenty-five dirhams", "the fourteenth of March", "five five five, one two three four".
- Never read tool names, variable names, IDs, or JSON aloud.
- Never invent facts, prices, or policy. If the prompt or a tool result doesn't say it, offer to check or to transfer.
- Say what to do when the caller is silent, off topic, abusive, or asks for a person.
What we do add, only when you turn it on: results from pre-call tools, a
one-line hint when keypad collection is enabled, your
wait_instruction,
and guardrail rules in some deployments.
Name tools exactly
The model sees each tool by a fixed name. Use that exact name in the prompt.
| Tool | Name the model sees |
|---|---|
| HTTP tool | The tool's slug |
| MCP server tool | <server_slug>__<tool> |
| Built-in tools | end_call, transfer_to_human_warm, transfer_to_human_cold, transfer_to_agent, schedule_call, wait. Labelled entries add __<label>. |
For each tool, say when to call it, what to tell the caller while it runs, and what to do if it fails.
Leave timing to settings, not the prompt
Some problems look like prompt problems but are settings:
| Problem | Use instead |
|---|---|
| The agent cuts in while a caller reads out a number | wait_instruction — the agent holds its turn until the caller finishes |
| The caller says "give me a minute" | The built-in wait tool |
| The first line must be exact, for example a recorded-call disclosure | A fixed greeting. It is spoken word for word and can't contain variables. |
| The greeting should use the caller's name | A generated greeting whose instructions reference {{vars.customer_name}} |
| The agent must never say certain things | Guardrails, in addition to hard_rules |
| Brand names or acronyms sound wrong | Pronunciation tables |
Change a working prompt carefully
- Read the whole current prompt and behavior first.
- If your workspace has strong agents already, match their section names and tone.
- Make the smallest change that fixes the problem. Don't rewrite a working prompt for style.
- Run your evals against the draft before you promote it.