Approval gates: letting an AI agent act safely
How to let an AI agent take real actions safely: approval gates enforced in your backend, decisions based on reversibility, read-backs and kill switches.
Ozan Yildirim, Founder & AI Engineer
An approval gate is a rule in your software, not in the AI's instructions, that decides what an agent may do on its own, what it may do only after a person approves, and what it may only ever propose. The safe way to let an AI agent take real actions is to make that decision action by action, based on what it costs to be wrong and whether the action can be undone, and then enforce it in the backend where the model cannot talk its way past it. Everything else in this post is detail on how to do that well.
Why the prompt is the wrong place for safety
The tempting way to make an agent careful is to tell it to be careful: "Always ask the user before placing an order." That instruction lives in the prompt, and a prompt is a suggestion. The model can misread it, a long conversation can push it out of focus, and a cleverly worded message can talk the model out of it. That last one is called prompt injection, and it is not hypothetical.
The fix is to move the rule out of the prompt and into code. When we built ShipmentOS for Mailboxes Etc, every action the agent could take was an explicit, typed tool with a validated schema, and write actions were gated server-side, "so an approval requirement is enforced in the backend rather than requested in a prompt". The model can ask to create a shipment. Whether that request goes through, waits for a person or is refused is decided by code that does not read the conversation.
This is the core idea behind a human in the loop done properly: the person is in the loop because the system will not proceed without them, not because the model was asked nicely.
Three kinds of action
Sort every action an agent can take into one of three groups:
| Group | What it means | Examples |
|---|---|---|
| Acts alone | Cheap to get wrong, or easy to undo | Looking up tracking, searching documents, drafting text nobody has sent |
| Acts after approval | Costs money or reputation if wrong, but a person can check it quickly | Creating a shipment, sending a follow-up email, placing an order |
| Only proposes | A person must own the decision, and the AI does the tedious part | Customs tariff codes, a price for a non-standard job, anything legal |
The third group is the one people forget. On the Mailboxes Etc platform, the customs itemisation tool proposes tariff codes and per-item weights, reconciled against the declared parcel weight, but it is deliberately built read-only. It never writes the declaration. An operator reviews and applies it. The AI saves the hard, boring part of the work, and the accountable person keeps the decision.
Decide on reversibility, not on confidence
The natural instinct is to let an agent act alone when it is confident. That is the wrong test, because language models are often confidently wrong. A better test is: if this is wrong, what does it cost, and can it be taken back?
The clearest example from our own work is an agent that emails a branch's customers about problems with their parcels, without a person reviewing each email. A wrong write inside the platform can be corrected. A wrong email has already been read.
So the rule for which emails may send without review is about reversibility. An email type is allowed to send automatically only if it tells the customer about something they would have had to deal with anyway, so the worst case is a redundant email rather than a bad instruction. Two categories fail that test and always wait for a person: rebooking a delivery, which only the person expecting the parcel can do, and a stalled parcel, where chasing the carrier is the branch's job.
The decision itself is a plain function with no model in it. It takes the classified event, the branch's settings and the shipment's send history, and returns one of nine outcomes: send, queue for approval, or one of seven reasons to suppress. Around it sit blunt limits:
- at most three automatic emails per shipment;
- a 24-hour cooldown per email type, and six hours across all types;
- a block on duplicates;
- two independent switches that must both be on, the email type and the branch's own setting;
- the whole system off until a branch turns it on.
None of those limits depend on the model behaving. That is the point.
What a good approval looks like
An approval step is only as good as what the approver sees and what their "yes" actually covers. A few rules we apply:
- Show exactly what will happen. Not "send follow-up?", but the email itself, with the recipient fixed. In our follow-up drafts, the recipient is the lead's email address, set when the draft is written and not editable by the model.
- Bind the approval to the data it relied on. If the enquiry changes after a draft is written, the draft goes stale and must be looked at again. An approval should not quietly cover something the approver never saw.
- Check who is approving, at the moment they approve. In our systems, only an owner or admin can approve a follow-up, and that is re-checked when they click, not when the draft was made.
- Let unanswered approvals expire. A draft nobody decides on expires after seven days, so a stale message cannot be approved weeks later by accident.
The same thinking applies when the approver is your customer rather than your staff. When our AI receptionist takes an enquiry in a website chat, it shows the visitor exactly what it will save, and saves nothing until they confirm. On the phone, it reads every detail back, the phone number digit by digit, and a "yes" only counts once every detail has been heard. If the caller interrupts the read-back and says yes, nothing is saved.
Limits, budgets and kill switches
Approval gates handle individual actions. You also need controls for the whole system:
- Rate limits on how often an agent can act, per customer and overall, so a loop or an attack cannot run up thousands of actions.
- Budgets on what an agent can spend on model calls, with alerts before the limit rather than a surprise at the end of the month.
- A kill switch for each feature, so you can turn off the phone line or the follow-up emails without taking everything else down. Ours apply to the next message or call, and the phone line's can stop a call in progress.
Test the kill switch before you need it. A switch nobody has tried is a hope, not a control.
A record you can read
Every action an agent takes, and every approval, should leave a record: what was proposed, what the inputs were, who approved it, and what happened. We keep an append-only log of every AI tool call, so entries cannot be quietly edited after the fact. When a customer asks why they received an email, or a branch manager asks why a shipment was created, the answer should take a minute to find.
The same record is what makes improvement possible. You cannot fix the failure modes you cannot see.
A checklist for your first agent
Before an agent takes any action in your business:
- List every action it can take, and put each one in a group: acts alone, acts after approval, or only proposes.
- For each action, ask what it costs to be wrong and whether it can be undone.
- Enforce the groups in your backend, never only in the prompt.
- Make approvals show the exact action, bound to the data they relied on, approved by the right person, with an expiry.
- Add rate limits, a budget and a kill switch for each feature, and test the switch.
- Log every action and approval somewhere that cannot be edited afterwards.
- Start with the agent proposing everything, then move actions to "acts alone" one at a time as the evidence builds.
That last step is how most of our agent work starts: the agent proposes, people approve, and the approval rate tells you which actions are ready to run on their own.
Building one with us
This is the work behind our production AI agents: agents that create records, place orders and move work forward in your systems, with the gates enforced in your backend and the evaluation to show they get it right. The shipping example above is written up in full in the Mailboxes Etc case study.