Prompting guide
Write reliable GPT Realtime 2 voice-agent prompts across Stellar's personality, dialogue states, transitions, actions, and guardrails. This guide combines OpenAI's Realtime prompting guidance with anonymized, lightly edited production examples.
Start with Stellar's prompt structure
Stellar assembles instructions from several parts of the agent configuration. Put each rule in the narrowest place where it remains true.
| Configuration | Use it for | When it applies |
|---|---|---|
| Personality | Identity, role, language policy, accent, tone, pacing, conversation style, preambles, unclear audio, and other global behavior | Throughout the conversation |
| General knowledge | Reference facts the agent may need to quote or use | Throughout the conversation |
| Guardrails | Hard safety and compliance boundaries | Throughout the conversation |
| State instructions | The ordered steps for one phase of the conversation | While that state is active |
| Transition conditions | The exact circumstances for moving to another state | While the source state is active |
| Action descriptions and parameters | What an action does, when it is appropriate, and the exact data it accepts | When the action is available |
With strict state separation, only the current state's instructions, actions, and reachable transitions are active. Repeat state-specific rules where needed; move genuinely global behavior to the personality.
Place rules by scope
For an agent that must stay concise, authenticate callers, and retrieve transactions:
- Put the concise speaking style in Personality.
- Put the authentication sequence in the Authentication state's instructions.
- Put the trigger and input requirements for retrieving transactions in the action's Description and parameter schema.
- Put the transition to account support after successful authentication in the state's Transitions.
Do not copy the entire workflow into the personality. Repeated flow logic creates conflicts.
Keep instructions and reference facts separate
Put behavior in the personality or states. Put policies, opening hours, and product facts in General knowledge or the knowledge base. Keep routing and action sequences in states so the next step never depends on retrieving a document.
Write instructions the model can execute
Use short, labeled sections. Write observable behavior with a trigger, action, and exception:
When the caller asks about a specific order, collect the order number and postcode one at a time. Call `authenticate_order` as soon as both values are clear. Do not read them back because the action validates them and fails closed when they do not match.
Use always, never, only, and must only for genuine constraints. Replace "always confirm before doing anything" with a scoped rule such as: "Before an action changes customer data, summarize the change and ask for confirmation."
Start small. Add rules for failures found in tests. Every line should control behavior that matters.
Write the personality
The Personality field is the only user-authored behavior block active in every state. Use it for global voice behavior, not workflows.
A useful structure is:
## Identity and role
## Language
## Accent
## Context
## Tone
## Conversation style
## Preambles
## Unclear audio
## Silence and background noise
## Spelled characters and spoken numbers
## Reasoning
Drop sections your use case does not need. Keep business logic and step-by-step workflows in states.
Define a bounded role
State who the agent represents, what it owns, and what is out of scope.
- English
- Dutch
## Identity and role
- You are Emma, a customer service representative for Meridian Bank.
- Help callers with card and transaction questions after they have been authenticated.
- Use live account information returned by actions. Never guess balances, transaction details, eligibility, or processing times.
- Connect the caller to a representative when their request requires access or authority you do not have.
## Rol en doel
- Je bent Sam, klantenservicemedewerker van Novamarkt.
- Bepaal wie de klant het beste kan helpen: een Novamarkt-medewerker of een verkooppartner.
- Gebruik alleen de minimale informatie die nodig is om de klant correct te routeren.
- Beantwoord geen inhoudelijke productvragen en geef geen advies.
- Stuur algemene vragen zonder specifieke bestelling direct door naar een medewerker.
Separate language from accent
Language controls the words; accent controls delivery. Keep them separate so accents, names, filler, or isolated foreign words do not switch language. For most support agents, switch only on an explicit request.
- English
- Dutch
## Language
British English is the response language.
- Do not infer language from accent alone.
- Ignore filler sounds, short confirmations, names, addresses, and isolated foreign words.
- Switch languages only when the caller explicitly asks.
- Keep preambles, action updates, and final answers in the active conversation language.
## Accent
Speak English with a standard British accent.
- Keep the accent stable throughout the call.
- Use natural British pronunciation without exaggerating it.
- Speak at a moderate conversational pace.
- Accent adaptation must not change the response language.
## Taal
Nederlands is de gesprekstaal.
- Leid de taal niet af uit een accent.
- Negeer opvulwoorden, korte bevestigingen, namen, adressen en losse buitenlandse woorden.
- Wissel alleen van taal als de beller daar expliciet om vraagt.
- Houd preambles, meldingen rond acties en het uiteindelijke antwoord in de actieve gesprekstaal.
## Accent
Spreek Nederlands met een Nederlands accent.
- Houd het accent het hele gesprek stabiel.
- Gebruik een natuurlijke uitspraak zonder het accent te overdrijven.
- Spreek in een rustig gesprekstempo.
- Een ander accent is nooit een reden om van taal te wisselen.
Configure Default transcription language and Allowed languages for language switching in Settings. Voice selection does not control language or accent.
Make tone and pacing concrete
Specify response length, questions per turn, and behavior when callers are rushed, confused, or frustrated.
## Tone and conversation style
- Sound warm, calm, and capable. Do not sound ceremonial or overly apologetic.
- Use short sentences and natural pauses.
- Ask one clear question at a time.
- Direct answers use one or two short sentences.
- Briefly acknowledge frustration before moving to the next useful step.
- Do not repeat or paraphrase the caller's reason for calling unless confirmation would resolve a real ambiguity.
Prefer concrete rules over lists of adjectives.
Steer when the model reasons
GPT Realtime 2 can think before it speaks. Reasoning improves multi-step decisions but adds a pause the caller can hear, so state when it is worth it and when it is not. Pair longer reasoning with a preamble so the pause does not read as silence.
- English
- Dutch
## Reasoning
- For direct answers, simple lookups, and short confirmations, respond quickly and do not reason.
- For multi-step tasks, tool decisions, troubleshooting, or escalation, reason before acting.
- Do not perform extended reasoning when the caller's audio is unclear. Ask for clarification instead.
## Redeneren
- Reageer bij directe vragen, korte bevestigingen of eenvoudige opzoekacties direct, zonder te redeneren.
- Redeneer eerst bij meerstapstaken, toolkeuzes of escalaties, bijvoorbeeld bij verificatie of het bepalen van wie het verzoek moet oppakken.
- Redeneer nooit als het geluid onduidelijk is. Vraag dan eerst om verduidelijking.
Control spoken updates and preambles
Use a short spoken preamble before noticeable reasoning or actions to avoid awkward silence and explain what is happening.
| Situation | Recommended behavior |
|---|---|
| A noticeable lookup or multi-step operation | Give a short, action-specific preamble |
| A transfer or consequential update | Explain what will happen and why |
| A quick authentication call | A neutral phrase such as "One moment" can be enough |
| A state transition, topic update, or language update | Stay silent |
| Background logging or transcript recovery | Stay silent |
| A direct answer or clarification question | Answer or ask directly |
Define the global policy in the personality. Put action-specific wording next to the relevant call in the state instructions. For a silent action, say so explicitly.
- English
- Dutch
## Preambles
- Use a preamble when a lookup or change may create a noticeable pause.
- Keep it to one short sentence and describe the action, not your reasoning.
- Before authentication: "One moment, I'll look up your details."
- Before retrieving transactions: "I'll check those transactions for you now."
- Before a transfer: explain which team can help and that you are connecting the caller.
- Do not announce state transitions, topic updates, language updates, or background logging.
- After an action succeeds, go directly to the result. Do not announce the action a second time.
## Preambles
- Gebruik een preamble als een zoekactie of wijziging een merkbare pauze kan veroorzaken.
- Houd het bij één korte zin en beschrijf de handeling, niet je interne redenering.
- Voor authenticatie: "Een momentje, ik zoek je gegevens erbij."
- Voor een bestelling: "Ik zoek die bestelling even op."
- Voor een overdracht: leg uit welk team kan helpen en dat je de beller doorverbindt.
- Kondig state-transities, onderwerpupdates, taalwissels en achtergrondregistratie niet aan.
- Ga na een geslaagde actie direct door met het resultaat. Kondig de actie niet opnieuw aan.
If wording repeats, search the personality and state instructions for the phrase. Realtime models often mirror nearby vocabulary.
Handle voice-specific failures
Define behavior for silence, clipped speech, background conversations, and similar-sounding characters before they enter a workflow.
Unclear audio
Tell the model to clarify instead of guessing or calling an action with a partial value.
## Unclear audio
- Act only on audio you understand with confidence.
- If speech is clipped, noisy, ambiguous, or unintelligible, ask one short clarification question.
- Say what part is missing when possible: "I heard only part of the order number. Could you repeat it digit by digit?"
- Do not infer missing words, call actions, transition states, or give a preamble while the audio is unclear.
- Vary the clarification wording instead of repeating the same sentence.
Silence and background noise
If background audio produces a turn, briefly say you could not hear the caller and resume only when they address the agent.
Spelled characters and spoken numbers
Define normalization explicitly:
## Spelled characters and spoken numbers
- Treat a spelled ID, code, or email as one compact value.
- Preserve an explicitly spoken dash, dot, underscore, slash, or plus sign. Do not invent separators.
- "A B C one two three" becomes "ABC123".
- "B C dash nine eight seven" becomes "BC-987".
- Convert clearly spoken digits into the format expected by the action.
- If more than one interpretation is plausible, ask the caller to repeat the value digit by digit.
Write state instructions as a procedure
A state owns one conversation phase. Order its instructions so the next step is obvious:
Use a consistent internal order:
## Goal
## Steps
## Decision rules
## Action behavior
## Transition or exit
## Do not
The headings are optional; the sequence is not.
Greeting state
Give the exact opening phrase, wait, and define what must be known before routing. Keep business logic in later states.
- English
- Dutch
- Open with exactly: "Hi, this is Emma, Meridian Bank's virtual assistant. What are you calling about?"
- Wait for the caller to answer before saying anything else.
- If the subject is unclear, ask one short question to clarify it.
- Do not repeat the caller's topic back at length.
- Once the topic is clear, acknowledge it briefly and transition silently to the matching state.
## Stappen
1. Open met exact: "Hoi! Je spreekt met Sam, de virtuele assistent van Novamarkt. Waar bel je voor?"
2. Zeg daarna niets en wacht tot de klant kort uitlegt waarom die belt.
3. Vraag om verduidelijking als het onderwerp nog niet duidelijk is.
4. Gaat het om een specifieke bestelling, ga dan stil door naar `Bestelling identificeren`.
5. Gaat het om een algemene vraag, ga dan stil door naar `Doorverbinden naar medewerker`.
## Beslisregels
- Ga pas naar de volgende state als duidelijk is waarvoor de klant belt.
- Verzamel in deze state nog geen bestelnummer, postcode of contactgegevens.
Transition conditions
Write complete, testable conditions with intent and prerequisites.
The caller asks about transactions on their own account and authentication has succeeded.
Avoid:
Go to transactions.
Do not describe the mechanics of transitioning in spoken instructions. State transitions are internal and should normally be silent.
Handover state
Announce why before handover. Order bookkeeping exactly, mark silent actions, and prevent a second transfer announcement.
- English
- Dutch
1. Explain that a representative is best placed to help with this request and that you will connect the caller.
2. Call `create_support_ticket` without a preamble.
3. Immediately call `transfer_to_representative` without another announcement.
4. After the transfer succeeds, do not say that you are going to transfer the caller again. Say that they are in the queue and share the expected wait if available.
1. Leg kort uit waarom het specialistische team de klant het beste kan helpen en zeg dat je de klant doorverbindt.
2. Zoek de beller zonder preamble op in het CRM met het telefoonnummer uit de gesprekscontext. Vraag niet opnieuw om gegevens die al beschikbaar zijn.
3. Registreer het gesprek zonder preamble.
4. Roep daarna `transfer_to_representative` aan zonder tweede aankondiging.
5. Vertel na een geslaagde overdracht alleen dat de klant in de wachtrij staat en deel de wachttijd als die bekend is.
The handover action has its own fallback configuration for a failed transfer. Keep normal state instructions focused on the expected flow unless your use case requires additional in-state recovery.
Design actions for reliable tool use
The model uses an action's name, description, and parameter schema. Vague configuration produces vague tool behavior.
Describe when and why to call the action
Use a verb-first name and a description that covers the trigger, result, and prerequisites.
Name: get_order_status
Description: Retrieves the current delivery status, expected delivery date, and tracking number for one order. Use when the caller asks where a specific order is or when it will arrive. Requires a validated order number.
Constrain every parameter you can
Use the most specific JSON Schema type, format, enum, or pattern available. State the expected format and give a realistic example.
{
"type": "object",
"properties": {
"order_number": {
"type": "string",
"pattern": "^ORD-[0-9]{6}$",
"description": "Order number in ORD-123456 format"
},
"postcode": {
"type": "string",
"description": "Delivery postcode, normalized without leading or trailing spaces, e.g. SW1A 1AA"
}
},
"required": ["order_number", "postcode"]
}
Let Stellar send the resulting parameters as query parameters or a flat JSON body. Add a request body template only when the API requires a different nested shape.
Define failure behavior near the call
Do not repeatedly call an action with identical arguments. Decide whether a failure means the caller should correct a value, the agent should retry once, or the conversation should take an alternate path.
- If `get_order_status` returns no matching order, do not expose raw error details.
- Ask the caller to check the order number once.
- Retry only when the caller provides a corrected value.
- If the second lookup fails, offer to connect the caller to order support.
Only say that an operation succeeded after the action reports success.
Use guardrails for monitored boundaries
Guardrails monitor the conversation and can log, steer, transfer, or end it. Use them for boundaries that need an automatic response, such as unauthorized promises, sensitive disclosures, abuse, or immediate human escalation. Write observable violations and choose whether to monitor the agent, caller, or both.
Name: No unauthorized account changes
Type: Agent only
Rules:
- Trigger if the agent says an account change was completed without a successful update action.
- Trigger if the agent offers to bypass authentication or approval requirements.
- Do not trigger when the agent explains that a representative must complete the change.
Action: Nudge agent
Nudge message: "Do not claim the account was changed. Explain the supported next step or offer a transfer."
Keep ordinary flow logic out of guardrails. A rule such as "collect the postcode before the house number" belongs in the authentication state, where it directly controls the next turn.
Capture and confirm exact details
Choose confirmation policy based on the consequence of a wrong value.
| Situation | Confirmation policy |
|---|---|
| A fail-closed authentication action immediately validates the value against the expected customer | Pass the best-heard value without read-back; use the action's retry path |
| A lookup could select another person's record or reveal information | Authenticate appropriately and confirm any value whose error could select the wrong record |
| A value is written to an email, ticket, booking, or record without automatic validation | Read it back once before use |
| An action changes data, makes a purchase, cancels something, or has another material consequence | Confirm the intended action and consequence, even when identifiers were already validated |
Collect one value at a time. Reuse values already in variables or earlier turns.
- English
- Dutch
This production-derived postcode flow is appropriate because the value is forwarded into a collection request without automatic validation:
## Postcode
1. Ask only for the postcode and wait for the caller's answer.
2. If `request_accurate_transcript` is available, use it silently and take the postcode from that transcript.
3. Read the postcode back once. Say letters with the phonetic alphabet and numbers as individual digits.
4. Ask whether it is correct and wait for the answer before asking anything else.
5. If the caller corrects it, accept the replacement, acknowledge it briefly, and continue. Do not read it back or confirm it a second time.
This production-derived authentication flow deliberately avoids read-back because the API validates the details and fails closed:
## Identificatie
- Vraag één gegeven tegelijk: eerst geboortedatum, dan postcode, daarna huisnummer.
- Herhaal de geboortedatum, postcode en het huisnummer niet en vraag niet of ze kloppen.
- Gok nooit bij twijfel. Vraag het onduidelijke gegeven opnieuw.
- Roep `authenticate_by_address` aan zodra je alle drie de gegevens duidelijk hebt gehoord.
- Vertel niet of de lookup wel of geen resultaat gaf.
- Gebruik bij geen match één alternatieve identificatieroute. Vraag gegevens die al bekend zijn niet opnieuw.
Keep validated flows fast, but confirm consequential updates separately.
Avoid common prompt failures
| Symptom | Likely prompt issue | Fix |
|---|---|---|
| The agent sounds robotic before every action | One generic preamble is prescribed globally | Give specific examples for meaningful actions and keep internal actions silent |
| The language switches after a misheard phrase | The language rule reacts to detected language or accent | Switch only on an explicit request and keep accent rules separate |
| The agent asks for several identifiers at once | The state lists fields but not a collection order | Number the fields and say to ask one per turn |
| The agent reads every identifier back | A broad confirmation rule ignores API validation | Separate validated values, unvalidated values, and consequential actions |
| The agent announces a transfer twice | The state says to transfer but not what happens after success | Define the pre-transfer wording and prohibit a second announcement |
| The agent ignores a rule in another state | The rule is scoped to a state that is not active | Repeat it where needed or move genuinely global behavior to the personality |
| The agent calls the wrong action | Names, descriptions, availability, and state instructions disagree | Use one action name consistently and restrict it to the relevant states |
| The agent retries forever | Failure handling has no retry bound or alternate exit | Set a retry count and define the next state or handover |
Iterate with real conversations
Treat prompting as an evaluation loop:
- Start with a small set of representative happy paths and failure paths.
- Test them in the Playground, including unclear audio, interruptions, corrections, and action failures.
- Review the transcript and event feed to identify the first instruction that produced the wrong behavior.
- Change one rule at a time and rerun the same scenarios.
- Add evaluation rules for behavior you need to monitor across production conversations.
Fix the narrow trigger, not with a general prohibition. Repeated exceptions usually mean the rule is too broad or in the wrong section.
Next steps
- Configure personality, language, voice, and transcription
- Build focused states, transitions, and actions
- Test voice behavior in the Playground
- Review outcomes with evaluation rules