An agent action approval API in one call
Wrap one call around the line that moves money or ships a change. It clears under your policy or waits for a person, and the verdict is sealed to whoever signed it.
The problem
Every agent loop ends at a line that actually does something: refund.create, content.publish, payout.send, code.deploy. You can tell the model to ask first. It might. But a prompt is a hope, not a stop. Once that line executes, the refund is paid and the post is live, and you read about it afterwards in the logs.
The fix lives in code, not in the system prompt. You want one call sitting in front of the dangerous action that returns a real verdict and holds execution until that verdict exists. Roll that yourself and you're suddenly building a queue, a notifier, a signed log, and some way to stop a dev quietly commenting it out. That whole thing is what the agent action approval API at the slug agent-action-approval-api collapses into a single call.
How ClearedBy handles it
-
01
Wrap the line that acts
Put guard() around the call that does the damage, or fire request_clearance just before it. It runs anywhere fetch does — any framework, any runtime, or as an MCP tool.
-
02
Policy decides in milliseconds
The gate reads the action and its params against rules you wrote. A £12 refund under your threshold clears on the spot. A £4,000 payout to a new account gets held and routed to a named reviewer.
-
03
The call waits for the verdict
On a cleared verdict, guard() runs your function and returns. On a held one it blocks, then resumes the moment someone signs off from the queue, Slack or their phone. A rejection throws RejectedError, so nothing runs by accident.
-
04
The verdict gets sealed
Cleared, auto-cleared or rejected, each decision is hash-linked into a tamper-evident record bound to the person who approved it. The agent only receives a short-lived credential once that record exists.
import { ClearedBy } from '@clearedby/sdk'
const cb = new ClearedBy({ apiKey: process.env.CLEAREDBY_API_KEY! })
await cb.guard(
{ action: 'payout.send', params: { amount: 4000, currency: 'GBP', to: 'acct_8821' } },
() => sendPayout(), // clears under policy, or blocks here until a person signs off
)
FAQ
REST endpoint or SDK?
Either. There's a single POST /v1/gate you can hit from any language, plus a dependency-free SDK with gate, guard, wait and check, plus a drop-in MCP tool. One gate underneath all three.
Does the call really block my agent?
Yes, on purpose. guard() returns only on a cleared verdict and parks the thread on a held item, so the agent physically cannot proceed on a consequential action until policy or a person says go.
What comes back while an action sits in the queue?
A result with status pending, the work-item id, and a resume hint — long-poll or a webhook callback. guard() does the waiting for you; with the raw API you poll status(id) or catch the callback when it resolves.
Why not just write an if-statement in my own code?
An if-statement only knows the cases you already decided. This routes the grey ones to a human in real time, hands back a short-lived credential only after they approve, and seals the verdict to their name. A dev can delete an if-statement; they can't quietly skip the gate.
Can I try it against production traffic without blocking anything?
Start in shadow mode and no call ever blocks — guard() always runs your function while the gate logs what it would have decided. Use check() to dry-run a policy verdict with nothing written to the record.
Related use cases
Let your agents run. Inside the rules you set.
Wrap one call around the line that moves money or ships a change. It clears under your policy or waits for a person, and the verdict is sealed to whoever signed it.