Tool Approval

Preview

Allow this tool to run?
terminal.run
Approval required

The agent wants to run the project test suite in the current workspace.

Command
bun test tests/a11y.test.tsx
Directory
ui-components

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/tool-approval

API Reference

ToolApprovalCode

code
string
Default—
language?
"text" | "bash" | "diff" | "json" | "tsx" | "typescript"
Defaultbash
className?
string
Default—

ToolApproval

tool
ReactNode
Default—
title?
ReactNode
DefaultAllow this tool to run?
description?
ReactNode
Default—
parameters?
ToolApprovalParameter[]
Default[]
status?
"complete" | "pending" | "approved" | "error" | "approving" | "denied" | "running"
Defaultpending
open?
boolean
Default—
defaultOpen?
boolean
Defaultfalse
onOpenChange?
((open: boolean) => void)
Default—
onApprove?
(() => void)
Default—
onAlwaysAllow?
(() => void)
Default—
onDeny?
(() => void)
Default—
className?
string
Default—

Composition

Place executable source inside the approval request when the decision depends on reviewing it.

Message
└── MessageContent
    └── ToolApproval
        └── ToolApprovalCode

Note: Approval Card handles broader questions and review decisions. Agent Activity shows the pending and resumed execution context. Tool Result displays the outcome after an approved tool runs.

How it works

Tool approval is a permission boundary. The person must understand what will run, what access it needs, and whether their choice applies once or changes future behavior.

Also on React Native. Hold to let an agent run a tool.

Updated