# Model Routing Policy block

> AI Ops Routing Rules Settings with Risk-Tiered Policy Toggle Grid

Full-page AI routing controls: per-route policy toggle grid, provider fallback Select with validation, and reset confirmation. ReUI Frame, Badge; shadcn Switch, Select, Dialog, Dropdown Menu. AI platform ops, model settings, risk management.

- Type: Pro block
- Category: [AI Ops](https://web.dev.reui.io/blocks/solutions/ai-ops.md)
- Page: https://web.dev.reui.io/blocks/solutions/ai-ops/solution-ai-ops-5
- MCP: `get_block("solution-ai-ops-5")`
- Built with: Badge, Button, Dialog, Dropdown Menu, Field, Frame, Item, Label, Select, Separator, Switch
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

Route cards for 4 risk tiers with 4 policy switches each, some locked, and a fallback select that fails save while Restricted has none

## Agent notes

- Sample routes live in `routingRules`, `policyControls` and `providerOptions`, and `lockedControlIds` marks switches the user cannot change
- `handleSave` only toasts Routing saved, and the Export JSON and Copy Rules menu items have no handler
- Save validation and reset only read `restrictedRule`, the fourth entry of `routingRules`, so keep Restricted there

## When not to use

- Ranking connected providers by priority with a pause switch per provider: use [Provider Connections](https://web.dev.reui.io/blocks/solutions/ai-ops/solution-ai-ops-2.md) (`get_block("solution-ai-ops-2")`)
- Privacy rows where each row carries a switch, a button or a button pair: use [Privacy Controls](https://web.dev.reui.io/blocks/application/settings/settings-2.md) (`get_block("settings-2")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/solution-ai-ops-5
```

## About AI Ops blocks

### When to use

- Model operations dashboards that track provider health, token volume and spend against a budget cap
- Provider connection and routing pages that set priority order, fallback providers and risk tier controls
- Prompt, feature flag and token usage registries, a prompt editor and a safety policy wizard

### When not to use

- Autonomous agent runs, tool permissions and human approval of agent actions: use the [Agents blocks](https://web.dev.reui.io/blocks/solutions/agents.md)
- A bare table for your own columns and rows, with no provider or token sample records: use [Data Grid](https://web.dev.reui.io/components/data-grid.md) (`get_component("data-grid")`)
- A KPI tile and trend chart overview for a fulfillment, staffing, revenue or payouts team: use the [Dashboard blocks](https://web.dev.reui.io/blocks/application/dashboard.md)

### Agent notes

- Each page.tsx wraps the block in a `min-h-svh` container; remove it when the block sits inside your app shell
- No block calls an API: changes stay in local `useState` or uncontrolled inputs, so wire each save, switch, export and row action to your backend

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.
