# Setup guide — Expense Audit & Compliance Agent

## 1. Install and connect your expense system

Install the agent and connect it to your expense/AP platform.

```
pipx install expense-audit-agent
expense-audit-agent connect --system concur
expense-audit-agent doctor
```

## 2. Configure limits and mode

The auto-approval cap and receipt rules are enforced deterministically, not by the model.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
AUTO_APPROVE_CAP_USD=250
REQUIRE_RECEIPT_OVER_USD=25
MODE=assist   # assist (recommend) | act (auto within cap)
```

## 3. Load your expense policy

Provide the structured policy the agent audits against. This is the only basis for flags.

```
# policy.yml
limits: { meals: 60, hotel_per_night: 300, mileage_per_mile: 0.67 }
receipt_required_over: 25
disallowed: ["alcohol_over_limit", "personal", "first_class_without_approval"]
per_diem: { domestic: 75 }
```

## 4. Backtest on past reports

Replay audited reports to compare the agent's findings to actual outcomes before going live.

```
expense-audit-agent backtest --range 90d --explain
# reports approve/flag accuracy and any missed violations
```

## 5. Wire into the approval flow

Route submitted reports to the agent. Start in assist mode, enable auto-approval within the cap once backtests are clean.

```
# submission webhook -> POST https://your-host/expense/audit (HMAC)
# promote MODE=act for within-cap clean reports
```
