Concept
A read-back can fail at three points.
Secrets are a fourth case. Never read them back. Collect them with
SECURE_INPUT.
Choose how much control you need.
An authored read-back is deterministic. Guidance is an instruction. The model can ignore it.
These settings apply to KoreVG pipeline voice: speech-to-text, then the agent, then text-to-speech. Realtime speech-to-speech calls leave wording to the model provider. See Realtime voice.
Minimal working example
Number_Readback collects a callback number and cleans it to digits. It builds a spoken form with a space between digits, reads it back, and asks for confirmation. A “no” clears the values and asks again.
callback_numberandnumber_confirmedareGATHERfields. The caller supplies both.spoken_numberis a session value. Theprepare_readbackstep sets it.
CLEAR, a “no” would loop back to a field that already holds a value, and the step would not ask again.
How it works
Spaced characters
The expressionTRIM(REGEX_REPLACE(value, "(.)", "$1 ")) puts a space after every character. 12345678 becomes 1 2 3 4 5 6 7 8. AB12CD becomes A B 1 2 C D. REGEX_REPLACE(value, "[^0-9]", "") first strips everything except digits.
The result is plain text. Every engine speaks it the same way, and it works without SSML.
Values by type
SSML say-as
<say-as interpret-as="digits"> tells an SSML engine to speak each digit. Put it in the VOICE block of the RESPOND, and always add PLAIN_TEXT as the fallback.
On the KoreVG pipeline, authored SSML plays only on the Microsoft speech engine in this release. Every other engine drops the markup and speaks PLAIN_TEXT. Write spaced characters in PLAIN_TEXT so the read-back is correct on every engine. See Use SSML and voice-specific response settings.
Delivery of the read-back
- Set
STREAMING: falseon the reply. The platform waits for the whole reply, so the caller hears the value as one unit. - Leave barge-in on. The caller must be able to interrupt with a correction.
- Use
BARGE_IN: disallowonly for text the caller must hear in full, such as a legal notice. See Handle barge-in, pauses, and unclear audio.
Collecting digits and codes
Rules for
DTMF::
- The field must be the only field in its step.
- Keep the minimum at 1. A minimum above 1 holds the pause, so a short entry waits for the finish key or the no-input timeout. The compiler warns.
finishOnKey: "*"at agent level ends every keypad answer, menus included. The compiler warns.- A keypad answer reaches the agent, memory, and transcript like any value. Use
SECURE_INPUTfor secrets. - Each key resolves on its own:
SECURE_INPUT, field, behavior profile, agent, project, platform default. The platform default is 2 seconds between presses,#as the finish key, and 1 to 12 digits.
Confirming
- Confirm step. Read the value, then ask a
booleanquestion. This is the most reliable pattern. Abooleanfield accepts yes, no, ok, sure, and similar answers. - Tool confirmation. A tool with
confirmation: require: alwaysmakes the agent ask before it runs. The platform builds the question from the tool and its parameter values. Override the wording withMESSAGES: tool_confirmation_request. This works on pipeline voice only. - Corrections.
CORRECTIONS: trueon a multi-fieldGATHERstep lets the caller change one value without restarting. The caller hears “Got it, I’ve updated the plate number.” The message never repeats the value. - Guidance.
CONVERSATION.speaking.readbackandCONVERSATION.interaction.confirmationadd lines to the model prompt.
Secrets
SECURE_INPUT collects secrets by keypad or speech and sends them straight to one tool. The model, transcript, session state, logs, recordings, and traces never see the values. Speech recognition is off and recording is paused while the caller enters them.
Do not read a secret back. Read back only a NOT_SECRET field, which you save with SAVE_AS. A NOT_SECRET field with luhn or date_mmYY validation saves card data in the clear, and the compiler warns.
The delivery tool must be an HTTP tool that sends JSON with POST or PUT. Without that, the step takes ON_FAIL. While secure input is active, an escalation is blocked.
Realtime voice
Author a confirm step. Do not rely on the accessibility switches.
Common variations
Read back an authored value with SSML and keypad entry
Reservation_Lookup accepts speech or keypad, speaks the digits one by one, and looks up the reservation after a yes. It stops after three tries.
find_reservation is a project-local tool. It returns whether a reservation exists and the guest name.
reservation_number and number_confirmed are GATHER fields. spoken_number is a session value. reservation is the tool output.
Because 1..8 allows short entries, the read-back is what catches a short number. barge_in: allow lets the caller interrupt the read-back with a correction.
Read back a phone number, an email address, and an amount
Contact_Readback collects three typed values and speaks each in a form that is clear on the phone.
phone, email, and amount are GATHER fields. spoken_phone and spoken_email are session values set in say_back.
This sample reads all three values in one reply. For critical values, add a confirm step as in the first example.
Guide a reasoning agent
For an open conversation, give the model read-back guidance, a confirmation rule for sensitive tools, and grounding guards.place_refill is a project-local tool. Section snippet:
readback,on_unclear_audio,confirmation, andrepairvalues are free text. The platform turns underscores into spaces and adds a line such as “Read back numbers using digit by digit.” The compiler does not check the values, so a typo has no effect.EXECUTION.voice.instructionsreplaces the platform voice formatting rules. Restate “plain speech, no lists” in your text.tool_argumentsrefuses a tool call whose arguments cannot be traced to a tool result or a session value.reply_figuresdrops a spoken figure that no tool result or session value supports. Both apply to voice channels only. See Write voice-friendly agent responses.- The confirmation question lists each parameter as a labeled line. The platform strips list markers before speech.
Collect a card number without reading it back
Card_Payment collects a card number by keypad and sends it straight to a payment tool. The agent never sees the number.
charge_card must be an HTTP tool in your project that sends a JSON body with POST or PUT and has no query parameters. The TOOLS line is the signature only.
card_number is a secret field. Only charge_card reads it, as {{secure.card_number}}. consent is a readable field saved as payment_consent.
- Each outcome route takes a step name only. Put the spoken response in the step it names.
- Add
RECORD: trueto a readable field only when the call recording may hold the answer. The caller can say anything while that field is asked. - A secret field cannot set
MODE,RECORD, orSPEECH_AS. That is a compile error.
Verification
- Run each example through project validation. Fix every error. Read every warning.
- Place a test call. Say a number with a pause in the middle. Check that the agent waits, then reads back the full number one digit at a time.
- Answer “no”. Check that the agent clears the value and asks again, and that it stops after the attempt limit.
- Enter digits on the keypad. Check that the read-back matches what you pressed.
- Interrupt the read-back with a correction. Check that the agent accepts it.
- Compare the transcript with the audio. The transcript shows the spaced digits. The audio speaks them one by one.
- For
SECURE_INPUT, check that the transcript shows the outcome only, such as “Secure keypad entry: completed”. The card number must appear nowhere. - On an engine without SSML, confirm that the call speaks
PLAIN_TEXT.
Production readiness checklist
- Every value that triggers an action has a confirm step or tool confirmation.
- Every confirm loop has an attempt limit and an exit.
PLAIN_TEXTcarries the spaced form, so the read-back is correct on every engine.- Every secret uses
SECURE_INPUT. No secret appears in a prompt, aRESPOND, or aGATHERfield. - The
SECURE_INPUTdelivery tool is an HTTP tool withPOSTorPUT. You tested theON_FAILandON_TIMEOUTroutes. - Keypad defaults keep the minimum at 1 and avoid
*as the finish key. - You tested numbers with leading zeros, letters, and a mid-number pause.