# Agent Permissions

> Decide what each mail agent may do: a matrix of capabilities by agent, each Off, Ask or Auto, read back as one plain sentence per agent. Guardrails cap daily sends, hold mail in quiet hours, ask before new recipients and limit forwarding domains. Outside agents connect over MCP with scoped keys you can revoke, and the same policy is shown as the JSON an agent runtime enforces.

- Slug: `agent-permissions`
- Category: [Email](https://www.assembli.design/category/email.md)
- Type: block
- Tags: email, agent, permissions, settings, matrix, mcp, guardrails
- npm dependencies: lucide-react
- shadcn/ui dependencies: button, input, @assembli/avatar, @assembli/chip, @assembli/confirm-popover, @assembli/number-stepper, @assembli/segmented-control, @assembli/switch, @assembli/underline-tabs, @assembli/unsaved-changes-bar
- Live preview: https://www.assembli.design/preview/agent-permissions
- Page: https://www.assembli.design/components/agent-permissions

![Agent Permissions preview](https://www.assembli.design/thumbnails/agent-permissions-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` (required) | `PermissionsValue` |  | The saved policy. Edits stay a draft until Save. |
| `onChange` | `(value: PermissionsValue) => void` |  | The new saved policy, after Save or a revoke. |
| `onAction` | `(action: MailAction) => void` |  | `{ type: "set_permission", actor, changes, policy }` on save; `{ type: "set_permission", actor, revoke: agentId }` on revoke. |
| `agents` | `MailAgent[]` | `DEFAULT_AGENTS` |  |
| `actor` | `Actor` | `{ kind: "human", name: "Ines Moreau" }` |  |
| `org` | `string` | `"Larkspur"` | Your organization's name, for "Forward outside …". |
| `mailbox` | `string` | `"ines@larkspur.co"` | The mailbox these rules govern. |

## 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-permissions/agent-permissions.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/agent-permissions
```

Registry item JSON: https://www.assembli.design/r/agent-permissions.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.
