# Agent Approval Queue

> Where mail agents ask before they act: a reply to send, an invoice to forward, lists to unsubscribe from, a meeting to move. Each card shows the agent, an editable preview, its reason, the rule that asked you, the risk in plain words and the exact tool call. Approve, edit or reject from the keyboard; rejections tell the agent why, and approvals wait out an undo window.

- Slug: `agent-approval-queue`
- Category: [Email](https://www.assembli.design/category/email.md)
- Type: component
- Tags: email, agent, approval, human-in-the-loop, queue, keyboard-shortcuts, undo
- npm dependencies: motion, lucide-react
- shadcn/ui dependencies: button, input, textarea, @assembli/avatar, @assembli/classic-checkbox, @assembli/empty-state, @assembli/radio-group, @assembli/tooltip
- Live preview: https://www.assembli.design/preview/agent-approval-queue
- Page: https://www.assembli.design/components/agent-approval-queue

![Agent Approval Queue preview](https://www.assembli.design/thumbnails/agent-approval-queue-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` (required) | `ApprovalItem[]` |  |  |
| `onAction` | `(action: MailAction) => void` |  | Approvals arrive after the undo window closes (or at once if the queue unmounts), as `{ type: "approve", ids, actor, call, changes? }`. Rejections arrive at once as `{ type: "reject", ids, actor, age… |
| `agents` | `MailAgent[]` | `DEFAULT_AGENTS` |  |
| `actor` | `Actor` | `{ kind: "human", name: "Ines Moreau" }` | Who is deciding. |
| `undoMs` | `number` | `6000` | How long an approval can be undone before it runs, in ms. |
| `title` | `string` | `"Approvals"` |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/agent-approval-queue/agent-approval-queue.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/agent-approval-queue
```

Registry item JSON: https://www.assembli.design/r/agent-approval-queue.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
