Human approval for agent actions (CIBA)
OpenID CIBA (poll mode) is available from Authorizer 2.5.0 as a beta, off by default.
Some actions should not ride on a grant made in advance: send this payment, delete this repository, email this customer. With CIBA (OpenID Client-Initiated Backchannel Authentication Core 1.0), an agent asks the user to approve that action, now, and only gets authority for it after they say yes.
Which path do you need?
| Your agent… | Use |
|---|---|
| can open the user's browser (Claude Code, Cursor, a desktop or CLI agent) | Step-up with /authorize — no CIBA needed |
| runs without the user present (background job, queue worker, chat or email bot, cloud agent) | CIBA |
Agents that can open a browser: step-up
A desktop agent already opens the user's browser for MCP OAuth. To require a fresh sign-in before a sensitive action, send the user through /authorize again with prompt=login (or max_age=0):
GET /authorize?response_type=code&client_id=...&redirect_uri=...
&scope=openid&prompt=login&code_challenge=...&code_challenge_method=S256
Authorizer ends the current session and asks for credentials again, with MFA when the user is enrolled. The ID token's auth_time is the new sign-in time; check it, then use the fresh user token for token exchange as usual.
Limits: the user sees a sign-in, not the action, and auth_time is on the ID token only — the resource server cannot see it. When the user must approve a specific action, or isn't at the agent's screen, use CIBA.
How CIBA works
Agent (service account) Authorizer User
POST /oauth/bc-authorize ─► request stored, link sent ──────► email / your app (webhook)
◄── auth_req_id opens link, signs in,
POST /oauth/token (poll) ─► authorization_pending reviews the action,
... ◄──────── Approve / Deny
POST /oauth/token (poll) ─► access_token (5 min, bound to the action) + id_token
- The agent names the user and describes the action (
binding_message, optional RFC 9396authorization_details). - The user approves on Authorizer's own page, signed in with their own session. No OAuth client — not even the agent's own UI holding the user's token — can approve for them.
- The agent receives a delegated token that works at one external API, for five minutes, and says exactly what was approved.
Enable it
1. Server flags
./authorizer \
--url=https://auth.example.com \
--enable-ciba \
--ciba-authorization-details-types=payment_initiation # optional
| Flag | Default | Meaning |
|---|---|---|
--enable-ciba | false | Serves /oauth/bc-authorize, the approval page /oauth/bc-approve, the CIBA grant, and advertises them in discovery. |
--ciba-request-ttl | 300 | Request lifetime in seconds (1–600). requested_expiry can shorten it. |
--ciba-poll-interval | 5 | Minimum seconds between polls (2–60). |
--ciba-max-requests-per-user | 3 | Requests one agent may make for one user per request-TTL window. |
--ciba-max-requests-per-user-total | 10 | Requests all agents together may make for one user per window. |
--ciba-step-up-max-age | 300 | The user must have signed in within this many seconds to approve. |
--ciba-authorization-details-types | empty | RFC 9396 types accepted. Empty refuses any authorization_details. |
Requirements:
--urlmust behttps(CIBA requires TLS);httpis accepted onlocalhostfor development.- A way to reach users: SMTP (the
ciba_approvalemail), or a webhook foruser.approval_requested, or both. - With an explicit
--allowed-originslist, include the server's own origin so the login page can return users to the approval page.
2. Register the agent for CIBA
The agent is a service_account client with openid in its allowed scopes. Turn CIBA on per client in the dashboard (Clients → Human approval (CIBA)) or the admin API:
mutation {
_update_client(params: { id: "<client id>", backchannel_token_delivery_mode: "poll" }) {
client_id
backchannel_token_delivery_mode
}
}
"poll" enables CIBA, "" disables it. Dynamically registered and metadata-document clients can never use CIBA.
Request an approval
curl -s -u "$CLIENT_ID:$CLIENT_SECRET" https://auth.example.com/oauth/bc-authorize \
-d scope="openid payments:write" \
-d login_hint="$USER_ID" \
-d binding_message="Pay \$40 to Acme Corp" \
-d resource="https://api.example.com/payments" \
--data-urlencode 'authorization_details=[{"type":"payment_initiation","amount":40,"currency":"USD","creditor":"Acme Corp"}]'
{ "auth_req_id": "…", "expires_in": 300, "interval": 5 }
| Parameter | Rules |
|---|---|
scope | Must include openid. Narrowed to the client's allowed scopes. authorizer:* scopes are refused. |
login_hint or id_token_hint | Exactly one. login_hint is the user's Authorizer user id. id_token_hint is an ID token Authorizer issued to this client (for example from an earlier CIBA approval), accepted up to 30 days after it expired. Email and phone hints are not supported. |
binding_message | Required. Up to 64 characters of plain text; shown to the user as the agent's own words. |
resource | Required, exactly one. An absolute URI of the API the token is for; becomes the token's aud. A URI on Authorizer's own host and port is refused (invalid_target); the default ports :80 and :443 count as the same, and a trailing dot on the host is ignored. On localhost, use a different port from Authorizer's. |
authorization_details | Optional. A JSON array (≤ 5 objects, ≤ 4 KB) whose types are in --ciba-authorization-details-types. Values are strings, numbers, booleans or arrays of strings. |
requested_expiry | Optional, seconds; may only shorten the request. |
Clients authenticate as at the token endpoint: client secret, or a workload-identity assertion (recommended — CIBA advises against shared secrets). At /oauth/bc-authorize, when the trusted issuer's expected audience is one of Authorizer's own URLs, an assertion carrying the issuer, token endpoint or backchannel endpoint URL as its aud is accepted (CIBA §7.1). Polling /oauth/token still requires the expected audience exactly, so give your assertions that audience (typically the token endpoint URL).
A request for a user who cannot be asked — unknown, revoked, outside the agent's organization, over a cap, or blocked — gets the same 200 response and simply never gets approved (it ends in expired_token). Authorizer never returns unknown_user_id.
Poll for the result
curl -s -u "$CLIENT_ID:$CLIENT_SECRET" https://auth.example.com/oauth/token \
-d grant_type=urn:openid:params:grant-type:ciba \
-d auth_req_id="$AUTH_REQ_ID"
| Response | Meaning |
|---|---|
authorization_pending | Not decided yet. Poll again after interval seconds. |
slow_down | Polled too fast. Add 5 seconds to your interval for this request. |
access_denied | The user denied, or the user was revoked after approving. |
expired_token | Nobody decided in time. Start a new request. |
invalid_grant | Unknown auth_req_id, another client's, or already redeemed. |
200 | Approved: tokens below. Each approval can be redeemed once. |
{
"access_token": "…",
"token_type": "Bearer",
"expires_in": 300,
"id_token": "…",
"scope": "openid payments:write",
"authorization_details": [{ "type": "payment_initiation", "amount": 40, "currency": "USD", "creditor": "Acme Corp" }]
}
No refresh token: one approval, one action.
Verify the token at your API
The access token is a JWT signed by Authorizer (verify against /.well-known/jwks.json):
{
"iss": "https://auth.example.com",
"sub": "<user id>",
"aud": "https://api.example.com/payments",
"act": { "sub": "<agent client_id>" },
"client_id": "<agent client_id>",
"scope": ["openid", "payments:write"],
"authorization_details": [{ "type": "payment_initiation", "amount": 40, "currency": "USD", "creditor": "Acme Corp" }],
"ciba": { "req": "<sha256 of auth_req_id>", "msg": "<sha256 of binding_message>", "approved_at": 1764500000 },
"exp": 1764500300
}
Before acting, your API should check:
- signature,
iss,exp, andaudequals your API's URL; act.subis the agent you expect;- the operation matches
authorization_details— approving "$40 to Acme" must not authorize "$4,000 to someone else"; - optionally,
ciba.msgmatches the SHA-256 of the binding message you expected; - the approval has not been used already: the token stays valid for its five minutes, so record
ciba.req(orjti) untilexpand refuse a repeat if the action must happen once.
checkApprovedAction (authorizer-js) and check_approved_action (authorizer-py) implement checks 2–4 on claims you have already verified.
The token has no sid, so it is refused by Authorizer's own APIs.
What the user sees
The email (or your app, via the webhook) links to /oauth/bc-approve?id=…. The page:
- asks the user to sign in if needed, and again if their sign-in is older than
--ciba-step-up-max-ageor was by magic link. Signing in again ends the user's current Authorizer session first, so opening an approval link some time after signing in signs the user out of other apps that share that session (the link itself arrived by email, so a mailbox-only sign-in proves nothing new). Other ways in that rely on the mailbox — an email-verification link, or a password reset — still count; enable MFA for users who approve high-value actions; - shows the agent's registered name, the action details and the binding message (both labelled as the agent's own, not verified), the API and the scopes;
- offers Approve, Deny (the agent can't ask this user again for an hour) and Deny and block this agent (24 hours).
Customize the email under Email Templates → CIBA approval request ({{.agent_name}}, {{.binding_message}}, {{.approval_url}}, {{.expires_in_minutes}}, {{.resource}}).
Deliver it through your own app: the webhook
Register a webhook for user.approval_requested to push the request to your own channel (mobile push, chat). The payload carries the user and:
"approval_request": {
"approval_url": "https://auth.example.com/oauth/bc-approve?id=…",
"agent": { "client_id": "…", "name": "Payments agent" },
"binding_message": "Pay $40 to Acme Corp",
"authorization_details": [ … ],
"scopes": ["openid", "payments:write"],
"resource": "https://api.example.com/payments",
"expires_at": 1764500300
}
The link is a lookup handle, not a credential: approving still needs the user's own signed-in session. Verify the X-Authorizer-Signature header, an HMAC-SHA256 of the request body keyed with Authorizer's --client-secret, before you show the link to anyone.
Show it inside an MCP client: URL elicitation
When the agent is an MCP server and the user is at the MCP client, the server can show the approval link right there. To do this it uses URL-mode elicitation: it receives the link on the webhook above and sends it to the client with elicitation/create (mode: "url"). Name the user in login_hint from the sub of the MCP caller's own token, so the person who opens the link is the only one who can approve. Put a short reference in the binding message so that you can match the webhook to the tool call and the user can match the page to the client. The with-ciba example has a working server and client.
Monitor it
- Audit events:
ciba.requested,ciba.approved,ciba.denied,ciba.blockedandciba.token_issued.ciba.expired, written the first time the agent polls a request that expired undecided. A request the agent never polls again leaves onlyciba.requested.- Only requests that could reach a user are recorded.
- Prometheus:
authorizer_ciba_outcomes_total{client_id, outcome}, whereoutcomeisapproved,denied,blockedorexpired. Alert on a high deny rate per agent:sum by (client_id) (rate(authorizer_ciba_outcomes_total{outcome=~"denied|blocked"}[1h]))
/ sum by (client_id) (rate(authorizer_ciba_outcomes_total[1h]))authorizer_ciba_time_to_decision_seconds{outcome}: how long users take to decide.authorizer_security_events_total{event="ciba_channel_failed", reason="email"|"webhook"}: approval requests that could not be delivered.
Security summary
- Only opted-in service accounts can start a request; only the user, in their own recent session, on Authorizer's page, can approve.
- Organization-scoped agents can only reach members of their organization.
- Per-agent and per-user caps, blocks after a deny, and a per-client rate limit (60 requests/minute) bound approval fatigue.
- Tokens are delegated, bound to one external API and the approved action, valid five minutes, never usable at Authorizer itself, and cannot be exchanged for an unbound token.
- Every request, decision, expiry and token issuance is audited (Monitor it).
Not supported yet: ping and push delivery, user_code, signed requests, email or phone hints.