Setting the file. One moment.
Subchapter 1.8
references/human-in-the-loop.mdMarkdown913 BView on GitHub
Choose the approval layer based on where execution must pause, then fetch its current documentation:
| Need | Documentation |
|---|---|
| Approve chat tool execution or run a browser-side tool | Chat agents (opens in a new tab) — needsApproval, approval responses, client tools, and custom denial messages |
| Pause a durable background task or collect MCP input | Human-in-the-loop patterns — workflow approval, timeout handling, and elicitation |
Distinguish approval responses from client tool outputs. When returning a custom tool error, check whether an explicit continuation is needed. Handle workflow approval timeouts before executing the gated action. Check installed SDK versions before adapting examples.