# Setup guide — Workflow Routing Agent

## 1. Install and connect handlers

Install the agent and register your destinations.

```
pipx install workflow-router-agent
workflow-router-agent connect --handlers ./routes.yml
workflow-router-agent doctor
```

## 2. Configure routing guardrails

Confidence gating and high-risk approval are enforced here.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
ROUTE_BELOW_CONFIDENCE=escalate
HIGH_RISK_REQUIRES_APPROVAL=true
EXECUTE_ACTIONS=false       # routes, never executes
```

## 3. Define the routing map

List the known destinations and high-risk intents.

```
# routes.yml
destinations: { billing: queue:billing, bug: agent:triage, howto: agent:kb, sales: team:sales }
high_risk: [account_deletion, payment, access_change, external_email]
unknown: queue:human_triage
```

## 4. Test routing

Run sample requests and review confidence and decisions.

```
workflow-router-agent run --request './sample.json' --explain
# prints intent + destination + confidence + decision (route/approve/clarify/escalate)
```

## 5. Wire as the front door

Route all incoming requests; gate and escalate per policy.

```
# incoming request -> router -> known handler / approval / clarify / human triage
```
