Callers talk naturally, and the system maps what they mean to the right action. Three parts, each with one
job: the model never decides, and the code never guesses.
The three parts
Replies are fast because a decision is a short typed question, not a composed answer. How the model is
asked is on a page of its own: decision models.
1 The model understands
A decision model reads what the caller said and answers typed questions: is this a request to
reschedule, which of these three appointments, what date was given. It returns judgments with
probabilities, never generated text. Callers can say it in their own words, give three answers at
once or change their mind.
2 Code decides
Deterministic code owns the dialog: which form is active, which slot to ask next, when to read back,
when to hand off to a person. The same judgments and state always lead to the same step, and every
line the caller hears is an approved line filled with checked values, unless the app has asked for a
generated one (below).
3 The gate checks every action
Before any tool runs, a policy gate checks the caller's identity level, whose record it is, exact
confirmation, role and attempt limits. The gate does not read the conversation, so no one can talk
past it. Every decision, allowed or refused, goes to a hash-chained audit log.
Reproducible. Replay a call against its recorded model answers and get the same outcome.
Explainable. The audit names the rule that passed or failed, and what it compared.
Not steerable by the caller. What a caller says is data the model classifies, never instructions the code follows.
Tunable. Thresholds are numbers, adjusted by measurement rather than by rewording a prompt.
An app is a folder
YAML for what is data: intents, forms, slots, prompts, policy, identity, locales. TypeScript for what runs:
tools, form hooks, rules of your own. defineApp joins the two. Most slots are configuration:
name a type from the slot library (digits, choice, date,
birthdate, name, record, text) and give it a few options.
The authoring guide takes the folder a file at a time:
Authoring an app.
pnpm check says what to fix
It reads every YAML file against its schema and cross-checks the folder against the code: a slot a form
names that does not exist, a line the engine needs that no prompt provides, a tool with no policy. Each
problem is one line, file:line:column path message -> fix,
written for a person or an assistant to act on. Here is the line it prints for a misspelt slot name in the
utility's forms.yaml, and the run after the fix:
$ pnpm check
forms.yaml:11:20 forms.report_outage.slots[1] slot "symptm" is not defined -> rename it to "symptom", or add "symptm:" to slots.yaml (a library type, or { type: code } with the slot in src/app.ts (code.slots.symptm))
$ pnpm check
apps/clinic: ok
apps/harbor: ok
apps/secretary: ok
apps/utility: ok
Tested before a call is taken
Labelled utterances and scripted calls. Each app keeps what callers say, labelled, and whole calls with the outcome each must reach. The regression runs them against a committed baseline, and a changed outcome is a finding to explain.
Recorded calls. The real model's answers are recorded once into a cassette, so the same calls replay offline, with no key, to the same outcome.
The policy matrix. For every action and every kind of caller, what the gate decides, compared by a test (below).
The adversarial suite. Cases generated from the app itself: injections, relationships claimed and not proven, off-scope requests, codes said aloud, hostile replies from every tool. Each is held to properties over its run, never to lines, and a failing case is fixed in the app or the engine.
The repository is written to be read by an AI coding assistant as well as by you. A root
CLAUDE.md
gives the roles, the commands and the rules,
llms.txt
indexes the docs, and every app has a CLAUDE.md of its own.
The create-app skill
The procedure an assistant follows to turn a paragraph into an app: a worksheet, the mapping onto slot
types, policy and identity, the scaffold, the corpus and scripted calls, then the checks until they
pass. It comes with a page of verified patterns and a corpus guide.
The scaffold the skill calls. It writes a small app under apps/<name> that passes
pnpm check, its own tests and its regression as created. Add --identity for an
app that verifies its callers.
Two fresh assistants, with no context from us, were each given one paragraph (a fictional electric utility,
a fictional transit agency) and told to use the skill.
15 and 11 minto a working app, by their own count, check and scripted calls green
1 real holefound by both in the policy matrix: a code texted to someone else's phone. Now refused for every app
Every stumblethey logged, fixed or recorded with its reason
Policy is a file, not code. policy.yaml names the rules each action runs, and
identity.yaml says who the app serves and how a caller proves who they are. Both compile to
what the gate runs. Three generated pages make a change readable by someone who does not write code:
POLICY.md, the policy card: each action and each rule in plain English, with diagrams, written from the same compiled policy the gate runs. It lists every line a model words and every prescribed line.
policy.matrix: for every action and every kind of caller, the verdict and its reason, so a policy change shows up as a diff of what the gate decides.
APP-MAP.md: the app's intents, forms, slots, actions and rules as diagrams.
Each is written by a command and compared by a test, never written by CI.
CODEOWNERS
makes a change to the policy files and these pages need compliance's review.
From apps/utility/policy.matrix:
who may set up a payment arrangement. A customer needs the one-time code (level 2), their own account and
an exact read-back; a property manager goes to a person.
From a personal line on one machine you own to a contact center across many servers, it is the same app:
what it understands, what it says and what the policy allows do not change.
On a machine you own
Try it on a laptop, then run it on any machine that stays on, for a small office or your own line. A
phone line needs two keys, a carrier's (Telnyx or Twilio) and a decision model's, and a tunnel (a quick
one needs no account). It starts at boot, survives its own restarts without dropping a caller, and shows
you calls on your phone.
Several servers behind a load balancer, with sessions, the audit and the traces in shared stores
(Postgres and S3-compatible storage). When the server holding a call stops or crashes, another takes the
call over from the shared session. Built for Phase 8b's scope; roles, single sign-on for the console and
OpenTelemetry are left for later.
The same app folder. Intents, forms, prompts and slots in YAML, tools in TypeScript.
The same policy.policy.yaml and the gate decide every action, on one machine or many.
The same audit. Every decision, allowed or refused, in a hash-chained log, with a trace of every turn.
The same tests.pnpm check, the policy matrix and the scripted calls, before any call is taken.
Answers from a knowledge base
Callers ask what a document answers. Nothing is said that a person has not approved, and you choose, topic by
topic, how much a model may word.
Level
The caller hears
If a check fails
Prescribed (the default)
The approved passage, word for word
Nothing to check
Worded for the question risk: low
The passage, worded for what was asked
The passage, word for word
From approved documents documents
An answer written from the approved sections
The document's own lines, under their heading
How a generated answer stays grounded
FindAn embedding model on your own machine offers the closest sections. No API call.
ReadThe decision model answers yes or no for each: would it answer the question?
WriteA model words the answer from the chosen sections alone.
CheckCode refuses any figure the sections do not contain.
JudgeThe decision model reads it two ways: does it say anything new, and how much is its own. An app may also ask about each figure.
Fall backRefused again: the document's own lines, word for word.
Measured on Harbor Mutual's member line
95.8%the right topic found, on 120 questions it never saw
97.5%the right handbook section offered, on 80 held-out questions
20 of 20unfaithful answers refused by the judge
20 of 20faithful answers passed by the judge
Judging answers from documents, with fast models
The premise: a fast decision model and a fast writing model, asked the right questions, do this for a
fraction of the time and money a large reasoning model needs. Measured on a 123-page benefit booklet.
2 of 79right answers refused by the judge, where one yes-or-no refused 12
44 of 55wrong answers caught, 83% of what a top reasoning model catches
7 of 120answers fell back to the document's own lines, from 13
0.1 sto judge an answer; about $0.0003 an answer, every model included
On 134 labelled answers. The fast models' cost is every model of an answer; Sonnet's is its judging alone.
Not tuned to one documentSix other insurers' public summaries of benefits import and are questioned the same way. The logic and questions are general.
Room to tuneTuning to a document's own content should narrow the gap to large, slow models further, or close it. Left for later.
Who pays, comparedjudge.compareFigures asks an app's own question of each figure, in the answer and the document, read apart.
Follow-up questions
"What about for a family?" after "what's my deductible?" is read with the earlier question, with no second
model call. An option, measured per app with pnpm kb:bakeoff --follow-ups.
On a 123-page benefit booklet, against the decision model. The questions that stand alone gave the same answers either way.
Withheld when it changesA passage whose source changes, or that is edited, waits for a person to approve it again.
Depends on who is askingA passage applies by facts read from the system of record, never from what the caller said.
Gaps rankedpnpm kb:gaps ranks what callers asked that nothing answered, with the section that would.
Runs anywhere, offline tooWhere the model's native runtime can't load, it runs on WebAssembly from the local cache.
topic: filing_deadline
applies: { plan: advantage }
source: { document: accident-advantage-member-guide-2026, section: "1 Filing a claim" }
answer: "You have 180 days from the date of your accident to tell us about a claim. You can file it in the member portal, in the Harbor Mutual app, or by calling member services, and you'll need the date of the accident, a short description of what happened, and the bills or a statement from the doctor who treated you. Claims sent after 180 days may still be reviewed, but payment isn't guaranteed, so it's best to file as soon as you can. You can send any documents you don't have yet later."
approval:
owner: Benefits Content
kb_documents_opening:
text: "Here's what our member handbook says: {opening}"
interruptible: false
kb_documents_answer:
text: '{answer}'
interruptible: false
generate:
answer:
from: sections
retry: 1
goal: Answer the member's question from the handbook sections, in a sentence or two, keeping anything they say that changes the answer.
The app that answers the phone answers a web chat: the same intents, forms, policy and knowledge base. A chat
can show more than a call can say, so each of these is an option, and a call is unchanged by it.
A mobile detailer's booking line: its own page around the widget's conversation, a formatted answer, and answer buttons.
A chat page of its ownThe app's brand, the conversation front and centre, ways to start, a number to call.
Or the widgetOne script with no dependencies, on any site.
Formatted answersLists and bold where a chat can show them; values always plain text.
Answer buttonsYes and no, a choice, one of the caller's records. A tap is typed words: it decides nothing.
Where each answer comes fromThe document, the section and the page, under a knowledge answer.
Chat onlyNo carrier, no phone number, no carrier's secret: VOICE_PROVIDERS=none.
Every line is said word for word unless the app asks for a generated one. The model chooses the words, never
the content: the core has decided before any line is worded. A summary of what the caller said is framed: the
line is fixed, and only a span of it is generated.
confirm_take_message:
text: "Thanks! I'll make sure {recipient} gets your message, in short: {summary}. I have you as {caller}, on {phone}. Shall I pass it on?"
exactText: "I'll make sure {recipient} gets your message, as you said it: {summary}. I have you as {caller}, on {phone}. Shall I pass it on?"
generate:
summary:
from: message
words: 30
speaks: to-caller
names: [recipient]
Opt in, line by linemode: generative, or a form at a time. A line marked prescribed never is.
Checked by codeEvery value word for word, no figure it was not given, its word budget.
Judged for meaningThe decision model refuses a summary that adds, drops or turns anything around.
Exact words on failureA failed check, a slow model or an error: the caller's own words, as they said them.
491 msmedian to word a summary (841 ms at p95), Gemini 3.1 Flash-Lite
900 msa line's budget on a call by default (1500 ms in a chat); past it, the fixed text
~2 centsa month of recordings of every generated line, recorded again and again
The model is yours to choose, in the app's style.yaml; pnpm render:bakeoff compares models on
your own lines. The policy card lists every generated and every prescribed line.
An app green on its recordings has been tried on its own words. A live call adds a carrier, a recognizer, a
room and a person who does not know the script. Chapter 17 of the guide is the working method that follows,
with examples from a day of live calls to the front desk:
trace every call, and read it turn by turn in the console, each question beside its answer;
tune on a private copy that keeps the caller's words, when the shipped app keeps none;
treat a score near 0.5 as a coin toss, and suspect the question's words before the threshold;
change the words, record again, and triage the recording;
choose the render model and the judge by measurement, against the call's time budgets.