Run database migration?
High riskAgent wants to run a command on staging in acme-demo.
Auto-deny in1:00
npm run db:migrate -- --env=staging# applies 2 migrations · drops column invoices.legacy_totalThe agent asks before it acts: risk, what will happen in words, an exact preview of the command or diff, and Approve (⌘/Ctrl+Enter) / Deny (Escape) with an optional auto-deny countdown.
The agent asks before it acts. Not AlertDialog. Not InsightCard.
A high-risk command with a 60-second countdown. Approve (⌘/Ctrl+Enter) or Deny (Escape) resolves the card to one line; Reset brings it back.
Agent wants to run a command on staging in acme-demo.
Auto-deny in1:00
npm run db:migrate -- --env=staging# applies 2 migrations · drops column invoices.legacy_totalApprovalCard gates one side effect. Show the exact command or diff, never a paraphrase. Approve is the view's one solid primary. AgentPlan accepts a whole plan; AlertDialog interrupts the page.
import { ApprovalCard } from "agentic-ds-kit";From contracts/approvalcard.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| title | string | Yes | — | The question, e.g. "Run database migration?" |
| description | string | No | — | — |
| risk | low | medium | high | No | medium | Sets the risk Badge. |
| action | object | Yes | — | { kind: "command", command, note?, target? } or { kind: "diff", file, lines: { type: "context" | "add" | "remove", text }[] }. Shown exactly as it will run. |
| facts | array | No | — | { label, value }[], e.g. Will do / Why medium. What will happen and why the risk is what it is, in words, as a dl above the preview. The exact action still shows. |
| status | pending | approved | denied | expired | No | pending | Anything but pending renders the one-line resolved row. |
| variant | default | compact | No | default | compact is for AgentMonitor's waiting state only: one row with the title (and the countdown when countdownSec is set), one line of description, the exact preview and small right-aligned Deny and Approve with their key chips (Esc, ⌘⏎). No risk Badge, heading or facts; the risk is read to screen readers with the title. |
| waitingSec | number | No | — | Compact only: seconds the agent has already waited for this OK, shown as "waiting m:ss" in the title row and counting up while pending. Hidden when left out; ignored by the default variant. Not a deadline: use countdownSec for auto-deny. |
| countdownSec | number | No | — | Auto-deny countdown in seconds. At 0 the card calls onExpire, else onDeny. Pending only. |
| onApprove | function | No | — | Approve button (Check icon) and ⌘/Ctrl+Enter while focus is in the card. Plain Enter never approves. |
| onDeny | function | No | — | Deny button and Escape while focus is in the card but not on another control. |
| onExpire | function | No | — | Countdown reached 0. Falls back to onDeny. |
| resolvedBy | string | No | — | Resolved row, e.g. "you". |
| resolvedAt | string | No | — | Resolved row, e.g. "2s ago". |
| approveLabel | string | No | Approve | — |
| denyLabel | string | No | Deny | — |
Must-choose overlay that interrupts until the user cancels or confirms.
A recommended insight or opportunity as a compact card, with tone and optional actions.
What an agent intends to do, before or during a run.
Inline status banner that stays on the page.