Agentic Engineering from First Principles All chaptersLecturesLabDownload the book
Part V · Engineering Reliable Agents

Chapter 25: Human-in-the-Loop

Central questionWhen should an agent act autonomously, when should it ask a human, and how do permissions ensure that approval actually constrains execution?

Lecture

Chapter principle

Autonomy is engineered permission. A capable model becomes an autonomous system only through the authority that the surrounding software grants it. Approval, permissions, budgets, identity and override define where that autonomy stops.

Key takeaways

Experiments

Every experiment in the book is small, runnable and printed with its real output. In the Lab you can replay a recorded real run of each one, with no programming, and watch what the model and the agent do.

Experiment 46: Human approval

How do you make sure a person approved exactly this action?

Sending an email needs a person’s approval. A real model, given the task and an email tool, proposes the email. Software does not send it: it records a fingerprint of the exact action (recipient, subject, text) and waits for a person. A reviewer approves. Then software tries to send the original email, a copy whose recipient was changed by hand, and the original again two hours later. Times are minutes on a test clock. This is a recorded run of a real model; the email’s wording will differ in a new run.

Experiment 47: Permissions

How does an agent get only the authority it needs?

An agent holds a list of permissions: it may read search results and draft emails, but not send them. Software checks three actions against that list. Then a real model, told nothing about its permissions, is asked to email a proposal and must choose between drafting and sending. The email tool checks permission itself before sending. Finally the agent hands work to a helper that asks for more than the parent has, and one permission is taken away mid-task. This is a recorded run of a real model; a new run may choose differently.

All the code for this chapter: github.com/agentic-engineering-book/code

This is Chapter 25 of Agentic Engineering from First Principles: thirty chapters, a case study and fifty-nine executable experiments, from a single model call to controlled, self-improving agents.
Download the bookBrowse all chapters
← Chapter 24: Failure and RecoveryChapter 26: Security →