Connect the decision-model-preview model through an AI tool's extension mechanism. The example uses automated comment moderation: one request evaluates multiple items in parallel, returns choice, probabilities, and confidence, and routes each comment to auto-approve, hide, or manual review.
Background: Why use a decision model
For judgments such as comment moderation, ticket classification, and request routing, a common approach is to have a chat model output JSON. The rules live in the prompt and are easy to derail with adversarial content. Output is often wrapped in code fences and is unstable to parse. Each call first generates analysis text, which adds token overhead.
decision-model-preview is a decision model built for these judgments. Send state (the content to evaluate) and questions (typed questions) to the /compatible-mode/v1/systemone endpoint, and it returns structured answers directly: choice (the conclusion), probabilities (the distribution), and confidence (how certain the model is). It does not generate natural language. Questions support three types: Choice (pick an option), Score (rate by level), and Noul (return a probability from 0 to 1). One request can mix multiple questions and evaluate them in parallel.
Compared with asking a chat model to "make a judgment along the way":
- Judgment criteria are passed structurally in the
criteriafield, independent of the wording of a long prompt. - The response is JSON, with no fences or extra text, so agents and code can consume it directly.
- Answers are short structures rather than long text, which reduces output token overhead and suits high-frequency calls.
Example: Add comment moderation in Claude Code
This example uses Claude Code to connect the decision model through a Slash Command. Other tools work the same way; only the extension mechanism and configuration file path differ.
Step 1: Create a Slash Command
Configure the plan API Key (prefixed with sk-sp-) as the $ANTHROPIC_AUTH_TOKEN environment variable for curl authentication.
Create .claude/commands/review-comments.md in the project root and add the following content:
Step 2: Review comments
Prepare a comment file comments.txt with one comment per line:
Enter /review-comments comments.txt in Claude Code. Example output:
Two points in the output are worth noting:
- #5 and #9 are negative feedback and an error report, and both are judged pass. Judgment looks at the nature of the content, not the tone. Criticism, questions, and error reports are normal discussion, and this rule is written into
criteria. - #8 is a technical share with a link, and confidence is only 0.69, so it enters the manual queue. The content sits between sharing and promotion, and the probability distribution is not extreme (spam 0.84 / pass 0.16). The model clearly has a preference but is not confident enough. This is the kind of sample that the boundary descriptions in
criteriaare meant to handle. The routing threshold is set in step 4 of the Command. Raise it for more conservative behavior, or lower it for more automation.
Understand the three returned fields
Answers are returned under the same keys as questions. Each Choice answer contains:
| Field | Meaning | How to use it |
|---|---|---|
choice | The selected option | Branching: approve or hide |
probabilities | Probability of each option; the sum is 1 | Display, sort, or weight |
confidence | Confidence in the judgment, from 0 to 1 | Threshold routing: high values run automatically, low values go to manual review |
questions are user-defined and do not participate in reasoning. For "degree" judgments, use Noul (return a probability from 0 to 1) or Score (rate by level). One request can mix them.
Other tools
The following table lists extension mechanisms and configuration file paths for mainstream AI coding tools that support extensions. Save the configuration from the Claude Code example to the corresponding path.
Tool | Extension mechanism | Configuration file path |
|---|---|---|
Claude Code | Slash Command |
|
Codex | Skill |
|
Qwen Code | Skill |
|
OpenCode | Agent |
|
OpenClaw | Skill |
|
Hermes Agent | Skill |
|
Qoder | Skill |
|
Notes
- Write judgment boundaries in
criteria. For edge cases such as "what counts as spam" (for example, a technical share with a link), a clear option description works better than repeated rewording of the question. - Break complex judgments into smaller ones: ask one clear question at a time, evaluate each dimension separately, and combine the results in the routing rules of the Command.
- A low
confidencemeans the model is explicitly unsure. Routing to manual review works better than retrying. The 0.9 threshold is an example; adjust it based on the cost of a wrong judgment. - Handle request failures by status code:
401means check the API Key,422means request body validation failed (the response body identifies the invalid field), and429and529should be retried with backoff. - The model outputs a judgment and a confidence level, not a guarantee of fact. Keep human review for high-risk actions such as account bans and financial actions.