Skip to main content

What is SMS Testing?

SMS testing allows you to test scenarios where your voice agent sends or receives text messages during phone calls. This is useful for testing:
  • OTP (One-Time Password) verification
  • Sending confirmation codes or links
  • Receiving information via text during a call
  • Multi-channel communication workflows

How SMS Testing Works

Two-Way SMS Communication

During a test call: Testing Agent (Evaluator) can:
  • Send SMS to the main agent
  • Receive SMS from the main agent
Main Agent can:
  • Receive SMS from the testing agent during the call
  • Send SMS to the testing agent
Important: SMS messages are matched to the active test by sender. The agent’s own number always matches; if your agent texts from a different sender (a short code, an alphanumeric sender ID or a separate messaging number), add it to the agent’s sms_senders setting. See SMS Filtering.

Enabling the Send SMS Tool

To enable SMS functionality for your testing agents:
1

Access Evaluators

Click on the Evaluators tab and select the evaluator you want to configure.
2

Enable Send SMS Tool

Scroll to the Tools section, find Send SMS in the list of available tools, and toggle the switch to enable it.
SMS Tool Configuration

Available Testing Tools

When configuring your evaluator, you have access to these tools:

Example: OTP Verification

Here’s a simple example of testing an agent that sends verification codes via SMS. Evaluator Instructions:
Test Flow:
  1. Testing agent calls and requests to update policy
  2. Main agent says: “I’ll send you a verification code”
  3. Main agent sends SMS with OTP code
  4. Testing agent receives the SMS and reads the code
  5. Main agent verifies the code and proceeds

How SMS Appears in Transcripts

When an SMS is sent during the call, it appears in the transcript as a Function Call:
SMS in Transcript
As shown above:
  • The Function Call section shows send_sms with the message content
  • The Function Call Result confirms the SMS was sent
  • This helps you track all SMS activity during the test

How Main Agents Handle SMS

Receiving SMS

When your main agent receives an SMS during a call, the message is automatically:
  1. Injected into the LLM context as: [User SMS]: <message content>
  2. Added to the transcript for your review
  3. Available for the agent to use in its response

Sending SMS

Your main agent can send SMS when configured with SMS capabilities. The SMS will appear in the transcript as a function call, just like in the example above.
Best Practice: SMS should only be sent when explicitly needed (verification codes, links, critical information). Don’t send SMS for regular conversation responses.

SMS Filtering

SMS messages are only delivered to the active call when:
  1. Sent to/from the call’s phone number, or from one of the agent’s sms_senders
  2. There’s an active call session
  3. The direction is correct (user ↔ agent)
This ensures SMS messages are correctly associated with ongoing calls and don’t interfere with other tests.

Senders Other Than the Agent’s Number

OTP codes and links are often sent from a short code, an alphanumeric sender ID or a separate messaging number rather than the agent’s own number. Set sms_senders on the agent (telephony.sms_senders in the v2 agent API) so these messages reach the test:
  • E.164 phone numbers, for example +14155550000
  • Short codes of 3–8 digits, for example 72345
  • Alphanumeric sender IDs of up to 11 characters
  • At most 20 entries; invalid entries are rejected with a 400 error
For text-only SMS tests, replies are read from any listed sender as well as the agent’s own number.
When several tests of the same agent run at once on one testing number, an SMS from a listed sender can’t be tied to a particular test. Use the different_numbers mode for OTP tests.

Best Practices

1. Enable Selectively

Only enable the Send SMS tool for evaluators that need to test SMS functionality.

2. Clear Instructions

Be explicit about SMS expectations in your evaluator instructions:

3. Validate Content

Use metrics to verify SMS messages contain correct information (codes, links, data).

4. Check Transcripts

Review the Function Call sections in transcripts to confirm SMS was sent/received correctly.

Next Steps