INT
Oct 25HIL Tool Approval Basic
Chat assistant with human approval workflows for safe tool execution.
View Full Pattern on Desktop

Problems Solved
- Human approval workflows for AI tools
- Safe AI tool execution with oversight
- Interactive chat interface with streaming
- Rate limiting and abuse prevention
- Tool categorization and management
- Real-time approval feedback
- Type-safe tool processing
- Modular component architecture
Use Cases
- Content moderation with human oversight
- E-commerce shopping cart approval
- User registration management
- Payment processing workflows
- Weather information services
- Safe AI tool execution patterns
- Human-AI collaboration interfaces
- Approval workflow management
AI SDK APIs
streamTextgatewaystepCountIsconvertToModelMessagestool(tools:
Tags
aihuman-in-the-loopai-sdktool-approvalchat-interfacerate-limitingsafe-aiworkflow-management
Requirements
- Node.js
- 18+
- Memory
- 512MB
- Other
- OpenAI API key
- Upstash Redis
Environment Variables
External Services
openaiupstash
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View PatternView Pattern on DesktopRelated Patterns


HIL Needs Approval
Demonstrate tool approval with async generators. Includes real-time feedback, approval workflows, and interactive management.


Tool Input Lifecycle Hooks
Explore tool input lifecycle hooks: onInputStart, onInputDelta, and onInputAvailable. See how to track tool input generation in real-time during streaming.


Preliminary Tool Results
Return preliminary tool results using async iterables. Stream status updates during tool execution before the final result is available.


Tool API Context
Pass arbitrary context from generateText/streamText to tool execution via experimental_context. Access context in tool execute functions for dynamic behavior.
End of Pattern