1Sponsor

Tool Approval

Interactive approval prompt for AI tool calls with risk-level badge, args display, and auto-deny timeout

Terminal

Installation

pnpm dlx shadcn@latest add https://termcn.dev/r/tool-approval.json

Usage

import { ToolApproval } from "@/components/ui/tool-approval";
<ToolApproval
  name="execute_shell"
  description="Run a shell command on the host machine"
  args={{ command: "rm -rf ./dist" }}
  risk="high"
  onApprove={() => console.log("approved")}
  onDeny={() => console.log("denied")}
  timeout={30}
/>

API Reference

ToolApproval

PropTypeDefault
namestringrequired
descriptionstringundefined
argsRecord<string, unknown>undefined
risk"low" | "medium" | "high""low"
onApprove() => voidrequired
onDeny() => voidrequired
onAlwaysAllow() => voidundefined
timeoutnumberundefined