Safety, Security & Responsible AI·Question 50 of 70Advanced

Your agent buys things on behalf of users. Design the authorisation trail so a disputed transaction is resolvable.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

A log line saying the agent charged the card is not evidence. It is a row in your own database, written by the party under dispute. What resolves a disputed transaction is a chain of signatures produced at the moment each decision happened, with keys the agent operator does not control.

Full worked answer with diagram

A log line saying the agent charged the card is not evidence. It is a row in your own database, written by the party under dispute. What resolves a disputed transaction is a chain of signatures produced at the moment each decision happened, with keys the agent operator does not control.

A dispute asks three questions, and each needs its own signed artifact.

What the user authorised. Two shapes, and conflating them is the usual design error. Human present, the user sees the finalised cart and signs it: items, merchant, total. Human not present, the buy-the-tickets-the-moment-they-drop case, there is no cart yet, so the user signs constraints in advance: price ceiling, item specification, merchant set, validity window. Any later transaction must verify against them.

What the agent assembled. The merchant signs the finalised checkout, so the price cannot be revised afterwards.

What was charged. A payment authorisation bound to that specific checkout, not a free-floating card charge.

The binding is what teams skip. Each artifact carries a hash of the previous one, so nothing can be substituted later and the set only verifies as a whole.

AP2, the Agent Payments Protocol, standardises this. It launched in September 2025 with over 60 organisations including Mastercard, American Express, PayPal and Coinbase, reached v0.2 in April 2026, and has been contributed to the FIDO Alliance. The original Intent, Cart and Payment mandates became, in v0.2, a Checkout Mandate and a Payment Mandate, each with an Open form carrying user constraints and a Closed form bound to the finalised checkout by a checkout_hash claim, secured as SD-JWTs, with receipts referencing the mandates.

Two things most candidates miss. The signing key must sit where the model cannot reach it, on a trusted surface such as the user's device, or you are back to self-attestation. And absence is evidence too: an agent that transacted with no verifying mandate has told you whose loss it is.

This is the concrete form of the defence the confused-deputy and denial-of-wallet answers gesture at. An injection can steer the agent but cannot mint a user signature, and a signed price ceiling is a spend limit enforced outside the model rather than inside its prompt. Keep mandates and receipts for the full chargeback window.

Worth sketching. Each stage signed and hash-bound to the one before, which is what makes the set hold up.

flowchart TD
    A["User signs constraints or a specific cart"] --> B["Agent negotiates a checkout"]
    B --> C["Merchant signs the finalised checkout"]
    C --> D["Payment mandate hash-bound to it"]
    D --> E["Receipts reference both mandates"]
    E --> F["Dispute resolved by verifying the chain"]

What a good answer covers

  • A log line saying the agent charged the card is not evidence
  • It is a row in your own database, written by the party under dispute
  • What resolves a disputed transaction is a chain of signatures produced at the moment each decision…
  • A dispute asks three questions, and each needs its own signed artifact
  • Two shapes, and conflating them is the usual design error

Key terms: What the user authorised · What the agent assembled · What was charged

Interviewer follow-ups to expect

  1. The user's constraint said under 200 and the agent found the item at 195 plus an 18 delivery fee. Whose reading binds, and where in your design is that decided?

  2. What changes when the counterparty is also an agent and no human is present on either side?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep