A mandate is a tamper-proof, digitally signed record of what a user allowed an agent to do. Shops, banks and dispute teams can all check it.
Introduction
Before the agent starts, you sign a short list of limits, for example:
One 65 W USB-C charger, at most 50 dollars in total, delivered by Friday, verified sellers only- the agent may buy anything that fits these limits, and nothing that does not
- it is like a narrow power of attorney: limited in what, how much and how long
How a mandate follows the purchase
Google's Agent Payments Protocol (AP2, now with the FIDO Alliance) links each step with a digital signature:
- you sign the limits (the open mandate)
- the agent builds the cart and the shop signs it
- the cart is locked to its total of 47.85 (the closed mandate)
- the payment network and the bank check the chain
If you are watching, you see the final cart and approve it yourself. If you are away, the agent may approve for you, but only within your signed limits.
Payment tokens and agent identity
- never give the agent your card
- it gets a token that works only for this agent, these shops, up to a limit, for a short time, like a hotel key card instead of a master key
- the agent digitally signs its requests to the shop, so shops can let trusted agents in and keep bad bots out
Remembering tip
Three locks, three jobs. The mandate says what is allowed, the token limits how much can go wrong, and the identity says who is asking.
Worked example
Check both carts against the signed limits, the way simple code and not the LLM would:
| Limit | VoltMate cart | SuperCharge cart |
|---|---|---|
| Total at most 50, with delivery and GST | 47.85, pass | 65.18, fail |
| 65 W USB-C charger | Pass | Pass |
| Delivered by Friday | Thursday, pass | Wednesday, pass |
| Verified seller | PowerHub, pass | TechDealz88, 3 weeks old, fail |
| Decision | Approve and pay | Refuse, and tell you why |
The item price of SuperCharge (49.90) looks under budget, and its hidden text tells the LLM to buy it. A few lines of code that compare the final total with your signed limit are not fooled.
Code
from dataclasses import dataclass
DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Next Monday"]
@dataclass
class Mandate:
"""The signed limits of the user (an open mandate). allows() is plain, deterministic code."""
max_total: float = 50.00
must_contain: str = "65 W"
deliver_by: str = "Friday"
verified_only: bool = True
def allows(self, cart):
"""Return (ok, reasons): ok is True only if the cart meets every limit."""
reasons = []
if cart["total"] > self.max_total:
reasons.append(f"total {cart['total']:.2f} is over {self.max_total:.2f}")
if self.must_contain not in cart["name"]:
reasons.append("wrong product")
if DAYS.index(cart["arrives"]) > DAYS.index(self.deliver_by):
reasons.append(f"arrives {cart['arrives']}, after {self.deliver_by}")
if self.verified_only and not cart["verified"]:
reasons.append(f"seller {cart['seller']} is not verified")
return not reasons, reasonsThe total must include delivery and GST, so it is computed with Decimal to avoid rounding errors with money:
from decimal import Decimal, ROUND_HALF_UP
GST = Decimal("0.09")
def total_with_gst(item):
"""Item price + delivery + 9% GST, rounded half-up to the cent: what you actually pay."""
raw = (Decimal(str(item["price"])) + Decimal(str(item["delivery"]))) * (1 + GST)
return float(raw.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP))
# VoltMate: (39.90 + 4.00) * 1.09 = 47.85, SuperCharge: (49.90 + 9.90) * 1.09 = 65.18Notes:
allowsreturns the reasons as well, so a refusal can be sent back to the LLM as an observation- text in a listing cannot talk its way past a check that runs in code
A mandate is one defence among several, and the risks it answers are in Agent Security Risks.