Skip to content

AI 104 · Module 5

Execution, Verification & Human-in-the-Loop

After the agent takes the next step, how do we know we can continue?

Start Section 1
0 / 5 completed
Sync my progressJoin a session to keep progress across devices and share it with your instructor

Info

After you join, your completed lesson numbers are sent to your instructor together with your learner code, so they can see your progress. Use the codes your instructor gave you, and do not enter your name, company secrets or other personal data. Progress is kept with the rest of that session's data.

Learning objectives

  • Describe the execution model: Decision, Execute, Verify, Accept?, then Continue, Retry, Route Elsewhere or Human Review
  • Choose a verification method and explain why confidence alone is not enough
  • Distinguish Human Review, Human Approval, Human Escalation and Human Override
  • Mark a Tool Step and recognize six simple failure modes with a basic fallback
  • Complete Activity 5 by placing AI execution, automatic verification, human review, human approval and stop or fallback in a workflow

Execution and verification

6 min

After the next step, how do we know we can continue?

Once a step is decided, it is executed. But a workflow that only decides and executes has no way to notice a bad result. Verification is the step that asks: is this output acceptable, and can the workflow continue?

Core question

After the agent completes the next step, how do we know the result is good enough to continue?

Execution model
  1. Decision: the next step has been chosen
  2. Execute: the step produces an Output
  3. Verify: check the Output
  4. Accept?: if yes, Continue to the next step
  5. If no: Retry, Route Elsewhere, or send to Human Review

Info

Text version of the diagram: Decision leads to Execute, then Verify, then a question, Accept? A yes continues the workflow. A no leads to one of three paths: Retry the step, Route Elsewhere (a different branch), or Human Review.

Warning

A Stop condition matters too. Decide in advance when the workflow should stop instead of retrying forever, for example after a set number of attempts.

Key takeaway: Every executed step needs a check, and every failed check needs a defined next path.

6 min

Verification: how do we check a result?

There is more than one way to verify an output. Pick the method that matches the risk of the step.

Common verification methods
MethodHow it worksSuited to
RuleCheck format, required fields, ranges or lengthOutputs with a clear structure
Reference sourceCompare with a trusted document or recordFacts, figures and policy statements
ComparisonCompare with a previous result or a second answerSpotting unexpected changes
Second model passA separate model call reviews the first outputA quick screen, never a final guarantee
Human reviewA person reads and judges the outputHigh-impact, ambiguous or sensitive results

Confidence is how sure the system seems about its own output. It is a useful signal for routing, for example low confidence goes to a person, but a confident answer can still be wrong. Do not treat confidence as proof.

Warning

A second model pass can share the same blind spots as the first. For important results, add a rule, a reference source or a person.
Check yourself

An agent drafts a summary of a policy and says it is "very confident". What is the best next design?

An agent drafts a summary of a policy and says it is "very confident". What is the best next design?

Key takeaway: Choose a verification method to match the risk. Confidence is a signal, not proof.

Human-in-the-Loop

6 min

Human-in-the-Loop: review, approval, escalation, override

Human-in-the-Loop (HITL) means a person has a defined role inside the workflow. It is not a vague promise to "have someone look at it". Four patterns cover most cases.

Four Human-in-the-Loop patterns
PatternWhat the person doesExample (simulated)
Human ReviewReads the output and corrects or accepts itA staff member checks a drafted reply before it is sent
Human ApprovalGives an explicit yes or no before an action happensA manager approves a payment before it is made
Human EscalationTakes over when the workflow cannot proceed or is unsureA hard case is passed to a specialist
Human OverrideStops or replaces what the workflow was doingA person cancels an automatic action or changes its outcome

Info

Human, AI, Human: a person defines the task, AI assists or executes, and a person reviews and remains responsible. Where you place the human step depends on the impact of the action, not on how well the AI usually performs.
Check yourself

A workflow is about to send a payment. Which HITL pattern fits best before the action happens?

A workflow is about to send a payment. Which HITL pattern fits best before the action happens?

Key takeaway: Place a person by impact: review, approval, escalation or override, each with a clear role.

Tool steps, failures and practice

6 min

Tool Steps and six simple failure modes

Some steps need something outside the agent: a search, a database, an email service, a calendar, an API or an enterprise system. In AI 104 you only need to notice these steps and mark them.

Tool Step placeholder

Write "Tool Step" on the Canvas wherever an external tool or data source is needed, and note what it should do. How an agent connects to a tool safely, and how tools are described, is the subject of AI 201 (MCP). It is not taught here.

Six simple failure modes
Failure modeWhat happensBasic fallback
Missing inputA required piece of information is not thereAsk the requester, or stop with a clear message
Low confidenceThe system is unsure of its own outputRoute to Human Review
Invalid outputThe output fails a format or content checkRetry a limited number of times, then Human Review
Unavailable toolAn external service does not respondStop or wait, and tell a person. Do not guess the result
Ambiguous requestThe request can be read in more than one wayAsk a clarifying question
Unsafe actionThe next action could cause harm or exceed permissionStop and escalate to a person for approval

Info

Boundary of this course: these are simple failure paths. Designing full failure-recovery architecture, such as saved progress and automatic resumption, belongs to a future advanced course.
Check yourself

A step needs to read a record from an enterprise system, but the system does not respond. What is the safest basic fallback?

A step needs to read a record from an enterprise system, but the system does not respond. What is the safest basic fallback?

Key takeaway: Mark Tool Steps, and give each simple failure mode a basic fallback.

6 min

Activity 5: Where should a human step in?

Take a workflow (a simulated one, or your own task from earlier modules) and mark where each of five elements belongs.

The five elements
ElementQuestion to ask
AI executionWhich steps can the AI carry out?
Automatic verificationWhich results can a rule or reference source check?
Human reviewWhich results need a person to read them?
Human approvalWhich actions need an explicit yes first?
Stop / fallbackWhen should the workflow stop, retry or hand over?
  1. Mark AI execution
    Show the steps where the AI produces an output.
  2. Add verification
    For each output, choose how it is checked.
  3. Place the human
    Add review, approval or escalation where the impact is high.
  4. Write the fallback
    State what happens when a check fails, and when the workflow stops.

Warning

Privacy reminder: use simulated or already-public workflows. Do not enter company secrets, client personal data or unauthorized sensitive information.
Check yourself

In a workflow that emails a customer, where should human approval go?

In a workflow that emails a customer, where should human approval go?

Key takeaway: Put human approval before irreversible actions, and define when to retry, hand over or stop.

What next?