Keep a person in the loop for actions that matter

Decide which agent actions need a person's approval, and design the approval step.

Your agent can read and draft on its own as much as the task needs. Before it does anything with an effect outside your app, it has to stop and wait for a person to approve. The approval should be quick to give and impossible for the agent to skip. Every decision should go in a log, so that later you can drop approval for the action types that have shown they don't need it.

Read, draft and act actions

Start by putting everything your agent can do into one of three groups. A read action looks something up and changes nothing. Checking an order, searching documents, reading stock levels and converting a price are reads. If a read goes wrong, the worst it can do is give the agent bad information, and that gets caught elsewhere.

A draft action prepares something but doesn't send or change it. Writing a reply to a customer, filling in a refund form and preparing a calendar invite are drafts. A draft can be wrong, but nothing has happened yet.

An act action changes the world and has an effect outside your app. Sending an email, issuing a refund, cancelling an order, posting a message, updating a record and making a booking all count as acts, and some of them can't be undone.

The agent may read and draft freely, as much as the task needs, within the limits set in lesson 5.2. Before any act, the agent stops and a person approves. This is the confirmation step from lesson 4.3, "Check every argument before you act on it", applied across a whole agent run.

Marcus runs a business that sells to customers and uses an agent to handle customer emails. The agent became good at the work: it looks up orders, checks stock and drafts replies. Marcus wanted to stop checking each one, so he let it send replies and issue refunds by itself for a day on a test account. Most of its actions were correct. A customer mentioned two order numbers, and the agent sent the refund to the wrong one. Another reply promised next-day delivery to Johor Bahru, which Marcus doesn't offer. If a person had glanced at either one before it went out, neither problem would have happened.

What the approval card shows

The approver can only judge what is on the screen in front of them. A vague prompt like "agent wants to issue a refund, approve?" is useless, because the approver would have to redo the agent's work to decide. The approval card should show the exact action with the exact data. For an email, the card shows the full text, the recipient and the subject, exactly as they will be sent.

Marcus's refund card shows the customer's name, the order number, the item, the amount in Singapore dollars, the card the refund goes back to, and the customer's original message, with the sentence that prompted the refund highlighted. With the message and the order number on the same screen, he can see at once whether the agent picked the wrong order.

Give the approver two buttons, approve and reject. A rejection asks for a one-line reason, and that reason goes back into the agent's notes. Keep each approval to one screen with all the facts and one click. If every approval means 3 minutes of digging (an illustrative figure), people start approving without reading, and then the step protects nothing.

Build it so the approval can't be skipped. Your code receives the button press and then runs the action. The model must never be able to call the act tool directly or mark anything as approved on its own.

Logging every approval and rejection

For each decision, record the action, the exact data, who approved or rejected it, when they did it, and the reason for any rejection. Store this approval log next to the agent's step log from the same run, so you can read the two side by side.

The log's first use is tracing problems. When something goes wrong, the log shows whether the agent proposed something wrong or whether a person approved a wrong proposal without reading it, and each of those needs a different fix. Its second use builds up over time: it shows how often each action type is approved without changes, and you need that record before you loosen anything.

Removing approval for one action type at a time

Approving everything forever gets tiring, and once the agent seems reliable you'll be tempted to drop approval altogether. Only remove it when the log gives you evidence, and only for one action type at a time. Start with action types that are low risk and easy to undo. Anything involving money, deletion or legal commitments should stay behind a person for much longer.

Marcus has approved two hundred order status replies without changing one, so it is reasonable to send those automatically. His refunds are rejected or edited one time in twenty, so refunds still go to him for approval.

Once an action type runs automatically, you still need a way to bring approval back. Marcus reads a sample of ten automatic replies a week, and if he finds a bad one, that reply type goes back behind approval.

Before you can set rules like these, you need a list of everything your agent could do. The activity below asks you to write it.

List every action your agent could take. Mark each one as read, draft or act, and write the approval rule next to it.

Course

Junxiong-WFG Organisation is an authorised representative of AIA Financial Advisers Private Limited (Reg. No. 201715016G).