Skip to content
be-human.ai
← Back to the journal

Tools & integrations

SMS Consent and Quiet Hours for AI Agents: Enforce Rules in the Tool

Store SMS consent, honor opt-outs and enforce quiet hours inside the messaging tool before an AI agent texts a customer. Steps and checks included.

Be Human typographic cover with the title: SMS Consent and Quiet Hours for AI Agents: Enforce Rules in the Tool
Conceptual illustration created with AI · Be Human

Before an AI agent sends an SMS, the messaging tool should check three things: a stored consent record for that number and message type, an opt-out list that the agent cannot edit, and the recipient's local quiet hours. If any check fails, the tool refuses the send, returns a reason the agent can read, and logs the decision. The rules live in the tool, not in the agent's instructions, so they hold even when a conversation goes off track.

Key takeaways

  • Store consent as a dated record with its source and scope, not as a line in a chat history.
  • Treat any opt-out reply as a suppression that applies to every agent, campaign and workflow.
  • Calculate quiet hours from the recipient's local time zone, and fall back to the stricter rule when the location is unknown.
  • Make the messaging tool return a refusal code the agent can act on, so it skips the contact or hands it to a person.
  • Test blocked cases before live sending starts, and keep a log of every allow and deny decision.

Why the agent should not decide whether it may text

An agent is good at reading a conversation and choosing what to say next. It is a poor place to hold the rule that a number opted out last week, or that a contact sits in a time zone where it is late in the evening. If those rules exist only in the system prompt, they depend on the model applying them correctly every time. A long conversation, an unusual customer message or a tool error can push them out of focus.

The safer pattern follows the same logic as any permission boundary. OWASP's guidance on authorization calls for access decisions to be enforced on every request, outside the part of the application that the user can influence. For SMS, the send capability should sit behind a gate that the agent cannot skip. The agent can request a send with a recipient, a message category and a purpose. The tool decides whether that send is allowed.

What a consent record must contain

A verbal yes in a chat is weak evidence if nobody can find it later. Keep one consent record per phone number and per message category, so that permission to receive appointment reminders is never confused with permission to receive offers. A useful record includes these fields:

  • The phone number in a normalized international format, linked to the customer's identifier in your system.
  • The message category the person agreed to receive, such as service reminders or promotional offers.
  • The source and timestamp of the consent, such as a web form, a signed service form, or a call logged by a staff member.
  • The wording or version of the notice shown at the time, so you can show what the person was told.
  • The current status, such as opted in, opted out, pending confirmation or unknown, with the time of the last change.
  • The channel and provider event ID that produced each change, so every status can be traced.

Unknown must mean no send. Many teams store a simple yes or no field, which hides where the value came from and makes it hard to defend. Keep the record in a store the messaging tool reads directly. An agent should be able to read its status but not edit it.

If your customers are in Brazil, personal data rules such as the LGPD expect you to explain what personal data you hold and why. A structured record with a source and a purpose answers those questions far better than scattered notes.

How to honor opt-outs everywhere at once

An opt-out is only useful if every system that can contact the person sees it. Replies such as STOP are usually intercepted by the messaging provider, but your own system must also receive that event and update its record. Provider webhooks deliver inbound messages and delivery reports, and your endpoint should verify that each event is genuine before it changes anything. An unverified event should never be able to opt someone in or out.

Once the opt-out is recorded, the suppression list must be the single source of truth. The reminder scheduler, the CRM sequences, the agents that draft messages and any exported contact list should all check the same list before they send. A common failure is a promotional campaign that stops correctly while a separate reminder workflow keeps running from an older export. The fix is architectural: one list, one check, one place where the send is refused.

The question of scope needs a clear answer in advance. Whether a STOP reply covers only promotional messages or every text depends on the wording shown at signup and on advice from your counsel. Write the answer into the record and into the tool's rules, so the agent does not guess. The same suppression logic applies to email, as described in email bounce handling for outreach agents.

How to enforce quiet hours that hold up

Quiet hours define when a message may be sent to a particular person. The rule is simple to state and easy to get wrong. The most common mistake is using the company's time zone or the server's time zone, so a customer in another region receives a reminder at an hour they never agreed to. Use the recipient's local time zone instead, and store it when the customer provides an address or chooses a preference.

Area codes are not reliable evidence of location, because people move and keep their numbers. When the time zone is unknown, the tool should apply the stricter window or defer the message until the location is confirmed. Legal windows and exceptions differ by country and by message type, so have counsel confirm the exact hours and any holiday rules before you configure them.

Several practical rules make the window work in production:

  • Store a quiet window per recipient time zone, not one window for the whole company.
  • Evaluate the window at send time, not when the agent drafted the message, because queued messages drift into forbidden hours.
  • When a message is blocked for timing, return the next allowed time so the scheduler can reschedule it, and prevent the agent from retrying in a loop.
  • Apply a separate check for holidays and for any exception your counsel has approved.
  • Log the time zone and the rule used for every send, so you can explain later why a message went out when it did.

A step-by-step plan to build the send gate

The gate can be built in a few deliberate steps. Each step has a clear owner and a visible result, which makes it easier to review before any live message goes out.

  • First, list every system that can send SMS, including agents, workflows, staff tools and integrations, and remove direct sending rights from all of them except the gate.
  • Second, create the consent and suppression tables with the fields described above, and backfill them from existing evidence. Mark anything without evidence as unknown.
  • Third, build one send function in the messaging tool that requires a recipient identifier, a message category and a purpose, and that checks status, suppression, purpose and quiet window before calling the provider.
  • Fourth, define refusal codes such as no consent, opted out, outside window, unknown time zone and purpose mismatch, and document what each code means for the agent's next step.
  • Fifth, connect provider opt-out events to the suppression list, verify each event before writing it, and test what happens when the event arrives after a message has been queued.
  • Sixth, write tests for every refusal code, including a case where an opt-out arrives while a reminder sits in the queue.
  • Seventh, log every allow and deny with the rule that decided it, and review the log on a fixed schedule.
  • Eighth, name one owner who must approve any change to windows, message categories or consent wording.

Volume limits belong in the same gate, so a single misconfigured workflow cannot send far more messages than intended. The approach used for email send caps applies here too, as covered in AI agent email send caps.

Illustrative scenario: a reminder agent for a service business

Illustrative scenario: a home repair company wants an agent to text customers the evening before a visit, confirm the arrival window and ask whether the appointment still works. One customer booked by phone and agreed to service reminders, but never agreed to promotional offers. Another customer booked online from a different time zone, and the agent drafts a reminder at nine at night in that customer's local time.

In this setup, the tool checks the first customer's record, finds consent for the reminder category, and allows the send. It refuses the second message for timing and returns the next allowed morning, so the scheduler moves the reminder without the agent retrying. Later, the second customer replies STOP to a promotional text. The provider event is verified, the promotional category is suppressed, and the record notes that the reminder category was not affected by the wording on the original form. The company can show each step from the log, which is what matters when a customer asks what happened.

The least-privilege principle is useful here as well. The reminder agent needs permission to request reminder sends and read appointment times. It does not need permission to edit consent records or to send promotional messages. The starting point for that scope is described in least privilege for AI agents.

Keeping the gate correct after launch

A gate that works on the first day can drift over time. New message categories get added, a form wording changes, a workflow is copied with an old export, or a provider changes how it reports events. Recurring review catches these changes before they become complaints. Look at refusal counts by reason, at messages that were allowed without a clear consent source, and at any opt-out that took longer than expected to reach the suppression list.

The NIST AI Risk Management Framework treats governance and human oversight as ongoing activities, not a one-time setup. For SMS agents, that means a named person approves each rule change, and the agent's own access stays narrow.

Be Human designs and operates this kind of gate as part of managed operations. A first engagement defines one useful role, the consent fields and quiet window rules it needs, the approval boundary for any new message category, and an observable criterion such as every blocked send being logged with its reason. Monitoring, permission review and incident response then cover the gate itself, so changes to consent wording or quiet hours go through a named approver rather than an edit to a prompt.

If you are not sure which task should go to an agent first, the free Be Human AI diagnostic can help you find the first task worth handing to an agent.

Frequently asked questions

Can an AI agent text customers without their consent? In most cases, a customer must have agreed to receive that type of message, and the agent cannot create that agreement by sending the message. Store the source of each consent and treat missing evidence as no consent. Ask counsel to confirm the rules for each country and message type you serve.

What should happen when a customer replies STOP to an agent? The provider event should be verified, and the suppression list should be updated in the same moment. Every system that can contact the customer should check that list before sending, including the agent, the scheduler and any exported contact file. The record should also say which message categories the opt-out covers.

Should quiet hours be enforced in the prompt or in the messaging tool? Enforce them in the tool. A prompt can ask the agent to respect quiet hours, but the send function is the only place that can refuse a message reliably on every request. The agent should receive a clear deferral reason and the next allowed time instead of guessing.

Do the same rules apply to WhatsApp and email? The principles are the same: a stored consent record, a suppression list that every sender checks, and a gate that logs each decision. The specific rules, however, differ by channel and by provider, so each channel needs its own review before the agent is allowed to send.

Your next step

See where an AI agent fits in your company first.

Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.

Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.

Less busywork. More room for you.

Bring us the work you wish you had time for.

Book a call to try a personalized AI agent free for 7 days ↗Or take the free AI diagnostic →