# VerifiedX OpenAI Direct healthcare prior-auth agent+human starter

Protect a healthcare prior-auth execution workflow in a composed Python system built directly on OpenAI tool calling.

This starter mirrors a real healthcare RCM topology:

- the execution agent inspects the prior-auth case and authorization controls
- it retries the same EMR authorization update task twice
- VerifiedX blocks the update while clinicals and payer approval are still missing
- a prior-auth specialist resolves the blocker in the case system
- the same execution work item is re-dispatched and succeeds once the case is actually ready

## Run it

```bash
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
verifiedx doctor
```

Set env:

```bash
export OPENAI_API_KEY=...
export VERIFIEDX_API_KEY=...
export VERIFIEDX_BASE_URL=https://api.verifiedx.me
```

Run:

```bash
python run.py
```

What to check:

- `artifacts/scenario_report.json`
- `artifacts/verifiedx_diagnostics.jsonl`

You should see the same EMR update task block twice, a specialist resolution update the case, and the final retry succeed once the authorization is actually ready.
