Agents
Human-in-the-loop
Gate tool calls behind approval. Surface reviews to humans before execution.
Gate a tool
import { makeTool } from '@agentskit/tools'
const deployTool = makeTool({
name: 'deploy',
description: 'Deploy to production',
schema: z.object({ service: z.string() }),
requiresConfirmation: true,
execute: async ({ service }) => deploy(service),
})Runtime pauses on invocation and emits
tool.awaiting-approval. Resume with chat.approve(toolCallId) or
chat.deny(toolCallId, reason).
UI
- ToolConfirmation — drop-in React / Vue / etc.
Patterns
- Auto-approve low risk: approve if cost under threshold; gate the rest.
- Review queue: persist
awaiting-approvalto a DB; humans approve from dashboard. - Double-sign: require two approvers; track via shared context.