Use case · AI features

Test an AI change like a product change

Temperature, system prompt, model choice, token ceiling — all hardcoded, all iterated by redeploying, and all evaluated by how the output felt to whoever was looking.

AI surface = high riskcost per conversation guarded

The problem

Temperature, system prompt, model choice, token ceiling — all hardcoded, all iterated by redeploying, and all evaluated by how the output felt to whoever was looking.

AI features moved fast enough that nobody built the measurement discipline around them. Prompts get rewritten in a pull request, a model gets swapped because a newer one shipped, and the evidence that any of it helped is a handful of screenshots in Slack.

The costs are real and easy to miss. A prompt that improves answer quality can double token spend. A cheaper model can quietly raise escalations to a human. Neither shows up unless you are watching cost and deflection alongside quality.

A model swap is a change to your product. It deserves a canary, a control, a guardrail on cost, and a record of why you kept it.

assistant/config.ts
// before
const
  MODEL = "sonnet-4"
  TEMPERATURE = 0.7
  SYSTEM_PROMPT = promptV3
  MAX_TOKENS = 1024

// after — four parameters, one
// change, a real control arm

What you put under control

Declared once, then governed centrally. This is the only code step.

Parameters
ParameterTypeDefaultRange
ai.assistant.modelstring"sonnet-4"enum
ai.assistant.temperaturenumber0.70–2
ai.assistant.prompt_versionstring"v3"enum
ai.assistant.max_tokensnumber1024128–4096
Surfaces that consume them
SurfaceKindRole
In-app assistantaidecision
Support deflectionaidecision
Email draftingaiside_effect

Those bindings are what compute the risk class — high: AI surface · side-effect binding.

Variants are parameter value sets
Variantprompt_versiontemperature
control"v3"0.7
tighter-prompt"v4"0.4
new-model"v3"0.7

Risk class: high

AI surface · side-effect binding. A human approves the measurement plan before any traffic, and again before the value becomes the product default.

How it runs

The mechanism is configuration. The application code is already done.

Canary → Experiment → Rollout
Chosen for a high-risk change.

AI surfaces compute to high risk, so a human approves the measurement plan before any traffic and again before promotion. The canary catches the catastrophic cases — runaway tokens, refusal loops — on 1% of sessions.

Prompt variants are a natural fit for adaptive optimization once you trust the guardrails, since the best phrasing often differs by user intent.

Phases running
Setup
Canary
Experiment
Rollout
Complete
Guardrails on every phase
cost_per_conversation
must not increase > 15%
blocking
human_escalation_rate
must not increase > 2%
blocking
latency_p95
must not increase > 800ms
warning

What you get back

A verdict you can defend, and the reasoning kept for next time.

prompts-models / measurement day 4 of ~7
Evidence still accumulating — hold
Leading variant is ahead on the primary metric, but the interval has not cleared zero. All guardrails passing.
primary metric
+6.1%
task_completion_rate · conversion rate · per conversation
measurement progress
64%
of the sample needed for a verdict
guardrails
3 / 3
passing, none near threshold
task_completion_rate primary
tighter-prompt +6.1% · anytime-valid interval still crosses zero
+6.1%
cost_per_conversation guardrail
inside the acceptable band on all arms
passing
human_escalation_rate guardrail
inside the acceptable band on all arms
passing

Prompt and model decisions with evidence attached — and a cost guardrail that stops a clever prompt from tripling your inference bill.

When it completes, the winning values become the parameter defaults and the whole thing — question, variants, evidence, verdict — is retained. The next person to propose moving this number starts from the answer instead of the argument.

Retained after this change

The question asked, the values tried, the interval at the moment of the call, which thresholds were in force, and who approved the promotion.

Searchable by parameter, surface, or metric

Keep reading

The mechanics behind this page.

Start with this one number

Parameterize it this week. The first measured change usually pays for the integration.