Problem
Sword Health runs Phoenix, an AI care agent for remote physical therapy. It answers patient questions during exercise sessions, handles non-clinical tasks outside them and acts as a co-pilot for physical therapists. In production the inputs vary widely, so LLM output becomes inconsistent. In a regulated setting an unsafe tip, a regression after a prompt change or a slow reply is costly, and nobody reviews each patient conversation live.
Example from the article: at the end of a session Phoenix congratulates a patient, asks for feedback and gives tips when the patient reports shoulder pain, so those tips must stay inside clinical guidelines.
Solution in brief
The team builds guardrails with clinicians, treats evals as unit tests for prompts and models, and starts with prompt engineering before adding RAG for missing knowledge. Production feedback and regular manual review of real conversations feed the next iteration.
Questions this case answers
- How to release changes to a non-deterministic generative system without regressions, using human, programmatic and model-based graders together
- How to keep an LLM feature safe for end users when wrong output is costly, no human reviews each reply and added checks slow the response
- How to decide whether a weak LLM feature needs better prompts, extra knowledge in context or changes to the model itself
- How to put safety controls between an LLM care agent and patients in a regulated product?
Tools and methods
- Input and output guardrails — block prompt injection, jailbreaks and unsafe content, and limit medical advice to clinician-approved tips
- Human, non-LLM and LLM-as-a-judge grading — three ways to score outputs
- Prompt engineering and few-shot examples — baseline and first improvement step
- RAG over support articles — adds domain knowledge the model lacks
- Sentiment analysis and thumbs-down feedback — implicit and explicit feedback from patients
- Streamlit, Langfuse, LangSmith — apps for expert rating and viewing conversations
Google or a one-time email code. No password.