agentskit.js
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

Patterns

  • Auto-approve low risk: approve if cost under threshold; gate the rest.
  • Review queue: persist awaiting-approval to a DB; humans approve from dashboard.
  • Double-sign: require two approvers; track via shared context.
✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page