Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q11EasyConcept

What is human-in-the-loop (HITL), and where should you place it in an agent?

30-second answerSay your answer out loud first, then reveal.

Common HITL patterns

  1. Approve / reject a proposed tool call, e.g. "Send this email to the client?"
  2. Edit the proposed action or arguments before execution.
  3. Review the output before it's published.
  4. Ask for clarification when the request is ambiguous.
  5. Escalation / handoff to a human agent entirely.
An agent's proposed action goes through a risk check: low-risk actions execute directly, while high-risk or low-confidence ones pause and save state for a human, who approves or edits the action into execution or rejects it with feedback back to the agent.

Implementation detail that impresses interviewers: HITL requires durable state. The agent may wait hours for approval, so you can't keep the process running in memory. Frameworks like LangGraph checkpoint the state, interrupt, and resume from the checkpoint when the human responds (see Q24).

Designing risk tiers

  • Read-only actions: auto.
  • Reversible writes (draft, label): auto with logging.
  • Irreversible or external (send, pay, delete, deploy): approval required.
  • Amount thresholds: refunds above X need approval.

Common mistakes

  • Approval fatigue. If every step needs approval, humans stop reading.
  • Showing the human a raw JSON blob instead of a clear summary of what will happen.

Little by little, you're building something great.