Most teams start with rules spread across prompts and policy documents. Building a Decision puts them in one place, in a form a person can read and a machine can check.
The result is a draft. It can be tested and changed as often as you like, and nothing calls it until it is published.
- Who
- The person who owns the rules, with or without an agent
- Where
- The editor in the app, your agent over MCP, or the CLI
- You end up with
- A checked draft, ready to test
Write it in plain YAML.
Every Decision has the same parts: the model it uses, the facts each caller sends, the rules that stay the same and the questions it answers. YAML is the main format and JSON works too. TypeFuse keeps exactly what you wrote.
state_schemachecks the facts on every callcontextholds your rules and reference materialquestionsuse TypeSafe’s own types:noul,choiceandscore
acme/refundsrefunds.yamlDraftformat: 3model: jev-1.13.01state_schema:2type: objectrequired: [days_since_delivery, item_condition]properties:days_since_delivery: { type: integer, minimum: 0 }item_condition: { enum: [new, used, damaged] }context:3policy: Refunds within 30 days, or later if it arrived damaged.questions:4route:type: choiceinstructions: Where should this refund request go?criteria:approve: Inside the policy.review: Outside the window but damaged.decline: Outside the policy.
- 1
modelOne pinned model, the same for every call of a release. - 2
state_schemaThe facts each caller sends, checked on every call. - 3
contextYour rules and reference material, the same for everyone. - 4
questionsWhat it answers, in TypeSafe’s own question types.
Describe it to your agent.
With the TypeFuse skill installed, your agent can draft a Decision from a description, add Worked Examples and run the tests. You read the draft and say when it’s ready to publish.
- Claude Code and Codex through the skill, and any MCP client
- Drafts stay drafts until you say they’re ready
- The same checks run on what your agent writes
- create_decision
acme/refundsfrom your descriptiondraft saved - add_example6 Worked Examples from past ticketsadded
- promote_exampleall 6 into the Test set6 cases
- run_testsruns every case6/6 agree
- review_draftflags one overlap in the criteria1 to fix
The agent shows you the results. It publishes only with full access, once you say the draft is ready.
Checked as you type.
The editor checks the draft on every change and points at the exact field that needs work. Publishing refuses an object or a list that doesn’t say what it holds, so the draft stays editable until it does.
- The exact path, such as
state_schema.properties.items - A fix you can apply for the mechanical ones
- No model runs these checks: they are TypeFuse’s own rules
state_schema.RequiredA list needs its item shape before it can be publishedproperties. items state_schema.Fixproperties. items items[]has no maxItemsquestions.Lookroute input.order_totaldoes not exist
Ask the assistant.
“Review my Definition” reads the draft and suggests improvements, such as two criteria that overlap. “Ask the assistant” takes what you want in your own words and proposes a change. Each suggestion is a change to the draft that you accept or leave.
- Shown as a change to the YAML, with what it does
- Your call each time. Nothing is applied until you accept it
- Never published by the assistant
criteria: approve: Inside the policy.- review: Outside the window.+ review: Outside the window but damaged on arrival. decline: Outside the policy.
- Compiles
- Yes
- This change
- Behaviour
- Checked
- Fixes the problem
“review” and “decline” both matched late returns. Now only damaged items go to a person.
One question, many items.
When a request carries a list, such as the items in an order, a question can be asked once per item in the same call with each: input.items. The answers come back in the same order as the items.
- Up to 100 items in a list
- Asked together with the rest of the request
- Each item’s answer stays next to the item it belongs to
questions: eligible: type: noul each: input.items instructions: Can this item be refunded?
- item 1kettle · damagedyes
- item 2mug · usedno
- item 3lid · newyes
Where it happens.
In the app
- The Definition editor, with Review as you type
- Review my Definition and Ask the assistant
- Worked Examples beside the draft
Your agent, over MCP
- Drafts and edits through the TypeFuse skill
review_draftruns the same checks, andapply_fixapplies a fix- Publishes only with full access, once you say the draft is ready
Your code
- The source kept in your repository, sent with
typefuse draft push typefuse compilechecks it and gives advicetypefuse review --strictin CI
Private preview
Own your next decision.
Keep the judgement calls your agents and apps make under your control, with a record of every answer.
- Your criteriaThe people who own a decision set its rules, and change them when the business changes.The people who own a decision set its rules.
- Your evidenceEvery release is tested against real cases before your application ever sees it.Every release is tested on real cases first.
- Your recordEvery answer is traced and sealed, ready for an auditor or the customer who asks why.Every answer is traced and sealed.