Skip to content
Michael Saelee

A consent gate before an agent acts

By . Published . 6 minute read. In Full stack.

An opt-out check before any text message and a spoken yes before any order. Where each check sits, what it reads, and who takes over when it says no.

Put a consent gate in front of an agent

  1. 1

    List the actions that cannot be undone

    Sending a text, sending an email and creating an order are the usual ones.

  2. 2

    Record the fact each action needs

    Store the consent from the form, the opt-out flag, the quiet hours and the caller's confirmation where the workflow can read them.

  3. 3

    Check the fact in the workflow

    Run the check right before the action, every time, and log what was sent with its time.

  4. 4

    Apply the replies that change consent

    Process STOP and START replies at once, so the next check reads the new state.

  5. 5

    Hand refusals to a person

    Route what the check refuses, or what needs judgment, to a person with the reason attached.

Where does the gate sit in lead follow-up?

In front of every text and every email. A text goes out only when the lead agreed to texts on the form, and the opt-out flag is checked again before each send. A reply of STOP sets that flag at once, and START clears it. No text goes out in the quiet hours, 10 p.m. to 8 a.m. Email falls back to a second provider when the first one fails, so a message that passes the gate still arrives. Consent changes and every message sent are logged on the lead's record with their time, so a person can see why a message went out or did not.

One timeline per customer

Every email, text and call lands on the customer's one timeline. The consent state sits on the same record, so the check never has to look it up in a second system.

Where does the gate sit in a phone-order agent?

Between the quote and the order. The agent reads the order back with the items, the total and the shipping address, then asks the caller to confirm it. The order workflow checks for that confirmation before it creates anything. Without it, the workflow answers that approval is required, and the agent asks again. Prices and stock come only from Shopify and SAP Business One, so the caller agrees to numbers the agent did not make up. The order is created as a Shopify draft order, and the customer pays through an invoice link.

What the phone gate cannot see

The text gate reads a flag the model never writes. The phone gate is weaker, because the agent itself reports that the caller said yes. Two things back it up: nothing is charged until the customer pays the invoice, and calls are recorded and transcribed, so a disputed order can be checked against what the caller said.

Which actions need a gate?

Any action that sends a message, commits the business to a price or cannot be undone. Reading data and quoting from the systems of record do not need one. Some calls should never reach an automated action: a business organization asking for volume pricing goes to a human specialist, and catalog requests go to a second agent whose sales tools are removed, not just disabled. A tool the agent does not have is a stronger gate than an instruction not to use it.

The lead follow-up system draws the same line for people. Automation sends the first reply to a new lead in 10 to 15 minutes and notifies the office staff. Every lead scored 50 or more goes to a person, and the lowest scores go to nurture.

The decision behind it

Decision record

Where consent is checked

Problem

Agents that send messages and create orders act faster than any person can review them, and a text sent after an opt-out, or an order the caller never agreed to, cannot be taken back.

Constraints
  • A caller on the line cannot wait for a person to approve each order.
  • Every message and every order has to be traceable to the consent behind it.
  • Texts go only to leads who agreed to them, and never during quiet hours.
Options
  • Tell the model in its prompt to confirm consent first. Quick to set up, but nothing shows the check ran.
  • A check in the workflow that reads a recorded fact. More to build, and every action can be traced to its fact.
  • A person approves every action. Safe, but far too slow for a live call or a new lead.
Decision

A check in the workflow in front of every action that cannot be undone, reading a recorded fact, with a person handling whatever the check refuses or what needs judgment.

What I would change

Store the caller's yes as its own record, with its time and the words from the transcript, so the phone gate reads a fact the agent does not write, as the text gate already does.

Tools used

Tools used
Company or areaTools
Workflow automationn8n
MessagingTwilio, SendGrid
Voice agentElevenLabs Conversational AI
CommerceShopify, SAP Business One
DatabasePostgres

Questions people ask

Does a consent gate slow the agent down?

Barely. The check reads one recorded fact, such as an opt-out flag or a confirmation, so it adds a moment to an action that would be costly to undo. On a phone order, hearing the order read back before agreeing to it is part of a normal call.

What happens when the gate refuses an action?

The action does not happen, and nothing is sent or created in its place. On a call, the agent reads the order back and asks the caller to confirm it again. A text is not sent during the quiet hours, and a text to a lead who opted out is not sent at all.

Can the agent skip the check?

No. The check sits in the workflow that sends the message or creates the order, outside the agent's instructions, so it runs whatever the agent decides. On a phone order the agent does supply the caller's confirmation, which is why that gate is the weaker of the two.

Figures and sources

Measured

  • 10 to 15 minutes automated response to a new lead, with the office staff notified

    From The lead-to-close write-up

How it is built

  • Every order created only after the caller confirms it

    From The phone-order write-up

  • Every text sent only after the opt-out check

    From The lead-to-close write-up

  • 10 p.m. to 8 a.m. quiet hours, when no text is sent

    From The lead follow-up system's messaging settings

Sources

  1. Advanced opt-out for messaging (accessed )
  2. Draft orders in the Shopify Admin API (accessed )