Skip to content

Approval Prompt

Requests an agent cannot carry out without you: who asks, what it wants to do, a preview of the action, and Approve / Deny. Decisions go straight back into the run.

On this page
Used for
  • Approve a refund
  • Run a shell command
  • Merge a change
  • Spend over budget
  • Send an email

Examples

Installation

npx knowns-ui@latest add approval-prompt
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

run
AgentRun
Read approvals from a run and emit decisions to it.
approvals / actors
Approval[] / Actor[]
Default[]
Plain data instead of a run.
onDecision
(approval, decision) => void
Called on every Approve or Deny.
history
number
Default3
Resolved requests kept under the pending ones.
empty
ReactNode
Defaultnothing
Shown when nothing is waiting and there is no history.
live
boolean
Defaulttrue
Announce new requests to screen readers. Turn it off for demos that ask on a timer.

What it handles

  1. 01Lists every request waiting for a person, newest first, with who asks, what it wants and how long ago.
  2. 02Shows a preview of the action under the title: a command, a diff or your own node through renderDetail.
  3. 03Sends Approve and Deny back into the run as an approval.resolve event, so the agent carries on.
  4. 04Keeps the last few decisions listed under the pending ones, so you can see what was just resolved.
  5. 05Announces a new request to screen readers through a polite live region, which you can turn off for demos.
  6. 06Reads from a run or from plain props, so it works inside an agent view or on its own.

States

New request
The card appears at once and the live region announces it
none
Press Approve or Deny
The button scales to 0.97
120ms, ease out
Decided
The card leaves the pending list and a row joins the history
none
Age label
The time since the request updates
every 5s, no animation
Reduced motion
The press does not scale
0ms

Works with

When to use

When to use

  • Approving a tool call before it runs: several requests wait for a human decision, each with a preview and Approve or Deny.
  • Review queues across runs, where people work through approvals one by one.

When not to use

  • One request inline in a chat thread, with risk and scope: use Autonomy & Permissions.
  • Confirming a destructive action of your own app: use Dialog.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Approval Prompt to my app and wire it to my own data.
  • I need approving a tool call before it runs: several requests wait for a human decision, each with a preview and Approve or Deny. Set that up with the Knowns UI Approval Prompt.
  • Which Approval Prompt props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "approval-prompt" }) and search_docs({ query: "approval prompt" }).

Need help?

Stuck on Approval Prompt, or found something off? We read every message.