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
| Prop | Type |
|---|---|
toolCall | ToolCall |
onApprove | (toolCallId: string) => void |
onDeny | (toolCallId: string, 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={(id) => chat.approve(id)}
onDeny={(id, reason) => chat.deny(id, reason)}
/>
))}#Per-framework
Surface is identical to ToolCallView. Angular:
<ak-tool-confirmation>.
#Related
#Trusted application proposals
Trusted application UI can enter the same confirmation flow without fabricating a model response:
const call = await chat.proposeToolCall({
id: crypto.randomUUID(),
name: 'send-email',
args: { to: 'ada@example.com' },
})The tool must be registered with requiresConfirmation: true. The configured validateArgs checks its schema before the canonical call appears. This method never executes the tool; use the existing approve or deny handlers.
Headless controller users can import proposeToolCall(controller, proposal) from @agentskit/core/tool-proposal. The helper resolves the tool and validator through a controller-bound capability, so validation and later execution share one authority.
Explore nearby
- PeerUI + hooks
Every AgentsKit UI binding exposes the same contract. Pick the framework; the API stays the same.
- PeeruseChat
The one hook every framework binding exposes. Same input, same return, same events.
- PeerChatContainer
Headless scrollable transcript container. Auto-scroll on new messages, virtualized-ready.