# Setup guide — Prior Authorization Agent

## 1. Install and connect in a HIPAA-aligned environment

Install the agent inside your compliant environment and connect it under minimum-necessary access.

```
pipx install priorauth-agent
priorauth-agent connect --ehr epic --payer-rules ./payer-rules/
priorauth-agent doctor   # checks access scope + audit logging
```

## 2. Configure boundaries and PHI handling

Lock the agent to administrative scope. These boundaries are enforced in config, not just the prompt.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
ADMINISTRATIVE_ONLY=true       # cannot approve/deny or judge necessity
MINIMUM_NECESSARY_PHI=true
ESCALATE_CLINICAL=true
SUBMIT_REQUIRES_APPROVAL=true
```

## 3. Load payer requirement sets

Provide each payer's documented prior-auth checklists per service/code so completeness checks are accurate.

```
# payer-rules/acme-health.yml
MRI_lumbar_72148:
  required: ["conservative_treatment_6wk", "recent_clinical_note", "prior_imaging_report", "signed_order"]
# (administrative documentation items only — no necessity criteria to 'decide')
```

## 4. Dry-run on a request

Run a completeness check and review the present/missing breakdown before any submission.

```
priorauth-agent check --request REQ-8841 --explain
# prints requirements_checked, missing[], administrative_status, disclaimer
```

## 5. Wire into intake (human submits)

Route new requests for a completeness pass; staff review and submit. The agent never submits a decision.

```
# intake webhook -> POST https://your-host/priorauth/check
# READY packets queue for staff review + approved submission
```
