agentleFS
patonkikhpatonkikh/APES/skills/ai/human-in-the-loop-designer/skill.md

human-in-the-loop-designer

Skill3 starsChanged 4 months agoMITView on GitHub

Design human-in-the-loop (HITL) workflows for AI systems: review queues, escalation triggers, feedback loops, and SLA-backed approval gates. Use when deploying high-risk AI, production agents, or regulated decision support.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document what the AI may do autonomously vs what requires human gate.

    line 33
  2. Distinctive:

    Start with shadow mode: AI drafts, human sends, before any automation.

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

Human-in-the-Loop Designer

Purpose

Design human-in-the-loop (HITL) workflows: when humans intervene, how work is queued, and how feedback improves the AI system over time.

Input: AI use case, risk level, automation target, team roles, SLA requirements
Output: HITL Workflow Specification with triggers, queues, UI/API hooks, and metrics
Examples: See examples.md for worked input/output.


Workflow

Step 1: Assess automation boundary

Risk tierExamplesDefault HITL
LowDraft text, suggestionsOptional spot-check
MediumCustomer replies, code suggestionsSample review 5–10%
HighMedical, legal, financial decisionsMandatory approval
CriticalIrreversible actions (payments, deletes)Dual approval

Document what the AI may do autonomously vs what requires human gate.

Step 2: Define escalation triggers

Trigger typeSignalExample
ConfidenceModel score < thresholdClassifier < 0.7 → queue
PolicyGuardrail hitPII detected → block + review
UserExplicit request"Talk to a human"
AnomalyOut-of-distribution inputUnknown intent cluster
VolumeError rate spike>3% thumbs-down/hour

Each trigger maps to queue priority and assignee role.

Step 3: Design review queue

FieldPurpose
Case IDTraceability
AI draft + inputsReviewer context
Confidence + trigger reasonPrioritization
Suggested actionApprove / edit / reject
SLA deadlineOps accountability

Define states: pending → in_review → approved | edited | rejected | escalated.

Step 4: Design reviewer experience

  • Diff view — AI output vs policy template
  • One-click actions — approve, edit-and-send, reject-with-reason
  • Keyboard shortcuts — for high-volume queues
  • Audit trail — who decided what, when

Specify API or UI integration points (webhook, ticket system, Slack).

Step 5: Close the feedback loop

Reviewer actionSystem learning
EditStore (input, draft, final) as training/eval pair
Reject + reasonTag failure mode for eval set
ApprovePositive signal for monitoring

Route feedback to ai-evaluation-builder datasets and prompt iteration.

Step 6: Define HITL metrics and SLAs

MetricTarget
Queue wait time p95< 15 min (medium risk)
Review time medianTrack per category
Override rateMonitor drift; alert if >20%
Escalation rateBaseline + alert
Post-release incident rateZero critical after HITL

Step 7: Validate

Run Validation checklist.


Decision Rules

ConditionAction
Regulated domainMandatory HITL; document in governance pack
No human reviewers availableStop; do not deploy high-risk automation
Override rate > 30% for 7 daysPause auto-send; run prompt/workflow fix
Reviewer edits same field repeatedlyCreate dedicated rule or fine-tune
Latency SLA conflicts with HITLAsync path + user expectation messaging

Validation

  • Risk tier and automation boundary documented
  • ≥3 escalation triggers with thresholds
  • Queue schema and state machine defined
  • Reviewer actions and audit trail specified
  • Feedback loop connected to eval/improvement
  • SLAs per risk tier with alert thresholds
  • User-facing messaging for pending human review
  • Rollback path if HITL system fails

Anti-patterns

  • HITL theater — queue exists but reviewers always click approve.
  • No feedback capture — human edits discarded; system never improves.
  • Unbounded queue — no SLA; users wait indefinitely.
  • Reviewer without context — AI draft shown without inputs or policy.
  • Same gate for all risk levels — over-reviewing low-risk kills throughput.

Best Practices

  • Start with shadow mode: AI drafts, human sends, before any automation.
  • Sample-review low-risk paths; full gate only where regulation requires.
  • Instrument override reasons as structured tags, not free text only.
  • Pair with guardrails-builder for automated pre-queue filtering.
  • Reconcile HITL metrics weekly with product and safety owners.

Output Structure

# HITL Workflow: [System Name]

## Risk Assessment
| Tier | Autonomous scope | Human gate |
|------|------------------|------------|

## Escalation Triggers
| Trigger | Threshold | Queue | Priority |
|---------|-----------|-------|----------|

## Queue Specification
[State machine + fields]

## Reviewer UX
[Actions, integrations]

## Feedback Loop
| Action | Destination |
|--------|-------------|

## SLAs & Metrics
| Metric | Target | Alert |
|--------|--------|-------|

## Rollout Plan
[Shadow → partial → full automation]

Next Skills

OutcomeRecommended Skill
Build evaluation from overridesai/ai-evaluation-builder
Pre-filter before queuesecurity/guardrails-builder
Governance documentationsecurity/ai-governance-advisor
Orchestrate async workflowai/ai-workflow-builder
Threat model human bypasssecurity/ai-threat-modeling

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.