← Build your first agent

Lesson 4 of 5, 11 min with the exercise

Add approvals and limits

Make sure a bad run costs little.

Assume it will sometimes do the wrong thing, then design so that's cheap. Sort actions by how easily they can be undone.

  • Easy to undo, like tagging a ticket: let it act and log it.
  • Hard to undo, like sending an email or moving money: a person approves first.
  • Very damaging, like deleting records: don't give it the tool.

Also set a maximum number of steps and a spending limit per run, so a confused agent stops instead of looping. Log every tool call with its inputs. When something goes wrong, the log is how you'll find out why.

See it in practice

Before going live, ask three questions of each action: what's the worst it could do, how would we notice, and how would we undo it? If you can't answer the second or third, that action isn't ready to run without approval.

Common mistake: Asking for approval on everything. People start clicking yes without reading. Save approvals for actions that deserve the attention.

Try it

Write the approval rule for each of your tools. Then decide who approves, and how quickly they'd need to respond for this to still save time.

You're done when

  • Every tool has an approval rule
  • Runs stop at a step and cost limit
  • You can read the log of any past run