Tool Approval

Confirm tool actions inline

Add inline tool approval cards to your AI chat interface with the Vercel AI SDK — users confirm or cancel agent actions directly in the message thread. This human-in-the-loop UI pattern is essential for any AI that takes real-world actions like sending emails, creating records, or modifying data.

  • AI assistants that send emails, schedule meetings, or post to social media
  • Database-modifying agents that need explicit write confirmation
  • Financial applications where AI-suggested transactions need approval
  • Workflow automation with human checkpoints at critical decision points

Tech stack

Vercel AI SDKNext.jsReactTypeScriptuseChatshadcn/ui
npx shadcn@latest add https://shadcnagents.com/r/ai-elements-confirmation
Delete all inactive users from the database
Claude needs to run a destructive operation. Please confirm:
Confirmation Required

Action

deleteUsers({ where: { lastActive: { lt: "2024-01-01" } } })

This will permanently remove 847 inactive user records