← Home

Guide

Two-Way SMS: Text Your AI Agent

SMS is the only channel that already works on every phone ever sold, with no app to install and no account to create. Give your agent a number and people can just text it.

This Is Not the Same as Sending Notifications

There are two different things you can do with a phone number, and they get confused constantly.

One is outbound: your agent sends you a text when something happens — a job finished, a price moved, a server fell over. That is covered in our Twilio notifications guide, it is simpler, and the recipient is not expected to reply.

The other is what this page covers: a conversation. Someone texts the number, the agent reads it, thinks, and answers in the same thread. Both frameworks support this properly — it is a real channel, not a workaround.

What You Need

  • A Twilio account and an SMS-capable phone number, or a Messaging Service.
  • Your Twilio Account SID and Auth Token.
  • A public HTTPS URL that reaches your agent. Twilio delivers incoming texts by calling a webhook, so the agent has to be reachable from the internet.

Twilio trial accounts can only message numbers you have verified in the Twilio console. If your first test text vanishes, check that before anything else.

Setting It Up

On Hermes, the gateway dashboard has a Channels page with an SMS (Twilio) entry — open it, fill in the account SID, auth token and phone number, and save. That writes the configuration for you and is the easiest route.

On OpenClaw, SMS is an official plugin that installs separately, then the channel is configured with the same three Twilio values plus the public URL you are going to give Twilio.

Either way, the last step happens on Twilio's side: open your number's settings, find the messaging section, and point "A message comes in" at your agent's webhook URL using POST. Nothing arrives until that is set.

The URL Has to Match Exactly

This is the single most common failure and it is worth its own heading. Both frameworks verify that inbound requests genuinely came from Twilio, and that check is computed over the exact URL string. Scheme, host, path and query all have to match what you typed into the Twilio console, byte for byte.

A trailing slash, an http where Twilio has https, or a proxy that rewrites the path will all produce texts that reach Twilio, get forwarded, and are then rejected as forged. Twilio will show the delivery as attempted and your agent will show nothing at all.

Both frameworks offer a switch to skip that verification. It is for local tunnel testing. On a gateway anyone can reach, turning it off means anyone who finds the URL can put words into your agent.

Deciding Who Can Text It

A phone number is guessable in a way a Discord invite is not, so this matters more here than on most channels.

OpenClaw defaults to pairing: an unknown sender gets a code, and you approve it before the agent will hold a conversation with them. Codes expire after an hour. You can switch to a fixed allowlist of numbers instead, which is the right choice for a private assistant, or open it to everyone, which requires an explicit wildcard so you cannot do it by accident.

Hermes denies everyone by default and expects you to name the phone numbers that are allowed. There is an allow-anyone setting; think hard before using it on an agent with shell access.

What SMS Does to Your Agent's Replies

Text messages have no formatting, so markdown is stripped rather than sent as literal asterisks. Code blocks are flattened and links are rewritten so the URL survives.

Long replies get split across several messages at sensible boundaries. That is fine occasionally and irritating constantly, so if your agent tends toward essays it is worth telling it in its instructions to keep SMS answers short. Every segment is also a billable message on Twilio.

SMS is plain text only — no images, no files. And it is not encrypted in any meaningful sense; it passes through carriers in the clear. For anything sensitive, Signal is the better channel.

Testing It

Text the number from your own phone. On OpenClaw with default settings the first message should create a pairing request that you approve, and the second message should get an answer. On Hermes, if your number is on the allowlist, the first message should already get an answer.

If nothing arrives, look at the Twilio message log before touching the agent. Twilio records whether it managed to reach your webhook at all, which immediately tells you whether the problem is the network path or the agent.

Troubleshooting

  • Twilio logs error 11200. Twilio accepted the text and could not reach your webhook. The URL is wrong, the path is not exposed, or the agent is not reachable publicly.
  • Requests arrive and are rejected. The signature check is failing, which almost always means the configured public URL does not match the Twilio one exactly.
  • Texts arrive, agent stays silent. The sender is not approved. Look for a pending pairing request or check the allowlist.
  • Replies never send. The sender number or messaging service is not resolving, or you are on a trial account texting an unverified number.
  • One answer arrives as five texts. Normal for long replies. Ask the agent to be brief on this channel.

Need a Hand?

Contact support from your dashboard and we will get the number wired up. Do not paste your Twilio auth token into chat — we will tell you where to put it.