Sub topic 12
Where a person stays in the loop
This chapter assumes you have read the chapters on the agent loop, report generation and verification. You should be comfortable reading short Python functions and JSON. Here you decide which steps in a marketing reporting agent need a person's approval, and you add that approval step to the workflow.
Why a person stays in
Verification catches some errors, such as a number that no tool returned. It cannot judge whether a recommendation fits your budget, brand or legal limits. It also cannot take responsibility for a decision. A person can.
Human review costs time, so put it where a mistake is expensive or hard to undo. Skip it where a mistake is cheap and easy to fix.
Choosing review points
Rate each step by two questions. How bad is a wrong result? Can you undo it?
| Step | Risk if wrong | Reversible? | Review |
|---|---|---|---|
| Pull data from a read-only API | Low | Yes | None, but log it |
| Calculate metrics with code | Low | Yes | Spot checks |
| Draft an internal summary | Medium | Yes | Review before sharing |
| Send a report to a client | High | No | Approval required |
| Change a budget or pause a campaign | High | Hard | Approval required |
A common rule: the agent may read and draft on its own. It needs approval to publish, send or change anything outside its own workspace.
The approval gate
An approval gate is a point where the workflow stops and waits for a person's decision. The agent hands over the draft, the evidence behind it and the checks that failed, then waits.
The checks run first so the person's time goes to real judgment, not to catching typos or unsupported numbers.
A simple gate in code
This example uses the unsupported_numbers idea from the verification chapter. The draft cannot be published until the checks pass and a named person approves it.
import re
NUMBER = re.compile(r"\d+(?:\.\d+)?")
def unsupported_numbers(report, evidence):
used = set(NUMBER.findall(report))
allowed = set(NUMBER.findall(evidence))
return sorted(used - allowed)
def review_gate(report, evidence, approver=None):
"""Return a decision record. Publishing needs checks to pass and an approver."""
problems = unsupported_numbers(report, evidence)
if problems:
return {"status": "needs_fix", "unsupported": problems}
if not approver:
return {"status": "awaiting_approval", "unsupported": []}
return {"status": "approved", "approved_by": approver, "unsupported": []}
evidence = '{"ctr": 0.0167, "cpc": 0.84, "cpa": 17.5}'
report = "CPC was 0.84 and CPA was 17.5 this month."
print(review_gate(report, evidence))
print(review_gate(report, evidence, approver="dana"))The first call prints awaiting_approval. The second prints approved with the approver's name. Keep that record. It shows who accepted the report and what the checks found.
Making review effective
- Show the evidence next to each claim, so the reviewer does not have to hunt for the source.
- Put failed checks at the top of the review page.
- Let the reviewer reject with a comment, and feed that comment back to the agent.
- Record every decision with a time and a name.
Two failure modes are common. The first is rubber-stamping: if the agent is right 99 times, reviewers stop reading. Counter it by sampling cases where you planted a known error and checking that reviewers catch it. The second is a gate that blocks everything. If reviewers reject most drafts for minor style reasons, fix the prompt or template instead.
Exercise
An agent can pause a campaign when cost per acquisition passes a limit. The agent's metric tool is correct and its numbers pass every automatic check. Should pausing need human approval? Give one reason.
Show answer
Yes. Pausing a campaign changes a live system and loses delivery and learning time, so it is costly to undo. The checks only confirm the numbers match the data. They do not confirm that pausing is the right business choice, for example during a planned seasonal dip.