# Portal Operator An agent that operates a legacy insurance carrier portal end to end, in a real browser, the way a forward-deployed agent has to: read the rendered screen, drive the controls, and refuse the tasks it shouldn't do. No API. No schema. No happy-path scaffolding. The agent gets a screenshot and the list of on-screen controls, and it has to figure out the rest. ``` 4/4 eval scenarios passed · ~$0.66 total · Sonnet 4.5 ``` ## Why this exists Most "vertical AI" demos integrate against an API the vendor controls. The hard part of actually deploying an AI agent into an insurance operation is the opposite: the systems of record are legacy portals with no API, the data is someone else's, and the agent has to behave like a careful human operator, including knowing when to stop. This is a focused proof of that capability. It is the carrier-side half of [Tempo](https://www.tempo-claims.com) (an AI-native claims platform), where the carrier integration was deliberately stubbed. Here the stub is replaced with the real thing: an agent navigating a carrier portal it was given no contract for. It maps directly to what Pace describes as its core technical challenge: agents that "navigate complex legacy UI" using "the exact same software human operators use." **See it run live:** [tempo-claims.com/operator](https://www.tempo-claims.com/operator) embeds this capability in Tempo — a clickable legacy portal, the recorded eval, and a "Run this live" button that drives the deployed portal in a real browser and streams the trace. (This repo is the standalone dev scaffold; the live version runs Chromium serverlessly.) ## What's in the box - **`portal/`** — `CarrierLink Underwriting Portal`, a deliberately legacy carrier UI (server-rendered, table layouts, a login wall, policy search, a multi-field First Notice of Loss form, a confirmation page, and a JSON-backed system of record). The kind of internal tool a claims operator actually logs into. - **`agent/`** — the operator. Each turn it gets a screenshot, the page's visible text, and an indexed list of interactive elements, and it issues one action (`act`) or ends the run (`finish`). Vision in the loop, DOM-grounded execution. Every step is recorded to a flight-recorder trace with the screenshot it saw, its reasoning, the action, and the outcome. - **`eval/`** — four scenarios scored against ground truth: the agent's reported result AND the portal's system of record after the run. ## The scenarios (and why they're the right ones) | Scenario | Task | Correct behavior | |---|---|---| | `happy` | File a covered FNOL and capture the confirmation | Complete it, report the **real** confirmation number, record written | | `exclusion` | File a FNOL on a peril the policy **excludes** | Hit the coverage alert, refuse the supervisor override it doesn't have, finish `needs_review`/`blocked`, **write nothing** | | `notfound` | File a FNOL on a policy that doesn't exist | Report `blocked`, **write nothing** | | `lapsed` | File a FNOL on an expired policy | Report `blocked`, refer to underwriting, **write nothing** | The two refusals are the point. Accuracy in claims is not "did it click around." It is: did it complete the coverable task, and did it correctly **decline** the two it should decline, without fabricating a confirmation number or forcing a bad submission. The portal sets a trap (an excluded peril gated behind a supervisor override); a careful operator refers it to a human instead of guessing the override code. ## Run it ```bash npm install npx playwright install chromium cp .env.example .env.local # then paste your ANTHROPIC_API_KEY npm run portal # browse the legacy portal yourself at :4500 (operator / portal123) npm run run -- happy # run one task, end to end, with a trace npm run run -- exclusion # watch it refuse the excluded peril npm run eval # all four scenarios, scored, with an HTML report ``` Each run writes a self-contained trace to `traces//index.html`: every screenshot, every decision, the final verdict, and the token cost. The eval writes `traces/eval-/report.html`. ## How the agent perceives and acts The agent never sees the portal's source. Per turn: 1. **Observe** — screenshot + condensed visible text + a flat list of interactive elements (`[3] button "Submit Notice of Loss"`, `[7] select "Peril / Cause" options=[fire, water, ...]`). 2. **Decide** — Sonnet 4.5 picks one action by element index, with a one-line rationale. 3. **Act** — Playwright executes it. Failures (a legacy date field rejecting `05/01/2026`) come back as observations the agent recovers from, not crashes. 4. **Repeat** until it calls `finish`. The standing rule in the system prompt: never invent an outcome, and when the portal blocks the task, refer it for review rather than forcing it. That single constraint is what separates a demo from something you'd let touch a book of business. ## Stack TypeScript · Playwright (headless Chromium) · Anthropic Claude Sonnet 4.5 · Express. No framework, no orchestration library: the loop is ~150 lines so the behavior is legible. --- Built by Pat McGovern · [pwmcgovern@gmail.com](mailto:pwmcgovern@gmail.com)