Skip to main content
Care DeskConcept
About me

Jess Morgan

Patient support

Viewing as

How it works

What happens to a message, what the AI never sees, and where a person decides.

In short

Care Desk drafts replies to routine patient messages. A person sends every one.

Before any AI step, personal details are removed and plain safety rules read the message. Anything clinical, a crisis or a death stops there: no AI reply, the orders go on hold, and a clinician takes it.

Routine drafts use only the patient's records and the support policy. Every date, amount and order number is checked before an agent sees it.

  • Safety rules run before any AI
  • A person sends every reply
  • Every fact traced to a source

How a message moves

Seven checks, always in this order, on the demo messages and in Try it.

Patient messageEmail or chatDetails removedCode, no AISafety rulesCode, no AISorted by typeClaude, fast modelSources foundRecords and policyReply draftedClaude, strong modelFacts checkedCode, no AIA person sendsAgent reviews firstClinicianqueueNo AI replyOrderson holdStopRiskAn agentwrites thereplyNo draft isofferedUnsureDeclinesFails
Steps marked Code, no AI are plain rules. A draft needs the rules and the sorter to agree a message is routine, and an agent can still escalate any draft.

What the AI never sees

Names, contact details, addresses, dates of birth and health numbers are swapped for placeholders in code, before any AI step. Three fictional messages, before and after:

Example message from

What the agent sees

The message as it arrived

What the AI sees

Placeholders, before any AI step

Loading the example message
Removed before the AI saw it
Kept, because the reply needs them

It removes too much on purpose: hiding a doctor's name costs nothing, leaking a patient's would.

Open it on the desk
  • The drafter gets the patient's records as numbered sources, with no name or contact details.
  • Email drafts open with Hi [FIRST_NAME], and sign off with [AGENT_NAME]. Chat drafts skip the greeting and sign off only in the first reply of a chat. The desk fills in the names, so the AI never sees or invents one.
  • Nothing typed into Try it is stored, and there is no database of patient data.

Where a person decides

Care Desk acts on its own only to protect a patient: it holds orders and withdraws drafts. It never sends anything.

A support agent reading a message at her desk

Every reply that is sent

A draft waits for an agent, who can send, edit or escalate it. Undo is there straight after sending.

On the desk: Send, or Ctrl+Enter

Any draft, escalated by hand

If anything feels clinical, the agent escalates it to a clinician with a note, instead of sending.

Open the desk
A clinician on a video call with a patient

Every clinical item

Clinical questions, side effects, crisis language and reports of a death never get an AI reply. A clinician sees why it was escalated and replies personally.

Every hold release

A safety stop holds the patient's orders at once. Only a clinician can resume them, with a written note.

Open the clinician queue

When something fails

Every failure lands on a person, never on the patient.

What happens when each part of Care Desk fails, and who acts next
WhenWhat Care Desk doesWho acts next
The AI is unavailable

Details are still removed and the safety rules still run: both are plain code. Nothing is drafted, so every message goes to a person.

Next:Agents reply as they do today
The sorter is not sure

Below 75% confidence there is no draft. The message shows as Write the reply, with the best guess.

Next:An agent writes the reply
The fact check fails

Any date, amount, order or tracking number missing from the sources blocks the draft, as does any dose. The trail names the fact.

Next:An agent writes the reply
A safety rule fires

No AI reply. The patient's orders go on hold and the message joins the clinician queue, urgent first.

Next:A clinician
The drafter declines

If the sources do not hold the answer, it says so instead of guessing. No draft.

Next:An agent writes the reply
A death is reported later

Every unsent draft to that patient is withdrawn at once and their orders are held. A clinician checks the report first.

Next:A clinician, then the family

For the team running it

The data flow, the agent guide, the runbook and the stack. Open what you need.

Visitor's browserShows the pages. Keeps decisionsin this browser only.Static filesPages and demoresults. Allfictional.Live boxRemoves details,runs the rules,then calls Claude.Holds the key.One Cloudflare Workerpages anddemo datamessage in,trail backClaude APISees placeholdersand numberedsources only.Settings storeLimits, on/off,counts. Never amessage.placeholdersonlycounts
Everything in the demo is fictional. A visitor's sends, edits and escalations stay in their own browser, and Help resets them.

docs/AGENT-GUIDE.md

One page for anyone working the Care Desk queue. Plain words, no training needed.

The one habit

Read, then send. Care Desk drafts the routine replies. Pick a message from the queue and it opens with the draft under it. You read the draft, check it against the patient's records (the details open with the message: the check trail and the patient's plan and order), and you decide. Nothing goes to a patient until you press Send.

Your queue

Messages arrive from Australia, New Zealand and the UK, by email and chat. The most serious come first, and within each group the longest waiting come first. Every row shows the type, the risk (an icon and a word, never colour alone), how long it has waited and the country.

The filters above the queue group the rows: Write the reply, Ready to send and Clinician and urgent. All shows everything still open, and Done shows what you have sent or escalated. Rows you cannot act on yet sit at the bottom of the queue, under Waiting on a clinician for this patient.

What the row saysFilterWhat it meansWhat you do
Ready to sendFilterReady to sendWhat it meansA drafted reply passed every checkWhat you doRead it, then send, edit or escalate
Write the replyFilterWrite the replyWhat it meansNo draft: the patient asked for a person, it is a complaint or privacy request, the AI was unsure, or a check failedWhat you doWrite the reply yourself
Held: clinician firstFilterWrite the replyWhat it meansA draft exists, but this patient reported something serious in another messageWhat you doAsk the on-call clinician before anything is sent
WithdrawnFilterAllWhat it meansSomeone has told us this patient may have diedWhat you doSend nothing. The clinician handling that message decides what happens next
Clinician or UrgentFilterClinician and urgentWhat it meansA safety rule stopped the message: no AI reply, and a clinician answersWhat you doNothing to write. Urgent ones also have the patient's orders on hold

Working a message

  1. Open it. The patient's message sits at the top, with the reply straight under it. The details open with it: the check trail and the patient's plan and order, beside them on a wide screen and under the reply on a smaller one (Hide details, beside the message title, puts them away for that message). Show steps lays the checks out; More about opens the rest of the patient's record.
  2. Read the draft. Every fact in it has a number, like [1], pointing to the order, charge or policy it came from. The fact check has already matched every date, amount and order number to those sources. A detail marked check first comes from the patient's own message, not the records: check it before you send.
  3. Decide.

    • Send when it is right. You can undo straight after.
    • Edit when it needs your touch. Change anything you like; the send button works the same way.
    • Escalate when anything feels clinical, even if the rules did not catch it. It goes to the clinician queue with your note.
    • Pass to a person (in the More actions menu, the three dots by the reply's title) when a colleague owns the conversation.

An email draft greets the patient by first name and signs off with your name. A chat draft has no greeting line, and only the first reply in a chat signs off with your name. The AI never saw either name: the desk fills them in for you.

Keyboard

KeyAction
J and KActionNext and previous message
EActionEdit the draft
Ctrl + Enter (Cmd + Enter on a Mac)ActionSend
XActionEscalate to a clinician
?ActionShow every shortcut

Always

  • A patient asks for a person: they get a person. These never get an AI draft.
  • Anything about symptoms, side effects, doses, other medicines, pregnancy or driving: escalate. Do not answer it, even in part.
  • Crisis words or a risk to someone's life: the message is already urgent and with a clinician. If you are ever unsure, escalate and tell the on-call clinician straight away.
  • A death reported by family or a carer: everything to that patient is withdrawn and their orders are on hold. A clinician replies to the family.

Never

  • Send a draft you have not read.
  • Promise delivery dates, refunds or prices that are not in the patient's records or the policy.
  • Give medical advice, dosing figures or product recommendations.
  • Paste a patient's details into any other tool.

When something looks wrong

Open See what the AI saw on the trail to see exactly what it was given. If a draft is wrong, edit it or write your own, then tell your team lead which message it was, so the rule or prompt can be fixed and the case added to the test set.

docs/RUNBOOK.md

How to run Care Desk day to day. Every command runs from the project folder, with Wrangler signed in to the Cloudflare account that owns the site (npx wrangler login once). --remote means the live settings, not a local copy.

What is running

  • The site is static files (pages and the precomputed demo data), served by one Cloudflare Worker named care-desk.
  • The live box ("Try it") is the same Worker's /api/try route. It runs the pipeline on the typed message, calls the Claude API with the key stored as a Worker secret, and streams the trail back.
  • Settings live in one Workers KV namespace, bound as CARE_DESK_KV. It holds one config value (the limits and the on/off switch) and running counts (tries per visitor per hour, requests and spend per day). It never holds a typed message.
  • Secrets are set with npx wrangler secret put NAME and can never be read back: ANTHROPIC_API_KEY (the Claude key), VIP_TOKENS (the private-link codes), ADMIN_TOKEN (for the status check below) and, if used, TURNSTILE_SECRET and VISITOR_SALT.
  • There is no database of patient data. Every patient is fictional, and each visitor's decisions stay in their own browser.

Raise or lower the live-box limits

One command. It takes effect within about a minute, with no redeploy.

npx wrangler kv key put --binding=CARE_DESK_KV --remote config '{"enabled":true,"dailyUsd":5,"perVisitorPerHour":20,"vipDailyUsd":10,"vipPerVisitorPerHour":60}'

The value replaces the whole config, so always write every field. A field that is missing or unreadable falls back to its default, and nothing can go above US$200 a day or 1,000 tries an hour, so a typo cannot switch the limits off.

FieldWhat it limitsDefault
dailyUsdWhat it limitsPublic spend per day, in US dollarsDefault3
perVisitorPerHourWhat it limitsPublic tries per visitor per hourDefault10
vipDailyUsdWhat it limitsPrivate-link spend per day, in US dollarsDefault10
vipPerVisitorPerHourWhat it limitsPrivate-link tries per visitor per hourDefault60
enabledWhat it limitsThe on/off switch (see "Pause the live box")Defaulttrue

Days are UTC. To see the current values:

npx wrangler kv key get --binding=CARE_DESK_KV --remote config

No output means the key is not set and the defaults apply.

A VIP link is a private link for someone who needs more tries, such as a team lead trialling the live box. It has its own budget (vipDailyUsd and vipPerVisitorPerHour), separate from the public one, so public traffic can never use up a private link's allowance. It also skips the bot check.

  1. Make a code that cannot be guessed (24 letters, digits, - or _; codes shorter than 12 characters are ignored):

    node -e "console.log(require('crypto').randomBytes(18).toString('base64url'))"
  1. Store every live code in the VIP_TOKENS secret, separated by commas. The secret cannot be read back and each put replaces the whole list, so keep the list somewhere safe, such as a password manager. Paste it when asked:

    npx wrangler secret put VIP_TOKENS
  1. Send the link: https://caredesk.autopilotyourworkflow.com/?k=CODE (any page works; the code is kept for that browser tab)

The page takes the code out of the address bar and keeps it for that browser tab only.

To revoke a code, run npx wrangler secret put VIP_TOKENS again with the list minus that code. It stops working as soon as the secret is saved. To see how many codes are live, use the status check under "Check spend".

Rotate the API key

  1. In the Claude Console, create a new key named care-desk.
  2. Store it in the Worker. Paste it when asked; the Worker picks it up at once.

    npx wrangler secret put ANTHROPIC_API_KEY
  1. Send one message through "Try it" and check the trail reaches "Facts checked".
  2. Revoke the old key in the Console.
  3. Put the new key in .env.local too, so npm run precompute keeps working on this machine. Never commit it.

Check spend

  • Today, as the Worker counts it (US dollars, the day in UTC). Spend is kept per tier, so there are two keys; no output means nothing was spent:

    npx wrangler kv key get --binding=CARE_DESK_KV --remote spend:public:2026-09-24npx wrangler kv key get --binding=CARE_DESK_KV --remote spend:vip:2026-09-24
  • Everything in one view: the status check returns today's spend, requests, limits and remaining budget for both tiers, whether the live box is on, and how many VIP codes are live. Set ADMIN_TOKEN once with npx wrangler secret put ADMIN_TOKEN, then:

    curl -H "Authorization: Bearer ADMIN_TOKEN_VALUE" https://caredesk.autopilotyourworkflow.com/api/status
  • The source of truth is the Usage page in the Claude Console, filtered to the care-desk key. Set a monthly spend limit there as a backstop to the Worker's cap.
  • Live requests and errors as they happen: npx wrangler tail care-desk

Pause the live box

Write the config with "enabled": false, keeping the other fields as they are:

npx wrangler kv key put --binding=CARE_DESK_KV --remote config '{"enabled":false,"dailyUsd":5,"perVisitorPerHour":20,"vipDailyUsd":10,"vipPerVisitorPerHour":60}'

Within about a minute every live try, public and VIP, is turned away before any AI call. "Try it" shows the same notice as when the day's live AI budget is used up, and still runs the safety rules in the visitor's browser, with a simple built-in stand-in for Claude, labelled as a sample. The rest of the site is static and carries on as normal. To resume, put the same value back with "enabled": true.

In an emergency, removing the key stops every AI call at once: npx wrangler secret delete ANTHROPIC_API_KEY. The live box then answers with a simple built-in stand-in for Claude until a key is put back.

Re-run the evaluation

Run this after any change to the safety rules, the prompts or the test set.

npm run precompute   # runs every demo message through the pipeline with Claudenpm run eval         # scores the results against the labelled test setnpm run deploy       # rebuilds the site data and publishes it

precompute keeps saved results that already match the current rules, prompts and models, so a second run only pays for what changed. To redo one message: npm run precompute -- --only MSG-0042 (comma-separate several).

What the release gate means

npm run eval is the release gate. It fails (exit code 1) when:

  • any safety case in the test set was not sent to a clinician, or an urgent case lost its priority;
  • any case that must hold the patient's orders did not;
  • a draft could be sent to a patient whose death was reported, or to a patient with an open urgent message;
  • a labelled message has no result, or the results came from the simple built-in stand-in instead of Claude.

Do not deploy on a failed gate. Fix the rule or the prompt, add the message that exposed the problem to data/testset.json as a new case, and run the three commands again. The Test results page shows exactly what the last passing run measured.

Next.js 16, React 19 and TypeScript, styled with Tailwind CSS, served as a static site by one Cloudflare Worker, with the Claude API (Claude Haiku 4.5 to sort, Claude Opus 5.5 to draft) and Vitest for the tests.

Code on GitHub

Keyboard shortcuts

Shortcuts pause while you type.

One-key shortcuts

Turn these off if they get in the way of speech input or another tool.

One-key shortcuts

Anywhere

Show keyboard shortcuts
?
Close menus and panels
Esc