suiss/ui · AI
Confirmation
Asks for approval before an agent runs a tool, then shows the call as a step once the person answers.
Confirmation asks the person for a yes or no before a tool runs. The question is an Item with Deny and Approve buttons. Once the person answers, the call becomes a Tool row.
A pending approval is a prompt, not activity, so it sits outside the Trace.
Installation
Confirmation is built with the Item, Button and Trace components.
Or use the suiss/ui CLI:
Usage
After the answer, replace the item with a row that says what happened: "Ran rm -rf dist" or "Denied rm -rf dist".
AI SDK
While the part is approval-requested, answer with the approval id. Pass sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithApprovalResponses so the chat continues once every approval has an answer.
Approve streams the tool output. Deny streams output-denied. Either way, the part becomes a Tool row. Set needsApproval on the tool on the server to ask first.
API Reference
Accessibility
- Put the command in the item title, so the question names what will run.
- Deny comes before Approve, so the safe answer is reached first with Tab.
- Once answered, the buttons are removed and the row title says the outcome in words.
Confirmation on mobile is built from the same parts as on the web: Trace, Code Block, Button, Message, Bubble. The example above is a static demo; connect it to your agent by rendering the same parts from your messages.
Installation
API Reference
See Trace, Code Block, Button, Message, Bubble.