Have an agent ask its owner
Keep sensitive agent actions behind a user's approval; the agent asks, its business owner approves on their Approvals page, and the agent collects a token for that one action.
Dashboard and APIOpenID CIBA Core 1.0, RFC 9396
Some things an agent should do only after a named user says yes: pay, delete, send. You list the scopes that need
approval for each risk class. An agent of that class asking for one is told interaction_required; it then asks its
business owner, who approves or refuses on their Approvals page. If they approve, the agent gets a short-lived
token acting for the owner.
Before you start:
- Who can do it: a realm administrator (a group holding
RealmOwner) sets it up; the business owner answers. - Where: the API, with your session in
$CVYUH_SESSION(Call the API);mayaanswers on her Approvals page in the dashboard, with Allow or Deny. - What you need:
invoice-agentis registered withmayaas its business owner (see Register an agent).
Put an action behind approval
Section titled “Put an action behind approval”-
Offer the grant. Read the realm’s
grantTypesfromhttps://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Settings/oauth2Settings, then send them back with the backchannel grant added:Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Settings/oauth2Settings \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "grantTypes": ["…existing grant types", "urn:openid:params:grant-type:ciba"] }'Do the same on the agent’s client, at
https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/invoice-agent-client. -
Make sure the agent has a business owner, as in Register an agent, step 2.
-
Choose how the agent learns the answer. Poll:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/invoice-agent-client \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "backchannelTokenDeliveryMode": "poll" }'Or ping, with the address the realm calls:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/invoice-agent-client \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "backchannelTokenDeliveryMode": "ping","backchannelClientNotificationEndpoint": "https://agent.example.com/ciba" }' -
Say which scopes need approval, per risk class:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/agentSettings/agentSettings \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "agentGuardrails": {"high": { "maxTokenSecs": 120, "requireApproval": ["payments:send"] }} }'
Check it worked
Section titled “Check it worked”-
The agent posts to
https://foobar.cvyuh.com/oauth2/bc-authorize, proving itself, withscopeand abinding_message, and optionallyauthorization_detailsfor the owner to approve with them. It may name its owner with one hint,login_hint(their id or sign-in name) orid_token_hint, but only as a check: a hint naming anyone else is refusedunknown_user_id. More than one hint, or alogin_hint_token, isinvalid_request. It receives anauth_req_id, an expiry and a polling interval:Terminal window curl https://foobar.cvyuh.com/oauth2/bc-authorize \-d client_id=invoice-agent-client \-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer \-d client_assertion=eyJ… \-d scope=payments:send \-d login_hint=maya \--data-urlencode "binding_message=Pay invoice 4471 to Acme Ltd, EUR 1280"{ "auth_req_id": "1c266114-a1be-4252-8ad1-04986c5b9ac1", "expires_in": 300, "interval": 5 } -
The owner opens Approvals in the dashboard and sees the agent, its message (for example “Pay invoice 4471 to Acme Ltd, €1,280”), the scopes it asks for, and when the request expires. They choose Allow or Deny.
-
The agent collects. In poll mode it asks the token endpoint until it gets tokens,
access_deniedorexpired_token, waiting the interval between polls:Terminal window curl https://foobar.cvyuh.com/oauth2/token \-H "DPoP: <proof>" \-d grant_type=urn:openid:params:grant-type:ciba \-d auth_req_id=1c266114-a1be-4252-8ad1-04986c5b9ac1 \-d client_id=invoice-agent-client \-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer \-d client_assertion=eyJ…A poll sooner than that is told
slow_down, and the interval grows by five seconds each time; a poll that waits the whole interval is answered. In ping mode it also sent aclient_notification_token; the realm calls its registered address with it when the owner answers, and it collects the token once. -
Each token request carries a DPoP proof, as for any agent’s client held to FAPI 2.0. The token names the owner as
suband the agent inact. There’s no refresh token: the next action needs a new approval.
If the agent is quarantined or killed while it waits, it collects nothing. When it collects, the realm writes a
TOKEN_ISSUED record with the backchannel grant type, issued or refused, on the owner’s or the agent’s trail.
For what goes wrong most often, see
Backchannel authentication.
Undo it
Section titled “Undo it”Send that risk class’s entry again, with the scope left out of requireApproval.
Related
Section titled “Related”- Backchannel authentication: every rule a request is held to.
- Bounded approvals: the owner approves one exact action.
- Agent guardrails: limits by risk class.
- Let users remove agents.