Build your own human approval for AI agents, or use a service?

What a home-made approval step for AI agents has to handle beyond a table and a button, when building it is the right call, and what a service saves.

Facts checked . Written by the people who make VariantGate, so read our section with that in mind; every claim about another product links to its own pages.

The short answer

  • Build it yourself if your app’s own user approves in your own screen, one framework holds the run, and the data must stay with you.
  • Use a service if the person deciding is elsewhere, more than one agent asks, or you need rules with limits, a record you can show and a switch that stops everything.
  • Often, both: your framework pauses and resumes the run; the service decides whether it may go on.

An approval step looks like a day of work: a table, an endpoint, a page with Approve and Deny. That version works in a demo. The trouble starts when the approver is on a phone, the agent restarts halfway, or someone asks who allowed a payment. We built VariantGate, so this page is the list of things we found we had to handle, so you can price them before you start.

The minimal version

This is enough for one agent and one person at a desk. Note the last line: expiry is checked when the answer is read, so a request nobody answered can never turn into a yes.

create table approval_requests (
  id          uuid primary key,
  agent       text not null,
  action      text not null,
  summary     text not null,
  status      text not null default 'pending',  -- approved, denied
  decided_by  uuid,                              -- from the session
  expires_at  timestamptz not null,
  created_at  timestamptz not null default now()
);

-- Expired means no, whatever the status column says:
select status = 'approved' and expires_at > now() as allowed
  from approval_requests where id = $1;

What it grows into

Each row is something a first version usually gets wrong, and the failure it causes.

The parts of an approval step, the easy version of each, and where it goes wrong
OptionThe easy versionWhere it goes wrong
Requests and their endThe easy versionA table with a status column and a page with two buttonsWhere it goes wrongA request nobody answers stays pending forever. It needs an end time, and running out has to mean no, checked when the agent reads it, not by a job that may not have run yet.
Waiting for the answerThe easy versionThe agent polls every few secondsWhere it goes wrongA restarted agent asks again and the person approves the same refund twice. Keep the request's id in the agent's own state and read that request instead of making a new one.
Reaching the personThe easy versionAn email with an Approve linkWhere it goes wrongMail scanners open links. A link that approves on GET gets approved by a virus scanner. The link has to open a page, and only a button press decides.
Who decidedThe easy versionThe decision endpoint takes a user idWhere it goes wrongWhoever decided must come from the signed-in session, never from the request body, and the agent's own key must not be able to decide anything, or an agent can approve itself.
Rules and limitsThe easy versionAuto-approve below an amountWhere it goes wrongA request with no amount, or in another currency, slips under the limit. Two requests at once both fit a daily budget that only has room for one. Limits have to fail toward asking.
The recordThe easy versionA log tableWhere it goes wrongA row anyone with database access can edit proves little. A record people trust is append-only, names who decided, and shows when an entry was changed.
A stop switchThe easy versionA feature flag that turns agents offWhere it goes wrongIt has to win over approvals already given, be checked on every read, and be easy to pull and hard to undo by accident: anyone can stop, only an owner resumes.

Then the usual work around any small service: sign-in, teams and roles, notifications that are retried, keys that can be scoped and revoked, backups, and someone on call when it is down. An approval step that is down means agents stop, so it is on the path of everything they do.

What the agent’s side looks like

With a service, the agent’s side is the same whichever you choose: ask before the action, wait, act only on yes. With VariantGate’s Python client it is a with block; the SDK docs have TypeScript and plain HTTP.

from variantgate import ApprovalClient, NotApprovedError

approvals = ApprovalClient("billing-agent")  # reads VARIANTGATE_KEY

try:
    with approvals.require_approval(
        "payment.refund", "Refund €240 for order 1182",
        amount="240", currency="EUR", timeout=900,
    ):
        refund(order_id="1182", amount="240")
except NotApprovedError as no:
    print(f"Not refunded: {no}")

Pending, denied, expired and any error all raise, so the refund only runs on an explicit yes. Build it yourself and keep that property: an approval step that fails open is worse than none.

When building it yourself is right

  • The person deciding is your app’s own user, looking at your own screen. A confirm step in your UI, fed by your framework’s pause (a LangGraph interrupt, an OpenAI Agents SDK interruption, Vercel AI SDK tool approval), is the whole job. An outside inbox would add a step for nothing.
  • Nothing may leave your network. A hosted service sees the summary of every action your agents want to take. If that is not allowed, build it, or self-host one.
  • The approval is part of your product. If customers approve their own agents’ work inside your app, the screen is yours to design. A service built for a team’s own agents is the wrong shape.

When a service pays for itself

  • The approver is not at the screen. They need an email, a push notification or a Slack, Teams or Discord message, and a page that works on a phone.
  • Several agents ask. A support bot, Claude Code on three laptops and an n8n flow should ask in one place, under one set of rules, with one record.
  • Someone will ask who approved what. An auditor, a customer or your own incident review. The record has to exist before that question, not be rebuilt from logs after it.
  • The routine should stop needing a person. Rules that allow small refunds and ask about large ones, with budgets per day, are where most of the edge cases in the table above live.

The cost side

VariantGate is free for one person and 100 requests a month, Pro is €9 a month with rules and budgets, and Team is €15 per person a month or paid per request; see pricing. Set that against the time to build and keep the parts above, not just the first version. If your data must stay in-house but you would rather not build it, the Enterprise plan includes self-hosting on your own server.

Building is the right call more often than vendors admit. If you do, how to add human approval to an AI agent walks through the pattern, and our security page lists the properties worth copying whatever you use.