A consent gate before an agent acts
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
List the actions that cannot be undone
Sending a text, sending an email and creating an order are the usual ones.
- 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
Check the fact in the workflow
Run the check right before the action, every time, and log what was sent with its time.
- 4
Apply the replies that change consent
Process STOP and START replies at once, so the next check reads the new state.
- 5
Hand refusals to a person
Route what the check refuses, or what needs judgment, to a person with the reason attached.
What is a consent gate?
A consent gate is a check that runs in code right before an agent does something the business cannot take back, such as sending a text message or creating an order. It reads a recorded fact: whether the lead agreed to texts and has not opted out, or whether the caller said yes to the order read back to them. If the fact is missing, the action does not happen. The check sits in the workflow that performs the action, so it runs every time, whatever the agent said a moment earlier.
Why the check lives in the workflow
A prompt can ask a model to check for consent, and most of the time it will. A check in the workflow that sends the message runs on every send, whatever the model remembers. For an action a business cannot undo, I build the second kind.
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
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
| Company or area | Tools |
|---|---|
| Workflow automation | n8n |
| Messaging | Twilio, SendGrid |
| Voice agent | ElevenLabs Conversational AI |
| Commerce | Shopify, SAP Business One |
| Database | Postgres |
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
How it is built
Every order created only after the caller confirms it
Every text sent only after the opt-out check
10 p.m. to 8 a.m. quiet hours, when no text is sent
Sources
- Advanced opt-out for messaging (accessed )
- Draft orders in the Shopify Admin API (accessed )