# Tool Access Matrix block

> Agent Tool Access Matrix with Approval Routing and Run Policies

Per-agent tool governance: a DataGrid sets each tool's access mode (Auto Run, Approval, Blocked), rate limit, and approver, plus run-policy switches with save or discard. ReUI DataGrid, Filters, Frame; shadcn Switch, Select. Permissions, guardrails.

- Type: Pro block
- Category: [Agents](https://web.dev.reui.io/blocks/solutions/agents.md)
- Page: https://web.dev.reui.io/blocks/solutions/agents/solution-agents-4
- MCP: `get_block("solution-agents-4")`
- Built with: Badge, Button, Checkbox, Data Grid, Filters, Frame, Input, Item, Select, Separator, Switch, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

Auto Run, Approval and Blocked checkbox columns per tool, a rate limit format check that blocks Save and an approver team per row

## Agent notes

- Sample data: `AGENT_TABS`, `RUN_POLICIES`, `APPROVAL_ROUTING` and `RATE_WINDOWS`, whose two summary cards never follow matrix edits
- `handleSave` and `handleDiscard` only swap local drafts and fire a `toast`, so nothing is persisted
- The `environment` select only changes `toast` text, so `TOOL_RECORDS` and the policy drafts do not load per environment

## When not to use

- Workspace member roles and scoped permissions toggled per cell in a grid: use [Permission Matrix](https://web.dev.reui.io/blocks/solutions/users/solution-users-3.md) (`get_block("solution-users-3")`)
- One role's capabilities shown as a grid of outlined switch cards: use [Role Capabilities](https://web.dev.reui.io/blocks/application/settings/settings-5.md) (`get_block("settings-5")`)

## Third-party libraries

- TanStack Table v9: [API reference](https://tanstack.com/table/v9/docs/framework/react/reference/index), [docs](https://tanstack.com/table/v9/docs/framework/react/quick-start)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/solution-agents-4
```

## About Agents blocks

### When to use

- Run monitoring for a fleet of agents: a live overview, a run queue and failed run triage
- Human review of agent work: an approval inbox, one run's step trace and a nightly evaluation report
- Control pages for agent behavior: tool access, playbooks, run settings and stored memory

### When not to use

- One run narrated live to the person who started it, inside a chat or task view: use the [Agent Activity blocks](https://web.dev.reui.io/blocks/ai-agents/agent-activity.md)
- Model provider routing, prompt reviews, token spend and safety policies for LLM features: use the [AI Ops blocks](https://web.dev.reui.io/blocks/solutions/ai-ops.md)
- An account, workspace, notification or integration page of labeled switches and selects: use the [Settings blocks](https://web.dev.reui.io/blocks/application/settings.md)

### Agent notes

- Every block sets a `min-h-svh` wrapper with its own padding and max width in page.tsx, its root component or both; drop them inside an app shell
- No block mounts the `sonner` toaster, so every `toast` call stays invisible until your layout renders one
- No handler reaches a backend: actions change local `useState` and fire a `toast`, so wire each one to your agent API

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
