Search

Search components and blocks

Sign in

Built from the Dialog and Switch components.

Agent Tool Approval Dialog

Pro

The pattern every agentic AI app needs before it runs something on the user's behalf — the risk badge, the literal command it's about to execute, an 'always allow' escape hatch for repeat calls, and Deny/Approve actions with the same confirm-then-close ActionSwapButton pattern as the cookie dialog. It opens as a Center Morph Modal: the dialog unfolds from its exact center and folds back the same way.

pnpm dlx shadcn@latest add @ditherui/tool-approval-dialog

Props

Risk badgepulsing dot + label — swap color/copy per risk levelamber ("Caution")
Command<pre><code> — the literal command/args the agent wants to run—
Always allow this commandSwitch — persists a standing approval for this exact calloff
Denycloses without running anything—
ApproveActionSwapButton — confirms "Approved", then closes the dialogresetAfter: 1100ms

Suggested components