From agentic-skills
A hybrid pattern where the system pauses execution to request human approval, input, or disambiguation before proceeding with critical actions. Use when user asks to "add human approval", "require human review", "human-in-the-loop", or mentions approval workflows, human oversight, or escalation.
npx claudepluginhub lauraflorentin/skills-marketplace --plugin agentic-skillsThis skill uses the workspace's default tool permissions.
Human-in-the-Loop (HITL) bridges the gap between full automation and manual control. It treats the human user as a "privileged tool" or "approver". This is crucial for high-stakes domains where AI errors are unacceptable, or for ambiguous tasks where human intuition is required to guide the agent.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Human-in-the-Loop (HITL) bridges the gap between full automation and manual control. It treats the human user as a "privileged tool" or "approver". This is crucial for high-stakes domains where AI errors are unacceptable, or for ambiguous tasks where human intuition is required to guide the agent.
def hitl_workflow(user_request):
# Step 1: Plan/Draft
plan = agent.create_plan(user_request)
# Step 2: Risk Assessment
if is_high_risk(plan):
# Step 3: Pause for Approval
# Send notification to user UI
approval = notify_user(
message="Agent wants to execute the following plan:",
payload=plan
)
if approval.status == "REJECTED":
return "Action cancelled by user."
elif approval.status == "EDITED":
plan = approval.new_plan
# Step 4: Execute
return agent.execute(plan)
Input: "Require human approval before the agent sends any email."
def send_email_with_approval(draft):
# Present draft to human
approval = review_queue.submit({
"type": "email_approval",
"content": draft,
"timeout_hours": 4
})
if approval.status == "approved":
email_client.send(draft)
elif approval.status == "rejected":
agent.revise(draft, feedback=approval.comment)
else: # timeout
escalate_to_manager(draft)
Output: Email sent only after explicit human approval, with full audit trail.
| Problem | Cause | Fix |
|---|---|---|
| Humans are a bottleneck | Too many approval requests | Raise the automation threshold; only require approval above risk score 0.8 |
| Agent waits indefinitely | No timeout configured | Set approval timeout; define auto-escalation path on timeout |
| Reviewer lacks context | UI shows only the action | Include full context: why the agent wants to take this action |
| Feedback loop never closes | No mechanism to learn from rejections | Log rejection reasons; update agent guidelines after 10+ similar rejections |