hitl-escalate

Escalates blocked agent loops to humans via configured channels and writes BLOCKED.md to halt execution.

754|129|Updated Jun 30, 2026
One-click install
npx skills add https://github.com/Archive228/loopkit --skill hitl-escalate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hitl-escalate
Source: https://github.com/Archive228/loopkit/tree/main/skills/hitl-escalate
Command: npx skills add https://github.com/Archive228/loopkit --skill hitl-escalate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Long-running autonomous agent loops tend to guess when they hit ambiguous specs, missing credentials, or repeated failures, causing divergence that compounds across sessions. This Skill stops the loop cleanly and routes a structured question to a human before bad assumptions ship.

Core Features & Use Cases

  • Multi-channel escalation: Sends a structured five-line message via Telegram bot API, Slack incoming webhook, or a custom dial command configured through environment variables.
  • Guaranteed loop exit: Always writes a BLOCKED.md file with Question, Context, Attempted, and Choices sections, then exits with code 2 so run.sh halts until a human clears the file.
  • Strict trigger discipline: Escalates only on ambiguous specs, missing credentials, destructive actions needing approval, external dependency outages, or 3+ consecutive verify failures on the same task.
  • Use Case: An agent loop fails verification three times on a database migration that requires dropping a table. The Skill posts the question to Slack, writes BLOCKED.md with options A/B/C, and exits so the human can approve the destructive step and restart the loop.

Quick Start

Ask the agent to escalate the current blocked task to a human using the configured LOOPKIT_HITL_CHANNEL and write BLOCKED.md before exiting the loop.

Frequently Asked Questions about hitl-escalate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I escalate a blocked AI agent loop to a human?

Set the LOOPKIT_HITL_CHANNEL environment variable to telegram, slack, or dial, then trigger escalation when the loop is stuck. The agent sends a structured five-line message, writes BLOCKED.md at the repo root, and exits with code 2 to stop the loop.

When should an autonomous agent stop and ask a human?

Escalate on ambiguous specs with user-visible consequences, missing credentials, destructive actions like dropping tables or force-pushing, unreachable external dependencies, or three consecutive verify failures on the same task. Do not escalate for questions the repo documentation already answers.

Does hitl-escalate support Slack and Telegram notifications?

Yes, it supports Slack via an incoming webhook URL in LOOPKIT_HITL_SLACK_WEBHOOK and Telegram via a bot token and chat ID. A generic dial option runs any custom command with the message on stdin for SMS, ntfy, or pager gateways.

What happens if the notification channel fails?

A non-2xx response from the channel is treated as a soft failure. The agent logs the error and still writes BLOCKED.md before exiting, so the loop halts cleanly even when the notification never reaches the human.

How does a human unblock the loop after escalation?

The human reads BLOCKED.md, resolves the issue by editing PROMPT.md, adding the credential, or approving the destructive action, then deletes BLOCKED.md and restarts run.sh. The deleted file is the unblock signal the loop runner checks.