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):
| Primitive | Question | Returns |
|---|---|---|
| Choice | Which of these options? | choice, probabilities, confidence |
| Score | Where on this rubric? | score (can fall between levels), probabilities, confidence |
| Noul | Is 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
- One coherent snap judgment per question. “Refund requested?” is good. “Analyze this ticket and decide” is not.
- Split independent factors; weight them in your code. When priorities change, change a coefficient, not a prompt.
- 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. - Choice: closed set; add
other/noneif the list might not cover the input. - Score: ordered, self-describing levels — not vague low/medium/high.
- Noul
0.5means yes and no are equally likely, not “medium intensity.” - 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