Halcyon Bay
The autonomous billing office for nonprofit hospitals.
Inspiration
Medical debt is a serious problem in the United States, but some patients are being billed for care they should have received for free or at a discount.
The Consumer Financial Protection Bureau highlighted at least $2.7 billion in medical bills potentially eligible for financial assistance that were still billed to patients. In 2024, a Washington state settlement required Providence to provide $157.8 million in medical debt relief and refunds to nearly 100,000 people.
Nonprofit hospitals face an equally challenging operational problem: financial assistance rules are complicated, records are scattered across systems, and regulations change. In California, laws effective in January 2025 strengthened protections around income documentation, assets, and medical debt collection.
We asked: What if an autonomous AI system could run the billing office, catch past mistakes, protect patients, and still know exactly when to ask a human?
That's why we built Halcyon Bay, guided by one principle: the right money from the right people.
What it does
Halcyon Bay is an autonomous system of work that performs the responsibilities of a billing specialist and financial assistance screener at a nonprofit hospital.
It processes patient accounts across six simulated source systems, investigates billing records, evaluates financial assistance eligibility, and proposes appropriate actions.
It can:
- Discover historical mistakes: Review past decisions and identify potentially unlawful financial assistance denials.
- Process accounts autonomously: Propose free care, discounted care, payment plans, or reversals based on verified evidence.
- Protect patients: Block prohibited collection actions and flag cases requiring human intervention.
- Learn from staff: Transform counselor corrections into persistent precedents and backtested policy proposals requiring approval.
- Explain every decision: Preserve evidence, approvals, rejections, and state changes in an append-only audit trail.
Our day-one discovery
Onboarding Halcyon Bay with 18 months of synthetic hospital records uncovered 32 potentially unlawful financial assistance denials: 24 patients should have received free care, and eight should have received discounted care.
Together, these cases represented $222,032.72 in proposed patient financial relief, including $31,789.89 in potential refunds.
The system generated evidence-backed reversal proposals requiring compliance-officer approval. Its independent evaluation matched all 40 historical findings against a hidden answer key, with no additional findings.
These are simulated financial outcomes, not actual patient refunds.
How we built it
1. A system of work, not another system of record
We modeled a fictional 300-bed California nonprofit hospital with more than 1,700 historical accounts, six source systems, and 149 deliberately challenging cases.
Rather than replacing existing billing databases, Halcyon Bay synchronizes their records into persistent work items managed by the autonomous system and hospital staff.
Each account moves through defined states, including screening, proposal, approval, rejection, and posting. A dedicated gateway controls sensitive financial actions.
2. Claude for evidence-grounded understanding
We integrated Claude Opus 5.5 through the Anthropic API to interpret messy pay stubs, benefit letters, staff notes, and historical denial reasons.
Claude transforms unstructured documents into structured facts, each supported by a direct quotation from its source. Our application independently checks those quotations and discards unsupported facts.
We deliberately separate AI interpretation from financial decision-making. Deterministic Python applies financial assistance thresholds, selected federal and California legal rules, financial calculations, and authorization checks.
When evidence is contradictory, incomplete, or near an eligibility threshold, the system asks the appropriate human reviewer rather than guessing.
This approach allows Claude to handle complex unstructured information without giving a language model unrestricted authority over patients' finances.
3. Self-learning from institutional history
During onboarding, Halcyon Bay examines 18 months of historical financial assistance decisions.
It evaluates four predefined institutional practice patterns, counts supporting evidence, and identifies historical denial reasons that conflict with the encoded legal requirements.
Rather than adopting potentially unlawful historical practices, the system flags them for compliance review.
Its first discovery generated 32 reversal proposals representing more than $222,000 in potential patient relief.
4. Self-improving through human corrections
When a counselor corrects an outcome, Halcyon Bay can store that correction as a persistent precedent.
It searches for similar historical cases, proposes a supported policy rule, and backtests the rule to estimate how many cases and how many dollars would be affected.
The revenue cycle director must approve the proposal before it becomes active. Rejected patterns are stored to prevent the same rule from being proposed again.
Our prototype currently supports a defined categorical-program rule type, rather than unrestricted policy generation.
5. Code-enforced permissions and auditability
Trust cannot depend on prompting an LLM to behave correctly.
Halcyon Bay enforces permissions directly in application code. The AI can investigate and propose actions, but cannot approve its own proposals or directly post financial adjustments.
Financial counselors, revenue cycle directors, and compliance officers have separate approval responsibilities. Sensitive actions require the appropriate authorization, and only the gateway can post approved changes.
SQLite transactions and append-only audit and ledger tables preserve every action, approval, refusal, and supporting explanation.
This makes it possible to reconstruct why a particular account received a specific decision, even after the original investigation has ended.
6. Building and evaluating the system
Our backend uses Python, FastAPI, and SQLite, with a React, TypeScript, Tailwind CSS, and Vite frontend.
We also integrated the CRS sandbox API for identity, address, bankruptcy, and related checks. These checks operate on simulated personas and are designed to support patient protection rather than deny financial assistance based on credit information.
We generated a deterministic synthetic hospital environment with 149 planted challenging cases and maintained a separate hidden answer key for evaluation.
The architecture separates document interpretation, deterministic policy enforcement, persistent workflows, role-based permissions, and the execution gateway.
Challenges we ran into
Keeping AI useful without letting it make unsafe financial decisions. Claude interprets messy evidence, while deterministic code makes eligibility, amount, legal-rule, and authorization decisions. This makes decisions more verifiable, although it limits flexibility for cases outside our encoded rules.
Handling imperfect financial records. Patient accounts contain inconsistent identifiers, missing documentation, conflicting statements, and OCR errors. We implemented quotation verification and human escalation for uncertain cases, though duplicate-account merging remains an area for improvement.
Preventing prompt injection. One simulated pay stub contained hidden instructions telling the AI to approve full charity care. Our system detected, rejected, and logged the attempt.
Building accountability into autonomous workflows. We implemented a single permission gateway and append-only audit logging so that denied actions are just as traceable as successful ones.
Making evaluation reproducible. We cached Claude's document readings and replayed the hospital's operations across 92 simulated days, allowing us to test the financial workflow repeatedly without changing the underlying inputs.
Accomplishments that we're proud of
Across a 92-day simulated replay, Halcyon Bay achieved:
- 292 of 316 accounts handled correctly (92.4%) against our hidden answer key.
- 94.3% precision on autonomous proposals (248 of 263).
- 91.4% of clear cases correctly handled autonomously (267 of 292).
- 32 potentially unlawful historical denials identified, representing $222,032.72 in proposed patient relief.
- $1.56 million in correctly proposed financial assistance across the simulated live accounts.
- 23 prohibited collection-agency actions blocked, including attempts to report medical debt to credit bureaus.
- 40 of 40 historical findings matched against an independent answer key.
- 100 passing core tests and 22 passing CRS tests.
- One planted prompt-injection attempt successfully rejected and logged.
The full replay used saved Claude responses, while a separate initial-day test exercised live Claude API calls. All hospital records and financial results are synthetic.
What we learned
Building trustworthy autonomous financial systems requires more than connecting an LLM to tools.
We learned the importance of separating what AI can interpret from what software can safely execute. Evidence-backed extraction, deterministic rules, explicit permissions, and human approvals help make automated financial decisions verifiable.
We also learned that autonomy requires persistent memory and accountability. A system should retain corrections, explain its decisions, and record not only what it accomplished but also what it refused to do.
Finally, reproducible evaluation is essential. A realistic environment, independent answer key, and measurable outcomes helped us identify both the system's strengths and the cases it still cannot reliably handle.
What's next
Our next priorities are improving cross-system patient matching, supporting complete payment-plan workflows, handling complex document disagreements, and expanding the types of institutional policies that can be learned from staff corrections.
Moving toward real-world deployment would require secure authentication, healthcare-grade privacy protections, expert legal review, integration with hospital billing systems, and validation with actual revenue-cycle and compliance professionals.
Our long-term vision is an autonomous billing office that protects patients, supports nonprofit hospitals' financial sustainability, and can explain every decision it makes.
Sources
Built With
- anthropic-api
- anthropic-sdk
- claude
- crs-credit-api
- fastapi
- httpx
- pytest
- python
- react
- rest
- sqlite
- tailwind-css
- typescript
- vite

Log in or sign up for Devpost to join the conversation.