Decision Models (TypeSafe AI)
TatsuCode integrates TypeSafe AI as a decision-model provider. Where a chat model generates text, TypeSafe's System One model (Jev) answers typed questions about a piece of state and returns one constrained answer per question, with probabilities and a confidence figure, in roughly 100 to 500 ms.
Load the typesafe-ai skill and two things happen: the agent gains a TypeSafe tool it can use inside a task, and it gains the reference material to build the same calls into your own game or application code.
Bring your own key. TypeSafe is a separate service under its own terms. TatsuCode never proxies, pools, or bills for it. Create a key at console.typesafe.ai and paste it into Provider Connections → Decision Models.
What a decision model is
You send state (plain text, a JSON object, or an array) plus a map of questions. Each question has a type, an instruction, and the answer space you allow. The model returns one answer per question in a single pass. Because the answer is constrained to the options you supplied, a schema-invalid result is impossible; a wrong answer is still possible, so treat each call as a fast semantic if statement with a confidence attached.
| Type | Asks | Returns | Typical use |
|---|---|---|---|
| choice | Which one of these? | The chosen option, a probability per option, confidence | Routing, classification, picking an action (up to 255 options) |
| score | Which level on this scale? | A position on 2 to 10 ordered levels, a legend, probabilities, confidence | Severity, quality, risk, satisfaction |
| noul | Is this true? | P(yes) from 0 to 1 | Presence checks, flags, one-per-label multi-label |
Good fit: bounded answer spaces, many small judgments over the same state, latency-sensitive loops, cost-sensitive bulk labelling. Not a fit: prose, code generation, explanations, multi-step planning, arithmetic, counting, or date math (do those in code).
Setup
- Open Provider Connections with
/connect. - Find the Decision Models row and click Configure next to TypeSafe AI.
- Paste your key and click Save & Verify. TatsuCode checks the key against TypeSafe's API before storing it locally with your other credentials.
- Load the skill:
/skills→ typesafe-ai.


If the agent calls the tool before a key is configured, the tool tells it so, and the agent asks you to add one in Provider Connections. It will never ask you to paste a key into the chat.
Using it inside a task
Once the skill is loaded, the agent reaches for TypeSafe on its own when a step is a bounded judgment rather than a piece of writing. Examples of requests that trigger it:
Triage these 40 failing tests into flaky, real regression, or environment
Rank these search results by relevance to the ticket and keep the top five
Screen this folder of abstracts: include, exclude, or needs a human
Is this shell command destructive? Gate it before running
Which of these three UI variants best matches the brief?
The chat shows a TypeSafe card with the purpose of the call, then a digest of the answers: the chosen option and its probability for a choice, the nearest level and its description for a score, and P(yes) for a yes/no question. Low-confidence answers are visible, so you can see where the agent decided to ask you instead of acting.

Building it into your own code
The skill is also a build reference. Ask for a feature and the agent writes the calls directly, reading the key from TYPESAFE_API_KEY or your project's secret store, never hardcoded and never shipped in a browser bundle.
Four bundled guides cover the common shapes:
| Guide | Covers |
|---|---|
| Game loops | Real-time NPC, enemy, and simulation decisions in Unity, Godot, Unreal, or a browser game: state snapshots, action choice, danger scoring, warm-up calls, fixed-timestep budgeting |
| App patterns | Intent routing, classification, reranking, guardrails and moderation, extraction by selection, entity matching, structure recovery, uncertainty handling |
| Agent control | Using decisions to steer an agent: pre-flight checks on risky actions, tool selection, result verification, escalation thresholds |
| Workflows by role | Worked examples for game developers, app developers, researchers, data and ML engineers, QA and DevOps, content and compliance teams, with field evidence from teams that have shipped on it |
A few design rules the agent follows, and that you can hold it to:
- One narrow judgment per question. Split independent dimensions; batch everything about the same state into one call (state is billed once, questions run in parallel).
- State carries the facts, instructions carry the judgment, criteria carry the answer space. Prefer a JSON object with named fields over one blob.
- Include a no-match option (
other,none,hold) whenever the list might not cover the input. - Selection over generation. Find candidates in code, then ask the model to select the right one. It cannot choose a value you left out.
- Gate by consequence. Act automatically above a high confidence, confirm in the middle, escalate below 0.5. Start conservative and tune on your own data.
Cost, limits, and data
- Pricing is per input token, with output free; state is billed once per request no matter how many questions ride along. Check TypeSafe's site for current rates.
- Limits: text only, about a 32k-token state budget, up to 255 options per choice, 2 to 10 levels per score. The tool validates question shapes locally before spending a request and reports 401, 422, 429, and 529 errors in plain language, retrying rate limits with the server's suggested delay.
- Data: requests go from your machine straight to TypeSafe AI under your key. TypeSafe processes requests in the United States and states that it does not train on customer inputs. See Third-Party Services for links to their policies.
- Provider guidance: TypeSafe's customer agreement permits integrating the service into products and prohibits reselling access or publishing benchmarks; TatsuCode does neither.
Next Steps
- Providers — the Decision Models row in Provider Connections
- Agent Skills — how skills activate tools
- Tools Reference — everything else the agent can do