To make an AI agent get human approval before it changes anything, split every change into two steps: a preview that shows exactly what will change and writes nothing, then a separate confirm step that only runs after a person says yes. Tie that yes to the one preview, let it expire after a few minutes, and check the inputs again when it's confirmed, so an approval can't be reused or stretched to cover something else.
What does human in the loop mean for an AI agent?
Human in the loop means a person makes the decision at a defined point in the work, and the agent can't get past that point without them. For an agent that reads and changes business data, such as prices, stock items or orders, the point that matters most is just before anything is written.
Which jobs need that check at all is a separate question, covered in how much an AI agent should be allowed to do: act, draft or escalate. Approval for code changes is different again, and our vibe coding best practices cover it. This post is about how the approval itself works when an agent changes live business data.
How do you make an AI agent get human approval before it changes anything?
Give the agent two tools for each kind of change instead of one. The first prepares the change and shows it. The second carries it out, and only for a change the first tool prepared. In practice it runs in three steps.
Our examples come from the change tools we designed for our own Linnworks MCP server. The hosted service we sell today is read-only and doesn't offer them, so read them as a worked example of the pattern, not a product description.
Step 1: the preview writes nothing
The preview shows exactly what will change: which record, the current value and the new one. It should read the current values live from the system, not from memory, so the "before" column is true at that moment. A good preview also lists what won't change. When our Linnworks server previews a new order, every optional field is listed, set or not, so the person can see what will be left at the system's default.
Nothing is written at this step. The preview tool only reads, and it says so.
Step 2: a person says yes
The agent shows the preview to the person who owns that decision, as it is, without summarising it into something vaguer. Then it waits. The instruction attached to our preview tools is blunt: show the preview exactly as written, ask whether to go ahead, and only confirm after the person explicitly says yes. A "sounds good" about a different change, or silence, isn't a yes.
Step 3: the agent confirms that one action
Only now does the agent call the confirm tool, and it can only confirm a change that a preview set up. It can't hand the confirm tool a fresh set of values. The confirm tool carries out what was previewed, reports the result and records it.
Tie the yes to one preview, and let it expire
An approval should cover one specific change and nothing else. The simplest way to do that is to give each preview its own confirmation ID. The pending change is stored under that ID, and the confirm tool looks it up rather than accepting new instructions.
Three rules make that ID safe:
- It works once. Our server deletes the pending change before carrying it out, so a retry can't run the same change twice.
- It expires. On that server, a preview that hasn't been confirmed expires after 10 minutes. After that, the agent has to run the preview again and ask again, with fresh values.
- It belongs to one account. The ID is stored inside that account's own space, so an ID from another account can never resolve.
Check the inputs again at confirm time
A lot can change in ten minutes. Someone might sell the last unit, or a member of staff might edit the same item. So the confirm step shouldn't trust the preview blindly. It should check its inputs again, and where the facts matter, read them again.
Archiving stock items is a good example. The preview refuses any item that still holds stock, is committed to an open order or is due on a purchase order. Then, right before it writes, the confirm step reads the stock again. If anything has moved since the preview, nothing is archived and the agent says why. There's more on that case in how to archive stock items in Linnworks safely.
Catch mistakes before the approval too. When an order address has a country the system doesn't recognise, the preview refuses straight away, so the person isn't asked to approve something that will fail.
Cap batch sizes and flag unusually large changes
Limits in the tool turn a typo into a refusal instead of a mess. Our design uses its own settings, which suit that product rather than standing as recommended numbers:
- up to 50 SKUs in one retail price preview;
- up to 100 stock items in one archive or restore preview;
- one order per order preview.
Price changes of more than half, up or down, or from a zero or missing price, are refused unless the person has explicitly asked for a change that large. The agent then has to check with them and run the preview again with that permission stated.
The same thinking applies to bulk work generally. Start with one SKU, check the result, then a small batch, then the rest.
Never route around the preview
A preview step is only worth having if the agent can't skip it. If an agent can reach the same system through a raw API call, it can make a change nobody saw. The rule is simple: where a tool offers a preview and confirm pair, the agent always uses it, and it never reaches for a direct API call to save a step.
The easiest way to keep that rule is to make it the only door. Give the agent the preview and confirm tools, and no other route to write.
Keep an audit record of every confirmed change
Approval tells you a person said yes. An audit record tells you what happened afterwards. On our server, every confirmed change is written to an audit log: the tool, the SKUs, prices, order IDs and references, and the result. Failures are logged too, with the error. Entries are kept for 90 days, and they leave out delivery addresses and note text, because those can hold customer details.
Be honest about partial failures as well. If a price change fails halfway through a batch, the error should list the SKUs that were already updated, so the person knows where things stand.
What happens when an agent triggers a human-in-the-loop approval?
Here's how it looks from the person's side, using a price change on SKU [EXAMPLE]:
- You ask the agent to change the retail price.
- The agent runs the preview. You see a small table: the SKU, its title, the current price, the new price and the change.
- The agent asks whether to go ahead. Nothing has changed yet.
- You say yes. The agent confirms, the price is updated and the change is written to the audit log.
If you say no, or don't answer, nothing happens and the pending change simply expires. If you say yes after the preview has expired, the agent runs the preview again and shows you current values before asking once more.
Can MCP itself ask the user to confirm?
Yes, in a way. The MCP architecture overview describes a feature called elicitation, which lets a server ask the user for more information or for confirmation of an action, through the AI app. It only works where the AI app supports it, because each app declares which features it handles.
The Linnworks design described here uses a preview tool and a confirm tool instead, so the approval shows up in the conversation itself. The hosted Linnworks server we sell today is read-only; there's more on it in what the Hosted MCP Server for Linnworks does for Claude users.
Want an AI assistant that reads your Linnworks account live and can't change it? Try the read-only Hosted MCP Server for Linnworks, with a 14-day free trial.