Agents

Consent before a task

Ask the person for their OK before an agent gets a task, shaped like OpenID CIBA, in your app or by a one-time link.

Your backend can ask the person an agent will act for before the task exists. The person agrees to all or some of the actions, or declines. Once they agree, your backend polls for the task token. The task allows exactly what the person agreed to.

The flow follows OpenID CIBA (client-initiated backchannel authentication) in poll mode. It is for an app's own agents; MCP clients have their own consent screen in MCP sign-in.

Ask#

POST/v1/apps/:app_id/authz/agents/:slug/bc-authorizeApp key
login_hintstringrequired
Who to ask: an app user id, or an email or phone number of a user of this app.
actionsstring[]required
1 to 20 permission slugs. Each must be granted by one of the agent's roles.
resourcesstring[]
Objects the task may touch, as on a task.
binding_messagestring
A short line shown to the person, up to 200 characters, such as an order number they can recognise.
task_ttl_secondsinteger
Lifetime of the task once agreed. 60 to 86400. Default 1800.
requested_expiryinteger
How long the person has to answer, in seconds. 60 to 600. Default 300.
deliverystring
app (default): your app shows the request to the signed-in person. sms or email: Scute sends a one-time link to the hosted consent page, for agents with no screen.
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/agents/billing-assistant/bc-authorize \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{    "login_hint": "sam@example.com",    "actions": ["invoice:read", "invoice:refund"],    "binding_message": "Refund for order 1182",    "delivery": "sms"  }'
{ "auth_req_id": "cib_...", "expires_in": 300, "interval": 5 }

Keep auth_req_id on your server. A person can have at most 3 requests waiting at once.

Poll for the token#

POST/v1/apps/:app_id/authz/consents/tokenApp key
grant_typestringrequired
urn:openid:params:grant-type:ciba
auth_req_idstringrequired
From the ask.
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/consents/token \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{ "grant_type": "urn:openid:params:grant-type:ciba", "auth_req_id": "cib_..." }'

Until the person answers, the answer is an error with CIBA's codes. Poll no faster than every 5 seconds. Once they agree:

{  "access_token": "sct_...",  "token_type": "Bearer",  "expires_in": 1800,  "task_id": "TASK_ID",  "authorization_details": [{ "type": "scute_agent_task", "actions": ["invoice:read"] }]}

access_token is the task token, issued once. Its actions are the ones the person agreed to.

errorMeaning
authorization_pendingThe person has not answered yet
slow_downPolled within 5 seconds of the last poll
access_deniedThe person declined, the agent is suspended, or the person is banned or suspended
expired_tokenThe person did not answer in time
invalid_grantUnknown auth_req_id, or the token was already issued
unsupported_grant_typegrant_type is not the CIBA grant

Show the request in your app#

With delivery: "app", your frontend reads the signed-in person's pending requests and sends their answer, with their session token in X-Authorization.

GET/v1/auth/:app_id/authz/me/consentsSession token
{  "consents": [    {      "id": "CONSENT_ID",      "status": "pending",      "expires_at": "2026-11-19T10:05:00Z",      "agent": { "name": "Billing assistant", "description": "Answers billing questions and issues refunds." },      "binding_message": "Refund for order 1182",      "task_minutes": 30,      "actions": [        { "permission": "invoice:read", "sentence": "read invoices" },        { "permission": "invoice:refund", "sentence": "refund invoices", "needs_verification": true }      ]    }  ]}
POST/v1/auth/:app_id/authz/me/consents/:id/decisionSession token
decisionstringrequired
approve or deny.
actionsstring[]
With approve: the subset of the asked actions the person agrees to. Leave it out to agree to all.

Only the first answer counts. A second answer, or an answer after expiry, is 409 with request_closed.

With delivery: "sms" or "email", Scute sends the person a link to the hosted consent page on your app's hosted site (/agent-consent?token=cil_...). The page uses these endpoints, where the link's token is the proof:

GET/v1/auth/:app_id/agent-consents/:tokenLink token
POST/v1/auth/:app_id/agent-consents/:token/decisionLink token

They take and return the same shapes as the signed-in endpoints.

Errors on the ask#

StatuserrorWhen
409access_deniedThe agent is suspended
403access_deniedThe person is banned or suspended
404unknown_user_idNo user of this app matches login_hint
400invalid_scopeAn action none of the agent's roles grant
400invalid_requestBad action count, delivery, TTL or expiry, or no phone or email for the chosen delivery
429slow_downThe person already has 3 requests waiting