TypeSafe: what it is and when to use it

September 17, 2026 · View on GitHub

TypeSafe is a decision API, not a chat model. Jev (their System One model) evaluates a state against typed questions and returns values your code can branch on: no generated prose, no “please return JSON” parsing.

Three primitives, mixable in one request (they run in parallel, typically ~100ms):

PrimitiveQuestionReturns
ChoiceWhich of these options?choice, probabilities, confidence
ScoreWhere on this rubric?score (can fall between levels), probabilities, confidence
NoulIs this true?noul 0–1 (yes-probability; no separate confidence)

Code owns control flow, math, lookups, and side effects. Jev only supplies the snap judgments.

When to use it

  • Route / classify / score / yes-no over text or JSON
  • You already know the shape of the answer (closed set, rubric, true/false)
  • You want calibrated probabilities and a confidence gate (act / review / escalate)
  • You would otherwise prompt an LLM and scrape JSON out of the reply
  • Guardrails on LLM I/O, reranking retrieved candidates, filling closed-set arguments

When not to

  • Generating text, code, plans, or explanations — use a reasoning/chat model
  • A deterministic rule already decides it (dates, exact IDs, regex, schema)
  • Broad questions like “what should we do?” — split them, or use a reasoning model
  • You are already in an agent loop doing the reasoning — don’t add a TypeSafe round-trip just to “think”

How to design questions

  1. One coherent snap judgment per question. “Refund requested?” is good. “Analyze this ticket and decide” is not.
  2. Split independent factors; weight them in your code. When priorities change, change a coefficient, not a prompt.
  3. Put every independent question about the same state in one typesafe ask, including speculative ones you’ll ignore on some paths. A second request only when you must fetch more evidence from the first answer.
  4. Choice: closed set; add other / none if the list might not cover the input.
  5. Score: ordered, self-describing levels — not vague low/medium/high.
  6. Noul 0.5 means yes and no are equally likely, not “medium intensity.”
  7. Gate high-stakes actions on Choice/Score confidence, or on Noul distance from 0.5. Start conservative; tune on your data.

A good default: you (or a coding agent) design the questions; TypeSafe executes the judgments; code applies thresholds and side effects.

Natural first slices

  • Inbound guardrails — many atomic hazard questions (jailbreak, credential harvest, unexpected reward, …) in one call, then your weights
  • Intent routing — ticket, message, or call → handler, with confidence escalate-to-human
  • RAG — score retrieved passages; drop injection; flag contradictions
  • Closed-set labels you currently generate as free text (categories, departments, severity)
  • Agent skill routing — “does this turn need a skill, and which one?”

Do not sprinkle TypeSafe into every prompt. One thin slice with logged questions and thresholds beats a dozen half-wired classifiers. Guardrails or intent routing are usually the highest-payoff first slices.

CLI

Auth is the TYPESAFE_API_KEY environment variable.

typesafe info
typesafe smoke
typesafe ask --state "…" --noul is_urgent="Does this convey urgency?"

Vendor docs: https://docs.typesafe.ai/llms.txt
Intro: https://docs.typesafe.ai/introduction