For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

6. Add Escalation and Safety

Configure caller verification, call forwarding, a safe-exit line, and an escalation path on a test service, then test each one before release.

Use this guide after Verify an Integration Action to give a test service a path to a person and to check the platform's safety behavior on your runtime. It collects settings documented on their owning pages. Follow the links for the full contract.

Prerequisites

Have a configured test service, a synthetic patient record, and permission to update the service. For phone transfers, have a provisioned voice line bound to the service and destination numbers your team controls. Confirm which voice family the service uses: transfers, operator takeover, and several safety controls differ by family.

1. Decide Whether the Workflow Needs the Caller's Record

If the workflow reads patient records, add world_confirm_patient_identity to the Context Graph state that confirms identity, and have that state ask for the caller's full name and date of birth. Until the caller verifies, built-in record reads return verification_required.

If the workflow never needs the record, for example a call to a payer line, set platform_caller_verification: false on the service. See Caller Verification.

2. Configure Forwarding

Add a voice_config.forwarding block to the service. Choose warm_transfer explicitly, then either a fixed forward_to or dynamic mode with approved_destinations. Set fallback_to for the line the safe exit dials. Each number must also be on the allowed_forwarding_numbers list of the voice use case bound to the service, or the save returns 422. Public emergency and N11 short codes are refused as destinations.

Warm transfer is available on the concurrence cascade and gpt_realtime. The other realtime families use cold transfer. See Call Forwarding and Voice Configuration.

3. Author the Escalation Path in the Graph

In each safety-sensitive state, write the escalation conditions, boundary constraints, and a safe fallback for when no person or destination is available. To let the agent take a message when it can't transfer, offer a tool whose write records one, such as world_ticket_create or an integration endpoint declared message. See Safety & Escalation and Endpoint Write Declarations.

On the platform-managed runtime, author the graph's emergency path too: the agent's own reply plays when a caller describes an emergency. On gpt_realtime, review medical_emergency_ending. See Realtime Emergency Script.

4. Test Each Path

Run each case on a test call or simulation and record the transcript and tool calls:

Case
Expected evidence

Record request before verification

The read returns verification_required

Wrong date of birth, then the right one

A failed attempt, then the record loads

Request for a person

forward_call to the configured destination, a recorded message, or how to reach the team

Transfer to an unapproved number

forward_call refuses it without dialing

A claimed booking with no booking write

On voice, the reply is stopped and corrected. On text, a logged hit

A medical emergency, in plain and hinted words

The runtime's documented emergency behavior, and the call stays open

A non-emergency mention of a condition

The workflow continues

Recognition covers a limited set of phrasings and can miss others, so test several. Simulations return dry_run results for tools. Test a live transfer with a test call to a destination your team controls.

5. Plan the Operator Path

If people intervene in live runs, read Operators and Escalation. Operator takeover on phone calls is available on supported platform-managed calls, and the operator APIs are a beta feature a workspace must be enabled for. Define what happens when no operator is available.

Production Differences

A test destination, a synthetic record, and a test call don't establish staffing, carrier behavior, or clinical protocol. Before release, confirm the production destinations, staffing, and escalation owners, and repeat the cases on the production service configuration.

See Runtime Safety for the full control map, and Safety Layers Separate From the Agent Model for why the controls are built this way.


You are here: step 6 of 10 in Learn by Building, Add Escalation and Safety.

Last updated

Was this helpful?