agentskit.js
UI + hooks

ToolConfirmation

Human-in-the-loop approval UI for guarded tool calls.

Shown when a tool's requiresConfirmation is set. Approve or deny forwards to chat.approve / chat.deny. Blocks the run until resolved.

Props

PropType
toolCallToolCall
onApprove() => void
onDeny(reason?: string) => void

Example

{chat.messages
  .flatMap((m) => m.parts)
  .filter((p) => p.type === 'tool-call' && p.status === 'awaiting-approval')
  .map((tc) => (
    <ToolConfirmation
      key={tc.id}
      toolCall={tc}
      onApprove={() => chat.approve(tc.id)}
      onDeny={(reason) => chat.deny(tc.id, reason)}
    />
  ))}

Per-framework

Surface is identical to ToolCallView. Angular: <ak-tool-confirmation>.

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page