Mandates
An agent asks before its first step for a bounded run of one action: a number of approvals, a time, an amount per step and a total. An owner grants it once, and each step is checked against what is left.
Often an agent knows before it starts what a task will need. A support agent handling a return knows it will refund the damaged items, a few of them, each under EUR 40. Asking a person at every step is noise, and an “always” rule is far more than this one task needs. A mandate lets the agent ask once, up front: “up to 3 refunds, at most EUR 40 each and EUR 100 in all, for the next hour, in this run”. An owner grants it once, and each step the agent then asks for is checked against what is left.

You can try it without signing up in the playground.
Mandates and run grants
Both end up as the same narrow rule: one run grant in the owner’s name, for one agent key, one exact action and one run, with a number of uses and an end. They differ in who starts it:
- A run grant starts from a real step. A person approves one request and keeps the answer for the rest of the run, for at most 8 hours.
- A mandate is asked for by the agent before its first step. The agent states the bounds: how many uses, for how many minutes, at most how much per step and how much in all. The owner grants them as asked, or with fewer uses.
Asking for a mandate
A mandate is an ordinary request with a mandate object and a run. The request’s amount, when given, is the most one step may move; mandate.total is the most all steps may move together. A mandate with neither has no money limit: the inbox says so before an owner grants it, so ask with an amount for anything that moves money.
curl https://api.variantgate.com/v1/requests \
-H "Authorization: Bearer $VARIANTGATE_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent": "support-bot",
"action": "refund.create",
"summary": "Refund the damaged items in order 1042",
"run": "job-1",
"amount": "40.00",
"currency": "EUR",
"mandate": { "uses": 3, "minutes": 60, "total": "100.00", "currency": "EUR" }
}'- mandate.uses
- How many approvals it may give, 1 to 100.
- mandate.minutes
- How long it lasts once granted, 5 to 480.
- mandate.total
- Optional. The most all steps may move together, at least the request's amount, with mandate.currency.
- run
- Required. Only requests in this run are covered.
With the SDKs, the call waits until an owner decides:
import { ApprovalClient } from "@variantgate/agent";
const approvals = new ApprovalClient({ apiUrl, key, agent: "support-bot", run: "job-1" });
const mandate = await approvals.requestMandate({
action: "refund.create",
summary: "Refund the damaged items in order 1042",
amount: "40.00", // the most one step may move
currency: "EUR",
total: "100.00", // the most all steps may move together
uses: 3,
minutes: 60,
});
if (!mandate.granted) throw new Error("No mandate: ask step by step instead");
for (const item of damagedItems) {
// Each step is still its own request, answered by the grant while it lasts.
await approvals.guard(
{ action: "refund.create", summary: `Refund ${item.name}`, amount: item.price, currency: "EUR" },
() => payments.refund(item)
);
}from variantgate import ApprovalClient
approvals = ApprovalClient("support-bot", run="job-1")
mandate = approvals.request_mandate(
"refund.create",
"Refund the damaged items in order 1042",
amount="40.00", # the most one step may move
currency="EUR",
total="100.00", # the most all steps may move together
uses=3,
minutes=60,
)
if not mandate.granted:
raise RuntimeError("No mandate: ask step by step instead")
for item in damaged_items:
# Each step is still its own request, answered by the grant while it lasts.
with approvals.require_approval("refund.create", f"Refund {item.name}",
amount=item.price, currency="EUR"):
payments.refund(item)The answer
The request that asks is never a step itself. Its allowed is always false, even once granted; mandate.granted says whether an owner granted it. Each refund is then its own request, and while the mandate has uses, time and money left it is approved at once:
{
"id": "0196f3c1-2d4e-7f60-b1c2-d3e4f5a6b7c8",
"action": "refund.create",
"status": "approved",
"allowed": false,
"run": "job-1",
"amount": "40.00",
"currency": "EUR",
"mandate": {
"uses": 3,
"minutes": 60,
"total": "100.00",
"total_currency": "EUR",
"granted": true
},
"decided_by": "maya@northwind.example",
…
}A step the mandate approves carries this note:
Rule: allow refund.create in run job-1, use 1 of 3, within 100.00 EUR in all up to 40.00 EURA step above the per-step amount, above what is left of the total, in another run, from another key or for another action is not covered. It asks a person, or goes to whatever other rule covers it.
Who grants it
Granting a mandate writes a rule in the granting person’s name, so only a workspace owner can, and only from the inbox or POST /v1/workspaces/{id}/requests/{id}/decision with verdict: "approve". To grant fewer uses than asked, send remember_uses with a lower number; more than asked is refused. Members see the mandate and can deny it, and anyone can deny it from Slack, email or Telegram. Approve buttons there answer 422, because a tap in a chat is not the place to write a rule.
Asking for a mandate works on every plan. Granting one writes a rule, so like a run grant it needs Pro or above; on Free the grant answers 402. The grant counts as one of the workspace’s rules while it lasts.
What still wins
- No rule grants a mandate on its own. An
allowrule that covers the action leaves the request waiting for a person; a deny rule still denies it. - An ask rule that covers the action, or a two-person rule, makes the grant refuse with 422: a mandate cannot be wider than what you already said needs a person.
- While the workspace or the agent’s key is paused, nothing is allowed, and a stopped run refuses whatever it asks next.
- The summary check, consequence preview, Unusual for this agent and untrusted sources still hold a step for a person, exactly as for any other rule.
- Uses and the total are counted inside the transaction that stores each step, with the grant’s row locked, so two steps arriving together cannot both take what is left. A cancelled approval still counts against both.
- A grant with a total is stored under its own effect name, so an older version of the API running during a deploy refuses it instead of reading it as a grant with no total.
Limits and errors
The API answers 422, and stores nothing, when a mandate breaks one of these:
usesfrom 1 to 100 andminutesfrom 5 to 480;- a
totalabove zero, in the same currency as the request’samountand at least that amount; - a
run, and anactionwithout*: a mandate is for one run of one action.
Granting it with remember other than run, or with changes, is refused too: a mandate lasts as long as the agent asked.
Under Rules
A granted mandate shows under Rules, and in GET /v1/workspaces/{id}/rules, as a run grant with its total in max_total and the per-step amount in limit_amount. Deleting it there ends it at once.
{
"action": "refund.create",
"agent_key_id": "0196f1a0-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
"effect": "allow",
"limit_amount": "40.00",
"limit_currency": "EUR",
"ends_at": "2026-11-27T11:04:00Z",
"run_id": "job-1",
"max_uses": 3,
"uses": 1,
"max_total": "100.00",
"created_by": "maya@northwind.example",
…
}How this differs from other approaches
Google’s Agent Payments Protocol (AP2) has intent mandates: a person signs spending constraints in advance, and merchants and payment networks check them. They are for payments. A VariantGate mandate covers any action an agent asks about, not only money, and it is enforced where the agent asks: uses and totals are counted under a lock, it covers one run of one key, and every more cautious rule, hold and pause still wins over it. It is not a signed credential; if a payment network needs one, the two can sit side by side.
Limits worth knowing
- The agent picks its own run id. A mandate holds it to that id; a new id simply starts asking from nothing.
- The rule tester does not take a run id, so it never shows a mandate matching.
- For something an agent may always do, write a rule with a limit or a budget instead.