# Setup guide — E-commerce Order Support Agent

## 1. Install and connect commerce systems

Install the agent and connect it to your order, tracking, and policy systems.

```
pipx install order-support-agent
order-support-agent connect --platform shopify --carrier shippo
order-support-agent doctor
```

## 2. Configure verification and caps

Identity verification and refund caps are enforced deterministically.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
VERIFY_BEFORE_REVEAL=true
REFUND_AUTO_CAP_USD=100
RETURN_WINDOW_DAYS=30
```

## 3. Load policy

Provide the return/refund/cancellation policy the agent must act within.

```
# policy.yml
returns: { window_days: 30, condition: unused }
refunds: { auto_cap_usd: 100, over_cap: escalate }
cancellation: { allowed_until: 'pre_fulfillment' }
```

## 4. Dry-run on past tickets

Replay historical support tickets to check decisions before going live.

```
order-support-agent backtest --range 30d --explain
# reports resolution + a hard check: over-cap/unverified reveals (must be 0)
```

## 5. Wire into support intake

Route order tickets/chat to the agent; over-cap and disputes auto-route to a human.

```
# support channel -> agent; decision=ESCALATE -> human queue with context
```
