Skip to content

ApprovalPrompt

Stable

A pause that asks a person before the assistant does something important.

Also known as confirmation, approve deny, human in the loop, confirm action

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

High risk

Delete 14 archived projects

high risk
This permanently removes 14 projects from the workspace Acme Studio. It cannot be undone.

An action that cannot be undone, in amber with a red label. There is no Always allow.

When to use it

Stops the assistant before an action that matters and says exactly what will happen. Approve and Deny sit side by side, so saying no is as easy as saying yes.

Made of: Shield icon · What it wants to do · Risk label · Details · Approve · Deny · Always allow (low risk only)

Use it for

  • Before the assistant sends, deletes, spends or shares something.
  • An action that cannot be undone: set risk to high.
  • A read-only action people may want to allow every time: set risk to low and pass onAlways.

Not for

  • Harmless actions that change nothing.
  • Choosing how much the assistant may do on its own: use PermissionModeSwitcher.
  • A question the assistant needs answered before it can go on: use AgentQuestionCard.

Do and avoid

Pay for the hotel

medium risk
Charge $240 for 2 nights at Casa Alfama, Lisbon.
Do. Says exactly what will be paid, and no is as easy as yes.

Continue

medium risk
This action may have effects.
Avoid. Vague words mean people approve without knowing what will happen.

Do

  • Name the real person, file or amount, so no one has to guess.
  • Make Deny as easy to find as Approve.
  • Set the risk by what the action does: can it be undone, and who does it reach.
  • Offer Always allow only for low-risk actions that just look.

Avoid

  • Do not ask about harmless actions. Too many questions teach people to click through.
  • Do not use vague words like This action may have effects.
  • Do not pre-select Approve for high-risk actions.
  • Do not expect Always allow on medium or high risk. It never shows.

On a phone

  • The action, risk badge and details fill the width, and the Approve and Deny buttons wrap onto a second line if they do not fit.
  • Every button has a 44px tap area on a touch screen, and Deny is the same size as Approve.
  • It sits in the page and does not open as a sheet, so place it where the person will see it without scrolling.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started