> For the complete index of this site, see [llms.txt](https://alexdewison.com/llms.txt).

# Does the approval still match the basket?

A shopping agent has built a basket for Mira. She approves the exact items and total. The agent then tries to take payment. Change the basket after approval and see what a safe checkout does.

This is the text version of an interactive demo. The interactive version runs in your browser on mock data: [https://alexdewison.com/labs/agent-approval-matches-basket/](https://alexdewison.com/labs/agent-approval-matches-basket/)

## The demo, step by step

1. The basket the agent built

Trail running shoes, GBP 94.00, and standard delivery, GBP 0.00. Total GBP 94.00.

2. Merchant spending limit for agent orders

Choose GBP 150.00 or GBP 100.00.

3. Mira approves what she sees

Approve this basket, or Start again. Approving records the exact items and total, and the agent cannot edit that record.

4. The agent changes things, then asks to charge

- Agent adds trail socks, GBP 12.00
- Agent upgrades to express delivery, GBP 6.00
- Agent adds a second pair of shoes, GBP 94.00

Then use the button: Agent asks to charge.

## Decision

Approve the basket first.

That is the starting message. After that, the decision panel shows one of these results, in plain words:

- No approval on file: "No approval on file. Ask Mira before charging anything."
- Approved: "Approved. The record now holds these exact items and this total."
- Approval refused: "Cannot approve: total is over the merchant's agent limit of GBP 100.00" (the same message appears for any limit the basket total exceeds).
- Charge allowed: "Charge allowed: items and total match what Mira approved."
- Needs a new approval: "Needs a new approval: the basket changed after Mira approved it (GBP 94.00 approved, GBP 106.00 requested)."
- Blocked: "Blocked: GBP 188.00 is over the merchant limit of GBP 150.00, and it differs from the approval."

### Worked paths (default start: shoes GBP 94.00 plus standard delivery GBP 0.00, limit GBP 150.00)

- Ask to charge before approving: no approval on file, so ask Mira.
- Approve, then ask to charge with nothing changed: charge allowed, GBP 94.00 matches GBP 94.00.
- Approve, then tick trail socks (GBP 106.00 in total): needs a new approval, because the basket changed but is still within the GBP 150.00 limit.
- Approve, then tick the second pair of shoes (GBP 188.00 in total): blocked, over the GBP 150.00 limit and different from the approval.
- Tick express delivery (GBP 100.00 in total) after approval: needs a new approval.
- Choose the GBP 100.00 limit, tick trail socks (GBP 106.00) and try to approve: cannot approve, the total is over the merchant's agent limit.

## Record kept with the payment

No approval yet.

That is the starting record. Once Mira approves, it shows who approved, the items, the approved total, the requested total, the merchant limit, whether the items match and the decision.

## Why it matters

An approval is only useful if it records the exact items and total. Payment APIs should tie each charge to that record and ask again when anything changes.

Mock data only. Names and amounts are invented to show the idea: the approval is a record of the exact items and total that the agent cannot edit, so any change needs a fresh approval, and the merchant's own limit still applies.

---

Part of the [interactive payments demos](https://alexdewison.com/insights/demos/) by Alex Dewison. Mock data only.
