Cancel window
A rule can make its approvals wait 1 to 1,440 minutes before the agent may act. Until then allowed stays false, the inbox counts down, and anyone in the workspace can cancel.
Email has had undo send for years: the message waits a few seconds, and you can still take it back. A cancel window does the same for what an agent does. A rule can say that its approvals wait a number of minutes before the agent may act. Until then the request is approved but allowed stays false, the inbox shows it under Going ahead soon with a countdown, and anyone in the workspace can cancel it.

Why the agent waits, not the tool
Research on agent frameworks found that a stop or a rejection often arrived after the tool had already run: the cancel was reported, and the side effect landed anyway (Stop Means Stop, 2026). A cancel only works if the agent never had permission in the first place. Here it had not: during the window the API answers allowed: false and gives no receipt, so a tool that checks receipts refuses too. Cancelling turns the request into a denial before anything was allowed.
Give a rule a window
Under Rules, an allow or ask rule takes a cancel window of 1 to 1,440 minutes (a day). Over the API it is cancel_window_minutes:
curl -X POST https://api.variantgate.com/v1/workspaces/$WORKSPACE_ID/rules \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "payment.refund",
"effect": "allow",
"limit_amount": "50.00",
"limit_currency": "EUR",
"cancel_window_minutes": 10
}'- allow
- Approves a request it covers at once, as before, and the window starts then. Small refunds go out by themselves, ten minutes late, with a chance to stop the wrong one.
- ask
- The request waits for a person as before. When they approve, or the last of two people approves, the window starts.
- deny
- Cannot have a window: there is nothing to wait for. A deny rule with one is refused.
A request takes its window from every rule that covers it when it arrives, whichever decides it. When several do, the longest window wins. Rules, and so cancel windows, need Pro or above.
What the agent sees
While the window is open, the agent reads status: approved, allowed: false and acts_at, the moment it may go ahead:
{
"id": "0196f1a0-55d2-7a11-b3e4-9f8e7d6c5b4a",
"status": "approved",
"allowed": false,
"decided_at": "2026-11-25T09:00:00Z",
"acts_at": "2026-11-25T09:10:00Z",
"cancelled_by": null,
"cancelled_at": null,
…
}From acts_at on, allowed is true and the receipt is given, as for any approval. A long poll with wait_seconds keeps waiting through the window, and the SDKs wait until acts_at:
import { ApprovalClient } from "@variantgate/agent";
const approvals = new ApprovalClient({
agent: "support-bot",
apiUrl: process.env.VARIANTGATE_API_URL ?? "https://api.variantgate.com",
key: process.env.VARIANTGATE_KEY ?? "",
});
const asked = await approvals.ask(
{
action: "payment.refund",
summary: "Refund €40.00 to sam@example.com for order 1250",
amount: "40.00",
currency: "EUR",
},
30
);
// Waits for a person, then through the cancel window, if there is one.
const decision = await approvals.waitForDecision(asked);
if (decision.allowed) {
await refund("1250", "40.00");
}from variantgate import ApprovalClient, is_allowed
approvals = ApprovalClient("support-bot") # VARIANTGATE_KEY from the environment
asked = approvals.ask(
"payment.refund",
"Refund €40.00 to sam@example.com for order 1250",
amount="40.00",
currency="EUR",
wait_seconds=30,
)
# Waits for a person, then through the cancel window, if there is one.
decision = approvals.wait(asked)
if is_allowed(decision):
refund("1250", "40.00")An older SDK, or code that reads the answer once, sees allowed: false and does nothing. It fails closed: the action is skipped, never run early.
An agent that stops waiting inside the window withdraws the approval (POST /v1/requests/{id}/withdraw works on a request still in its window), so nothing goes ahead with nobody there to do it. The SDKs do this when their timeout runs out, and so do variantgate run, the coding-agent hooks and variantgate mcp-proxy. Hooks (Claude Code, Codex, Cursor and the others) wait only a minute or two, and an MCP client about as long, so a longer window ends those calls with a refusal that says when the action would have gone ahead; trying again makes a new request with a window of its own. Keep longer windows for agents built on the SDKs, which wait as long as you let them.
Cancelling
Any member may cancel, not only owners, because stopping is always the safe direction. In the inbox it is the Cancel button beside the countdown. Over the API:
curl -X POST \
https://api.variantgate.com/v1/workspaces/$WORKSPACE_ID/requests/$REQUEST_ID/cancel \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"The request becomes denied, with who cancelled and when. The approval stays in the record, so it reads approved by one person and cancelled by another. Once acts_at has passed there is nothing to cancel, and the API answers 409:
{
"status": "denied",
"allowed": false,
"acts_at": "2026-11-25T09:10:00Z",
"cancelled_by": "maya@northwind.example",
"cancelled_at": "2026-11-25T09:04:12Z",
…
}What holds and what does not
- A window only ever delays an approval or turns it into a denial. It never approves anything, and nothing about it can make an agent act sooner.
- A pause still wins: while the workspace or the agent’s key is paused, nothing is allowed, window or not.
- The agent is told when it may act, but the window is the agent’s to respect only as far as it reads
allowed. A tool that checks receipts enforces it without trusting the agent. - A window suits actions that do harm only once they run: payments, emails, deploys, deletions. It does not help with an action whose damage is done by asking.
Try it without signing up in the playground: a €40 refund is approved by a rule with a ten-minute window, and you can cancel it, or skip ahead and watch allowed turn true.