Agentic
Approval Card
The agent asks before it acts: what it will do, why, and the details, with Deny and Approve. Denying can tell the agent what to do instead, and a decision folds into one line.
Usage
With the AI SDK
Show the card while a tool part is approval-requested. A note given with a denial reaches the model as its reason. Decisions made by a rule arrive with isAutomatic set.
With TanStack AI
tool-call parts in the approval-requested state carry the input. Pass the person's answer to your app's handler.
Examples
Answered
A decision a rule made, and a denial with the person's note for the agent.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Name the action in the title as a verb phrase, say why in the description, and list what will happen in details. Pass a denial's note to the agent so it can change course. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | The application runs the action and stores the decision. Approval Card only reports Approve, Deny, the note, and Always allow. |
| Scope | Use it for actions that are hard to undo, such as sending, deleting, or paying. For a tool call already on screen, Tool Call asks inline. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | — | The action the agent asks to take, such as Send the October newsletter. It names the card. |
| | — | pending shows Deny and Approve; approved and denied fold the card into one line that opens to what was asked. |
| | — | Why the agent asks, such as the AI SDK's requestReason, and label and value rows for what will happen. |
| | — | Called with the person's choice. Deny first asks what the agent should do instead; the note is optional and comes back as note. |
| | false | Shows Always allow this action. Your app remembers the choice and stops asking. |
| | false | The decision came from a rule, shown as Approved automatically. note shows the reason given with a decision. |