> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to read back numbers, codes, and critical details

[Back to how-to guides](https://koreai.mintlify.site/agent-platform/abl/how-to/overview.md#voice-and-realtime-conversations)

Use this pattern when a voice agent must confirm an account number, a code, an amount, or any detail the caller cannot check on a screen.

## Concept

A read-back can fail at three points.

| Stage | Risk | What you use |
| - | - | - |
| Collect | The recognizer mishears. | Typed fields, `DTMF:` keypad entry, `ASR:` word lists, patient turn detection. |
| Say | The speech engine reads `12345678` as one large number. | Spaced characters, `PLAIN_TEXT`, SSML `say-as`, read-back guidance. |
| Confirm | The caller cannot see the value. | A confirm step, tool confirmation, correction handling. |

Secrets are a fourth case. Never read them back. Collect them with `SECURE_INPUT`.

Choose how much control you need.

| Approach | Behavior | Use for |
| - | - | - |
| Authored read-back in a `REASONING: false` FLOW step | The platform speaks the exact text you write. | Account numbers, codes, amounts. |
| Guided read-back for a reasoning agent | The model reads the value back. You give it guidance and guards. | Low-risk details in open conversation. |

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](#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.

```abl theme={null}
AGENT: Number_Readback

GOAL: "Collect a callback number, read it back, and confirm it."

PERSONA: "You are a concise phone assistant."

MEMORY:
  session:
    - spoken_number
      TYPE: string
      DESCRIPTION: "The callback number with a space between digits, for speech."

FLOW:
  entry_point: ask_number
  steps:
    - ask_number
    - prepare_readback
    - confirm_number
    - route_confirmation
    - reset_number
    - done

  ask_number:
    REASONING: false
    GATHER:
      - callback_number: required
        type: string
        prompt: "What number should we call you back on?"
    THEN: prepare_readback

  prepare_readback:
    REASONING: false
    SET:
      callback_number = REGEX_REPLACE(callback_number, "[^0-9]", "")
      spoken_number = TRIM(REGEX_REPLACE(callback_number, "(.)", "$1 "))
    THEN: confirm_number

  confirm_number:
    REASONING: false
    RESPOND: "I heard {{spoken_number}}."
    GATHER:
      - number_confirmed: required
        type: boolean
        prompt: "Is that correct?"
    THEN: route_confirmation

  route_confirmation:
    REASONING: false
    ON_RESULT:
      - IF: number_confirmed == true
        THEN: done
      - ELSE:
        THEN: reset_number

  reset_number:
    REASONING: false
    CLEAR: [callback_number, spoken_number, number_confirmed]
    THEN: ask_number

  done:
    REASONING: false
    RESPOND: "Thank you. We will call you back on {{spoken_number}}."
    THEN: COMPLETE
```

Variable sources:

* `callback_number` and `number_confirmed` are `GATHER` fields. The caller supplies both.
* `spoken_number` is a session value. The `prepare_readback` step sets it.

Without `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 expression `TRIM(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

| Value | The platform stores | Say it by |
| - | - | - |
| Account or reservation number (`string`) | The text as heard or typed. | Strip non-digits, then space the digits. |
| `phone` | E.164, such as `+14155550100`. | Strip non-digits, then space the digits. |
| `currency` | A number. The symbol and code are dropped. | Add the unit in your text: `{{amount}} dollars`. |
| `date` | An ISO date, such as `2025-12-15`. | Write `{{date}}`. The platform speaks an ISO date as `15 December 2025`. Month names are English. |
| `email` | Lowercase address. | `REPLACE(REPLACE(email, "@", " at "), ".", " dot ")` |

### 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](https://koreai.mintlify.site/agent-platform/abl/how-to/use-ssml-and-voice-settings).

### Delivery of the read-back

* Set `STREAMING: false` on 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: disallow` only for text the caller must hear in full, such as a legal notice. See [Handle barge-in, pauses, and unclear audio](https://koreai.mintlify.site/agent-platform/abl/how-to/handle-voice-turn-taking).

### Collecting digits and codes

| Need | Setting |
| - | - |
| Let the caller type digits | `DTMF:` on the field, for example `{ digits: 1..8, finishOnKey: "#" }`. The caller can still speak. |
| Wait through long dictation | `TURN_DETECTION` with `eou_threshold` 0.8. Use 0.9 for spelling. |
| Recognize known words | `ASR:` with a `vocabulary` word list. |
| Default keypad grouping for every question | `CONVERSATION.listening.dtmf`. |

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_INPUT` for 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 `boolean` question. This is the most reliable pattern. A `boolean` field accepts yes, no, ok, sure, and similar answers.
* **Tool confirmation.** A tool with `confirmation: require: always` makes the agent ask before it runs. The platform builds the question from the tool and its parameter values. Override the wording with `MESSAGES: tool_confirmation_request`. This works on pipeline voice only.
* **Corrections.** `CORRECTIONS: true` on a multi-field `GATHER` step 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.readback` and `CONVERSATION.interaction.confirmation` add 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

| Setting | Realtime speech-to-speech |
| - | - |
| Authored `RESPOND` text | The provider receives the runtime reply to speak. In coordinator mode it is told to speak the reply as returned. Test the exact wording on your provider. |
| `DTMF:` and `ASR:` field settings | Not applied. The call keeps its normal settings. |
| Tool `confirmation` wording | Not used. The model provider owns approval. |
| `coordinator_policy.accessibility.confirm_critical_values`, `spell_sensitive_values` | These add a line to the coordinator prompt. They do not run a confirmation. |

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.

```abl theme={null}
AGENT: Reservation_Lookup

GOAL: "Collect a reservation number by voice or keypad, read it back, and look up the reservation."

PERSONA: "You are a concise phone assistant for a hotel."

TOOLS:
  find_reservation(reservation_number: string = null) -> {found: boolean, guest_name: string}
    description: "Looks up a reservation by its eight digit number."
    confirm: never

MEMORY:
  session:
    - spoken_number
      TYPE: string
      DESCRIPTION: "The reservation number with a space between digits, for speech."

CONVERSATION:
  listening:
    barge_in: allow

FLOW:
  entry_point: ask_number
  steps:
    - ask_number
    - prepare_readback
    - confirm_number
    - route_confirmation
    - reset_number
    - lookup
    - too_many_tries

  ask_number:
    REASONING: false
    MAX_ATTEMPTS: 3
    ON_EXHAUSTED: too_many_tries
    VOICE:
      TURN_DETECTION:
        enabled: true
        eou_threshold: 0.8
    GATHER:
      - reservation_number: required
        type: string
        prompt: "Please say or enter your eight digit reservation number."
        DTMF: { digits: 1..8, finishOnKey: "#" }
    THEN: prepare_readback

  prepare_readback:
    REASONING: false
    SET:
      reservation_number = REGEX_REPLACE(reservation_number, "[^0-9]", "")
      spoken_number = TRIM(REGEX_REPLACE(reservation_number, "(.)", "$1 "))
    THEN: confirm_number

  confirm_number:
    REASONING: false
    RESPOND: "I heard {{spoken_number}}."
      VOICE:
        STREAMING: false
        SSML: |
          <speak>I heard <say-as interpret-as="digits">{{reservation_number}}</say-as>.</speak>
        PLAIN_TEXT: "I heard {{spoken_number}}."
    GATHER:
      - number_confirmed: required
        type: boolean
        prompt: "Is that correct?"
    THEN: route_confirmation

  route_confirmation:
    REASONING: false
    ON_RESULT:
      - IF: number_confirmed == true
        THEN: lookup
      - ELSE:
        THEN: reset_number

  reset_number:
    REASONING: false
    CLEAR: [reservation_number, spoken_number, number_confirmed]
    THEN: ask_number

  lookup:
    REASONING: false
    CALL: find_reservation
      WITH:
        reservation_number: reservation_number
      AS: reservation
    ON_RESULT:
      - IF: reservation.found == true
        RESPOND: "I found the reservation for {{reservation.guest_name}}."
        THEN: COMPLETE
      - ELSE:
        RESPOND: "I could not find that reservation."
        THEN: reset_number

  too_many_tries:
    REASONING: false
    RESPOND: "I could not confirm the number. Please call back when you have it."
    THEN: COMPLETE
```

Variable sources: `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.

```abl theme={null}
AGENT: Contact_Readback

GOAL: "Collect a phone number, an email address, and an amount, and read each one back."

PERSONA: "You are a concise phone assistant for a billing team."

MEMORY:
  session:
    - spoken_phone
      TYPE: string
      DESCRIPTION: "The phone number with a space between digits, for speech."
    - spoken_email
      TYPE: string
      DESCRIPTION: "The email address with at and dot spelled out, for speech."

FLOW:
  entry_point: collect
  steps:
    - collect
    - say_back

  collect:
    REASONING: false
    GATHER:
      FIELDS:
        - phone: required
          type: phone
          prompt: "What phone number can we reach you on?"
        - email: required
          type: email
          prompt: "What email address should we use?"
        - amount: required
          type: currency
          prompt: "How much would you like to pay?"
    THEN: say_back

  say_back:
    REASONING: false
    SET:
      spoken_phone = TRIM(REGEX_REPLACE(REGEX_REPLACE(phone, "[^0-9]", ""), "(.)", "$1 "))
      spoken_email = REPLACE(REPLACE(email, "@", " at "), ".", " dot ")
    RESPOND: "I have the phone number {{spoken_phone}}, the email {{spoken_email}}, and an amount of {{amount}} dollars."
    THEN: COMPLETE
```

Variable sources: `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:

```abl theme={null}
TOOLS:
  place_refill(prescription_number: string = null, pickup_date: string = null) -> {order_id: string}
    description: "Place a refill order in the pharmacy system."
    confirmation:
      require: always
      consent_action: "place the refill"

EXECUTION:
  voice:
    instructions: "Speak in plain sentences. No lists. Read numbers one digit at a time. Spell codes one character at a time."
    grounding_guards:
      tool_arguments: true
      reply_figures: true

CONVERSATION:
  speaking:
    readback:
      numbers: digit_by_digit
      codes: character_by_character
      critical_details: always_confirm
  listening:
    barge_in: allow
    on_unclear_audio: ask_to_repeat_or_confirm
  interaction:
    confirmation:
      parameters: always
      actions: before_sensitive_actions
    repair:
      on_correction: confirm_and_update
      on_misheard: confirm_what_you_heard
      max_attempts: 2

MESSAGES:
  tool_confirmation_request: "Before I continue{{action_suffix}}, please check these details.{{details}} Is that correct?"
```

* `readback`, `on_unclear_audio`, `confirmation`, and `repair` values 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.instructions` replaces the platform voice formatting rules. Restate "plain speech, no lists" in your text.
* `tool_arguments` refuses a tool call whose arguments cannot be traced to a tool result or a session value. `reply_figures` drops a spoken figure that no tool result or session value supports. Both apply to voice channels only. See [Write voice-friendly agent responses](https://koreai.mintlify.site/agent-platform/abl/how-to/write-voice-friendly-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.

```abl theme={null}
AGENT: Card_Payment

GOAL: "Take a card payment by phone without exposing the card number to the model, transcript, or logs."

PERSONA: "You are a concise phone assistant for a utility company."

TOOLS:
  charge_card(pan: string = null, consent: string = null) -> {approved: boolean, receipt: string}
    description: "Charges the card through the payment processor."
    confirm: never

FLOW:
  entry_point: collect_card
  steps:
    - collect_card
    - payment_done
    - payment_declined
    - payment_cancelled
    - hand_to_agent

  collect_card:
    REASONING: false
    SECURE_INPUT:
      MODE: [dtmf]
      FIELDS:
        - card_number:
            PROMPT: { en: "Enter your card number, then press pound." }
            COLLECT: { digits: 13..19, finishOnKey: "#" }
            VALIDATE: [ luhn ]
        - consent:
            PROMPT: { en: "Say yes or press 1 to confirm the payment." }
            COLLECT: { digits: 1..1 }
            NOT_SECRET: true
            SAVE_AS: payment_consent
            MODE: [dtmf, speech]
            VALIDATE: [ { regex: "^(1|yes|yeah)( |$)" } ]
      CALL charge_card WITH: { pan: "{{secure.card_number}}", consent: "{{payment_consent}}" }
      ON_SUCCESS: payment_done
      ON_FAIL: payment_declined
      ON_TIMEOUT: hand_to_agent
      ON_CANCEL: payment_cancelled

  payment_done:
    REASONING: false
    RESPOND: "Your payment is complete. Thank you."
    THEN: COMPLETE

  payment_declined:
    REASONING: false
    RESPOND: "The payment was not approved. Please try another card."
    THEN: COMPLETE

  payment_cancelled:
    REASONING: false
    RESPOND: "I cancelled the payment."
    THEN: COMPLETE

  hand_to_agent:
    REASONING: false
    RESPOND: "I could not collect the card details. Please call back."
    THEN: COMPLETE
```

Variable sources: `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: true` to 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`, or `SPEECH_AS`. That is a compile error.

## Verification

1. Run each example through project validation. Fix every error. Read every warning.
2. 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.
3. Answer "no". Check that the agent clears the value and asks again, and that it stops after the attempt limit.
4. Enter digits on the keypad. Check that the read-back matches what you pressed.
5. Interrupt the read-back with a correction. Check that the agent accepts it.
6. Compare the transcript with the audio. The transcript shows the spaced digits. The audio speaks them one by one.
7. For `SECURE_INPUT`, check that the transcript shows the outcome only, such as "Secure keypad entry: completed". The card number must appear nowhere.
8. 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_TEXT` carries the spaced form, so the read-back is correct on every engine.
* Every secret uses `SECURE_INPUT`. No secret appears in a prompt, a `RESPOND`, or a `GATHER` field.
* The `SECURE_INPUT` delivery tool is an HTTP tool with `POST` or `PUT`. You tested the `ON_FAIL` and `ON_TIMEOUT` routes.
* 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.

## Common mistakes

| Mistake | Why it happens | How to avoid it |
| - | - | - |
| Reading `{{account_number}}` as plain text | The engine reads it as one number. | Space the characters in `PLAIN_TEXT` and in the reply text. |
| Relying on SSML alone | The reference lists several SSML engines. | On KoreVG pipeline voice only Microsoft plays it. Always add `PLAIN_TEXT`. |
| Re-entering a confirm loop without `CLEAR` | A gathered field already has a value. | Clear the value and the confirm field before the re-ask. |
| Reading `{{amount}}` with no unit | `currency` drops the symbol. | Add "dollars" or your currency in the text. |
| Setting `digits: 8..8` on a keypad field | The range looks exact. | The compiler warns that a short entry waits. Use `1..8` and read back. |
| Using `DTMF:` for a PIN | `DTMF:` looks like keypad capture. | A `DTMF:` value reaches the model and transcript. Use `SECURE_INPUT`. |
| Putting a response under `ON_SUCCESS` of `SECURE_INPUT` | Other blocks accept it. | Route to a step and put the `RESPOND` there. |
| Expecting `readback` to change an authored `RESPOND` | The key name suggests it. | `readback` guides model-written replies only. |
| Trusting a typo in `readback` or `confirmation` values | The values are free text. | The compiler cannot check them. Test the prompt line in the trace. |
| Using `coordinator_policy.accessibility` to confirm values | The names suggest a confirmation. | They add a prompt line only. Author a confirm step. |

## Troubleshooting

| Symptom | Likely cause | What to check |
| - | - | - |
| The agent says "twelve million..." | The digits are not spaced. | The `SET` expression and `PLAIN_TEXT`. |
| SSML tags are read aloud or ignored | The engine does not play SSML. | The channel's speech engine. Use `PLAIN_TEXT`. |
| The agent skips the confirm question | The confirm field already has a value. | A `CLEAR` step before the loop. |
| The caller says "yes" and the loop repeats | The `boolean` field did not store `true`. | The field type and the `ON_RESULT` condition. |
| Short keypad entries hang | The minimum digits is above 1. | `GATHER_DTMF_MIN_DIGITS_HOLDS_PAUSE` and the no-input timeout. |
| Every keypad answer ends early | `finishOnKey` is `*` at agent level. | `LISTENING_FINISH_KEY_STAR`. |
| `SECURE_INPUT` goes to `ON_FAIL` at once | The delivery tool has no HTTP binding, or sends query parameters. | The tool definition in your project. |
| An escalation does nothing during card entry | Secure input blocks escalation. | Route to escalation after the secure step. |
| The date is read as numbers | The platform converts only a plain ISO date. It skips a date that touches letters, digits, or some punctuation, or that carries a time. | Write `{{date}}` as its own word. |

## Related HowTos

* [Handle barge-in, pauses, and unclear audio](https://koreai.mintlify.site/agent-platform/abl/how-to/handle-voice-turn-taking)
* [Use SSML and voice-specific response settings](https://koreai.mintlify.site/agent-platform/abl/how-to/use-ssml-and-voice-settings)
* [Write voice-friendly agent responses](https://koreai.mintlify.site/agent-platform/abl/how-to/write-voice-friendly-responses)
* [Collect sensitive or PII fields safely](https://koreai.mintlify.site/agent-platform/abl/how-to/collect-sensitive-pii-fields)
* [Confirm inferred values before using them](https://koreai.mintlify.site/agent-platform/abl/how-to/confirm-inferred-values)
* [Define fallback behavior for voice failures](https://koreai.mintlify.site/agent-platform/abl/how-to/define-voice-fallbacks)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.