AI
AI SDK Patterns
PatternsLearnnewComposeGitHub
PatternsComposeLearnAI SDK DocsGitHub

Built with AI SDK · shadcn/ui · Next.js

© 2026 AI SDK Patterns

Part of The loop → Controlling agent runs

Human-in-the-Loop

Pause AI execution to get human approval before executing sensitive tool calls. Uses tool confirmation flow with the AI SDK.

workflowsintermediate

🔒 Demo mode - requires human approval for sensitive actions

Install this lab

Option 1: shadcn CLI

pnpm dlx shadcn@latest add https://ai-sdk-patterns.vercel.app/r/human-in-the-loop

Option 2: Copy or download

Use cases

Financial Transaction Approval

Create systems that require human verification for high-value transactions, fund transfers, and sensitive financial operations.

Medical Diagnosis Support

Build medical AI assistants that suggest diagnoses but require doctor confirmation before final recommendations.

Related labs

Tool Calling

Let the AI model call functions and use external tools with the multi-step tool loop.

Multi-Step Agent

Build an agent that orchestrates multiple tool calls in sequence, using stopWhen: stepCountIs() and automatic tool result forwarding.