agentskit.js

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.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page