Healthcare support
This example shows how to build a healthcare support workflow with Agents SDK using both standard agents and a sandbox agent. The scenario is intentionally synthetic and generic: a patient asks a billing or coverage question, the workflow checks local records, inspects policy documents in an isolated sandbox workspace, writes support artifacts, and optionally routes one ambiguous case to a human reviewer.
What this example demonstrates
- Standard agent orchestration with a top-level support orchestrator and a benefits subagent.
- Sandbox agents with a mounted workspace, shell commands, a generated output folder, and runtime-selected sandbox config.
- Sandbox capabilities including
Shell,Filesystem, and lazy-loadedSkills. - Human-in-the-loop approvals using an approval-gated queue-routing tool.
- Persistent memory with
SQLiteSession, shared across scenario runs. - Structured outputs for each specialist agent and the final case resolution.
- Tracing so you can inspect every model call and tool call in the OpenAI trace viewer.
- CLI-first workflow that can be run scenario by scenario from the repository checkout.
Architecture
The workflow has two execution modes working together:
- A standard orchestrator agent runs in the normal Agents SDK loop, calls the benefits subagent first, then calls a sandbox agent tool, and decides whether to request a human handoff.
- A sandbox policy agent runs behind
agents.sandbox, reads the mounted case files and policy documents, uses shell commands plus a lazily loaded skill, writes markdown artifacts intooutput/, and returns a structured policy summary.
The local fixture data lives in data/scenarios/*.json and data/fixtures/*.json. The sandbox policy library lives in policies/*.md. Generated artifacts are copied to .cache/healthcare_support/output/<scenario_id>/.
Scenarios
The built-in scenarios increase in complexity:
eligibility_verification_basicchecks a straightforward benefits question.referral_status_checkadds a referral lookup.blue_cross_pt_benefitsshows a follow-up turn that benefits from the shared SQLite memory.prior_auth_confusion_ctfocuses on prior-authorization and intake-routing confusion.billing_coverage_clarificationcombines benefits lookup with sandbox policy search and document generation.messy_ambiguous_knee_casetriggers the human approval flow before queueing a handoff.
Run the CLI demo
From the repository root:
uv run python examples/sandbox/healthcare_support/main.py
Useful options:
uv run python examples/sandbox/healthcare_support/main.py --list-scenarios
uv run python examples/sandbox/healthcare_support/main.py --scenario blue_cross_pt_benefits
uv run python examples/sandbox/healthcare_support/main.py --scenario messy_ambiguous_knee_case
uv run python examples/sandbox/healthcare_support/main.py --reset-memory
For unattended runs, set EXAMPLES_INTERACTIVE_MODE=auto to auto-answer prompts:
EXAMPLES_INTERACTIVE_MODE=auto uv run python examples/sandbox/healthcare_support/main.py --scenario messy_ambiguous_knee_case
Files to read first
main.pyruns the standalone CLI demo.workflow.pycontains the shared workflow execution logic, sandbox setup, artifact copying, tracing, and approval resume loop.support_agents.pydefines the orchestrator, benefits subagent, sandbox policy agent, and memory recap agent.tools.pydefines the local lookup tools and the approval-gated human handoff tool.skills/prior-auth-packet-builder/SKILL.mdis the sandbox skill loaded at runtime.
Notes
- This is a demo workflow, not a production healthcare system.
- All patient, payer, and policy data in this example is synthetic.
- The example loads environment defaults from the repository-root
.envfile and from this demo's optional local.envfile.