Skip to main content

Design an agent that handles refund requests for an online store.

Agents and tools · Intermediate 3

Short answer

The agent reads the request, looks up the order through read-only tools, checks it against the refund policy, and drafts a decision. Small refunds that clearly meet policy go through automatically; anything above a threshold or unclear goes to a person with the evidence. Tools are narrow, every step is logged, and I measure accuracy against past decisions before launch.

Deeper answer

Start with the policy, not the model: which refunds are automatic, which need approval, which are refused. The agent's tools should be narrow and least-privilege, for example get_order, get_delivery_status and propose_refund, with the payment action behind an approval step or a hard amount limit.

Customer messages are untrusted input, so instructions inside them must not change what the agent may do. Evaluate on a set of real past requests with known correct outcomes, track the refund amount and error rate after launch, and keep an easy route to a human for angry or complex cases.

What a strong answer covers

Answer it out loud in the mock interview about 1.5 min

Follow-ups to expect

Common mistakes

Learn it

Human approval steps

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.