Asking a person before acting
The photo book is laid out and costs $58, under your limit, and the printer wants your yes before an agent spends your money. This lesson works out which actions deserve a person's approval, what that approval must be tied to, how you can give it from your phone while the assistant works elsewhere, and how to keep approvals meaningful.
An order that needs a yes
The layout is finished. The book has 32 pages and costs $58 including shipping, just under your limit. Should the assistant simply place the order? You set the limit, so arguably it should. But spending money is the kind of action you may want to see before it happens, and the printer agrees. Its policy for orders placed by agents is that each one needs the customer's explicit approval. You, meanwhile, are on a train.
Most of an agent's actions do not need anyone's approval. Reading the album, choosing photos and laying out a draft are easy to redo and affect nobody else. The actions that deserve a person's yes are the ones that cost money, cannot easily be undone, or reach other people: paying, sharing, deleting, and sending messages.
The service that owns the action is the one that should require approval, because it is the one that can enforce the requirement. If the assistant only promised to ask first, the promise would be one more instruction it could be talked out of. The printer refuses orders from agents that do not carry an approval, so the question is settled no matter what the assistant decides.
Approval and a narrow grant do different jobs. The grant from Delegating authority to an agent says what the assistant could do at most: one order up to $60. Approval confirms one particular action within that limit, at the moment it happens.
What an approval must bind
The weakest kind of approval is a message in the assistant's chat: "Shall I go ahead?" and you reply "yes". What did you approve? The assistant wrote the description, so you saw only what it chose to show you. And the printer has only the assistant's word that you agreed.
A meaningful approval has three properties. It is shown by the party that will enforce it, here the printer's own authorization serverIn OAuth, the service that handles a person's sign-in and approval and decides which tokens to issue to a client. It may belong to the same company as the API, but its job is separate., not in text the agent composed. It is specific: the item, the amount, where it ships. And it produces authority for exactly that action, once, for a short time. The printer saved the finished layout as draft book-7730, and in the printer's app on your phone, the request to order it looks like this:
printer.example
Approve an order placed by assistant.example?
Photo book "Lisbon trip", 32 pages, hardcover
Draft book-7730
$58.00 including shipping
Ship to: your saved home address
Code shown by the assistant: TRAM-42
[Approve] [Decline]All domains, credentials, and tokens in these examples are fictional. The code at the bottom is the binding message from Binding the authentication to the request. The assistant shows the same code in its chat, so you can confirm that the request on your phone is the one your assistant started and not some other request that arrived at the same moment.
Authority for one action, once, also decides what the assistant does when something goes wrong. Suppose the printer creates the order, and then your train enters a tunnel and its reply never reaches the assistant. From where the assistant sits, the order may or may not exist. Sending it again is the one thing it must not do: the tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret. covered one order, so a second attempt would need you to approve again, and if the first one went through you would pay for two books. The assistant records the order as unresolved and asks the printer about something with a name that cannot change, the approved draft book-7730. The token cannot place another order, but the printer lets it read the status of the one order it was approved for, and nothing else:
GET /orders?draft=book-7730 HTTP/1.1
Host: orders.printer.example
Authorization: Bearer demo-order-token
HTTP/1.1 200 OK
Content-Type: application/json
{"order": "ord-5531", "draft": "book-7730", "status": "placed", "total": "58.00"}The order is there, so the assistant tells you it went through and carries on. Asking costs nothing, because a lookup changes nothing. An answer that no order exists for book-7730 would be less certain than it looks, because the first request may still be in progress and finish just after the lookup, as Keeping systems in sync found for provisioningCreating accounts in applications, keeping their attributes and access current, and disabling them when people leave, without waiting for each person to sign in. SCIM is a standard way to send those changes.. The assistant would keep the order unresolved and ask again about the same draft a little later. Only once the printer confirms that the attempt finished without creating an order would trying again, with a new approval from you, be the right move.
Try it: is this approval enough?
Simulation. These approval requests are made up. Checking an answer happens in your browser and sends nothing.
Approving away from the screen
You are not at a browser, so the printer cannot send you through an ordinary redirect. Instead, the assistant asks the printer's authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. server directly, over a back channel, to get your approval for this order. The authorization details are shown unencoded here so they are readable:
POST /bc-authorize HTTP/1.1
Host: auth.printer.example
Content-Type: application/x-www-form-urlencoded
client_id=assistant
&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer
&client_assertion=demo-signed-client-assertion
&scope=openid
&login_hint=cust-1182
&binding_message=TRAM-42
&authorization_details=[{"type":"photo_book_order","actions":["create"],"draft":"book-7730","amount":{"currency":"USD","value":"58.00"}}]The authorization server first checks the request against the limit you already granted, so a request for more than $60 would be refused without disturbing you. It answers with an identifier for the pending request, then notifies you in the printer's app, where you confirm it is you and approve. Meanwhile, the assistant asks the token endpointThe authorization server address where clients exchange an authorization code, refresh token, or other grant for tokens, in a direct request rather than through a browser redirect. every few seconds whether the request has been decided, and is told authorization_pending until you answer. When you approve, it receives an access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in. for this order only: draft book-7730, at $58.00. The printer's order APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests. accepts the order with that token and would refuse any other.
This is the OpenID ConnectAn identity layer on top of OAuth 2.0 that lets an application sign people in with an account at another service. It adds the ID token, standard claims, and discovery to the OAuth exchange. Client-Initiated Backchannel AuthenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do., CIBA, that Following a CIBA exchange walked through, here in the poll mode from Poll, ping, and push modes. For agents it fills a real gap: the agent works where you are not, and you approve where you are.
When approvals stop meaning anything
Suppose the assistant asked for approval at every step: each photo the selection agent chose, each page it laid out. By the tenth request you would be approving without reading, in the same way that repeated sign-in prompts wear people down in Codes, links, and approval prompts.
Approvals stay meaningful when they are rare and specific. Ask only for consequential actions. Show the details that matter and nothing else. Make declining as easy as approving. Limit how many approval requests one agent can send in a short time. And treat an approval request you did not expect as a warning sign, worth reporting rather than dismissing.
Stepping up for the approval
An approval proves something only if the person approving is really you. Anyone holding your unlocked phone could press Approve. For a $58 photo book, the printer may accept a recent sign-in in its app. For a larger amount, it can ask for fresh and stronger authentication before the approval counts, such as a passkeyA credential that your phone, computer or password manager creates for one website and keeps for you, unlocked with a fingerprint, face or PIN. Nothing you could type is sent, and it works only for the site it was made for, which helps it resist phishing. with your fingerprint or PIN, the way Authentication policy and SSO asked for it before sensitive actions.
The token the assistant receives can record how you authenticated when you approved, with the claims from What a token can say about sign-in. The printer's order API reads them and checks that the approval met its policy before it charges you, so a yes from an unlocked phone in someone else's hand does not pay for a large order.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Approve one exact print order and see changed or replayed orders refusedApprove one exact photo book order on the person's own device, see a changed amount and a replay refused, then recover from a lost reply without ordering twice.