Decision model
An optional fast model for tool calls. It runs in front of the LLM judge, or on its own for the connectors you list. Off by default. The skill scanner records its score as advisory only.
The decision model is a small, fast model that answers one question per tool call, "allow, confirm or block?", with calibrated probabilities. It is off by default.
Like the unified LLM key, it is one setting, decision_model:, used by two components:
| Component | What it does with the decision model |
|---|---|
| Guardrail (tool calls) | Answers tool calls, in front of the LLM judge or on its own (see the cascades below). |
defenseclaw skill scan | Records the model's score for the skill. Advisory only: it never adds a finding or changes the verdict. |
Three cascades
The rules always run first. What runs after them is set per connector:
| Cascade | Set up with | Who answers a tool call the rules let through |
|---|---|---|
| 1. Rules only | nothing (the default) | Nobody: the rule verdict stands. |
| 2. Rules, then the decision model | the connector in decision_model.hook_connectors, no LLM judge for it | The decision model. |
| 3. Rules, then the decision model, then the LLM judge | the connector in guardrail.judge.hook_connectors, with the decision model on | The decision model decides the clear calls and the judge the rest. |
A connector the judge covers always gets cascade 3, listed or not. A connector in neither list stays rules only.
Before you start
- A decision model endpoint that speaks the System One protocol:
POSTa JSON body{model, state, questions}and get backanswerswith probabilities. It can be a server on the same machine (http://127.0.0.1:...) or a hosted service overhttps. - For cascade 3, the LLM judge turned on for the connector. Cascade 2 needs no judge.
Each tool call the model answers is one network call to the URL you configure. Plain http is accepted only for a loopback host; any other host needs https.
Turn it on
-
Point DefenseClaw at the endpoint, and name the connectors it should answer for on its own:
defenseclaw setup decision-model --base-url https://dm.example.com/v1/systemone --model jev-1.13.0 --connectors claudecode,codex --ping--connectorstakes names or*and replaces the list;--connectors ""clears it (cascade 3 only). Run the command with no flags to answer the questions instead. The running gateway applies the change without a restart. -
If the endpoint needs a token, store it. The prompt is hidden and the value goes to
~/.defenseclaw/.env.defenseclaw keys set DEFENSECLAW_DECISION_MODEL_KEYThen restart the gateway so it loads the token:
defenseclaw-gateway restart. -
Check it.
defenseclaw setup decision-model --show --ping defenseclaw doctor--showand thedoctorDecision model row name the cascade of each active connector, for exampleclaudecode: rules -> decision model; codex: rules -> decision model -> LLM judge.doctorshows the row only while the model is on.
During defenseclaw init
The init wizard asks one optional question, Do you want to use a decision model?, when it puts at least one connector in action mode, with or without the LLM judge. The default is no. Yes asks for the endpoint URL, the model name, the token variable and, hidden, the token, and lists the action-mode connectors in decision_model.hook_connectors.
In scripts, pass the flags; --yes alone leaves it off:
defenseclaw init --yes --decision-model-url https://dm.example.com/v1/systemone --decision-model-name jev-1.13.0
defenseclaw quickstart --decision-model-url http://127.0.0.1:8791/v1/systemone --decision-model-name my-model --decision-model-connectors codexWithout --decision-model-connectors the action-mode connectors are listed. init --no-decision-model turns it off. The init report has a Decision Model step that says whether the endpoint answered.
How it decides
Risk is 1 - P(allow) from the model's answer.
| The model says | Cascade 2 (no judge) | Cascade 3 (with the judge) |
|---|---|---|
allow, risk at or below allow_threshold (0.30) | Allow. | Allow; the judge does not run. |
block, risk at or above block_threshold (0.75) | A CRITICAL JUDGE-DECISION-MODEL finding: blocked at every built-in block_at. | A HIGH JUDGE-DECISION-MODEL finding, and the judge runs and can raise it (on_confident_block: escalate, the default). With decide the finding stands and the judge does not run. |
| anything else (confirm, or a weaker allow or block) | A HIGH JUDGE-DECISION-MODEL finding that asks for confirmation (below). | The judge decides. |
A cascade-2 confirmation:
- At a
block_atof HIGH or lower (the strict policy) it blocks. - Otherwise the agent asks the user where its hook can ask before a tool runs: Claude Code (in its default Manual permission mode), Antigravity, Amp and GitHub Copilot in VS Code.
- Where the agent cannot ask (Codex, or Claude Code outside Manual mode) it is a HIGH alert under the default and permissive policies, as an LLM judge HIGH finding is.
The rules always come first. A rule block is never revisited, and the decision model never lowers a rule finding: on a call the rules flagged, an allow keeps the rule verdict (cascade 2) or still runs the judge (cascade 3). Every finding goes through block_at and alert_at like a judge finding. In observe mode nothing is blocked or asked.
When it is down
A decision model that is unreachable, slower than timeout (1 second; in cascade 3 never more than a quarter of the judge's remaining time), or answers outside the protocol never allows a call by itself:
- Cascade 2: the rule verdict stands, exactly as when the LLM judge is down. The gateway log says
hook judge unavailable, and the judge fallback counter goes up. - Cascade 3: the judge decides that call exactly as it does without a decision model.
Each call is recorded as a judge event of kind decision_model with its action (allow, block, confirm, escalate or error), latency and failure class. After three failures in a row DefenseClaw stops calling it for 30 seconds.
Skill scans
defenseclaw skill scan passes the decision model to the skill scanner's System One tier (skill-scanner 2.3 and later). The tier asks whether the skill is unsafe to install and records the probability:
Decision model: jev-1.13.0 scored 0.12 unsafe (advisory only; it does not change the verdict)The score is also under settings.decision_model in skill scan --json. The skill scanner treats the tier as advisory on purpose: the model it measured did not separate malicious from benign skills. Keep the LLM judge on for skill verdicts. The install watcher does not call the decision model.
Managed devices
On a managed device the administrator sets decision_model: in the admin config.yaml or signed policy bundle, like llm:. A standard user cannot change it: setup decision-model and the TUI are refused by the managed config writer. The gateway reads the token only from the protected credential named by decision_model.credential, in the same secrets directory as enterprise.inspection.llm.credential; api_key_env and the user's .env are ignored.
Settings
| Key | Default | Meaning |
|---|---|---|
decision_model.enabled | false | Turn it on. Needs base_url and model. |
decision_model.model | empty | Model name sent in each request. |
decision_model.base_url | empty | Full endpoint URL. https, or http to 127.0.0.1, ::1 or localhost. No credentials in the URL. |
decision_model.hook_connectors | empty | Connectors (or *) whose tool calls it answers on its own where the LLM judge does not run (cascade 2). Empty: only in front of the judge. |
decision_model.api_key_env | DEFENSECLAW_DECISION_MODEL_KEY | Variable that holds the bearer token. An unset variable sends no token. |
decision_model.credential | empty | Managed devices only: protected credential that holds the token. |
decision_model.timeout | 1 | Seconds per call (up to 30). In cascade 3 the gateway also caps each call at a quarter of the time left for the judge. |
decision_model.allow_threshold | 0.30 | Risk at or below which an allow is confident. |
decision_model.block_threshold | 0.75 | Risk at or above which a block answer is confident. |
decision_model.on_confident_block | escalate | Cascade 3 only: escalate or decide. |
In the TUI, open 0 Setup, press c for the config editor and pick the Decision Model section.
Benchmarks
The routing and thresholds are the operating point measured in the System One benchmark, with OpenJev as the decision model and Gemma 4 as the judge:
- Broad corpus (3,817 tool calls, 3,381 benign): cascade 3 cut judge traffic from 100% to 16% and false blocks from 23 to 14, with block-only F1 from 0.712 to 0.738. Cascade 2 had 13 false blocks, F1 0.702, and asked for confirmation on 8.5% of calls.
- Production-weighted corpus (24,476 calls, 99% benign): cascade 2 scored F1 0.213 against 0.082 for cascade 3, with 224 false blocks of 24,255 benign calls and confirmations on 6.6%.
- Only the single-choice question format (Q2, one disposition plus two scores) is worth a tier: the yes/no probe formats scored a block-only F1 of 0.03 to 0.04 alone (appendix, section 3). DefenseClaw sends Q2 only, with the benchmark's production bound of 12,288 bytes of state: 2,048 for the user's request, 7 earlier calls of 1,024 and 3,072 for the current call.
- Latency depends on the server (appendix, section 3). On the production-weighted corpus the hosted Jev 1.13.0 answered in 0.40 s median (3.1 s at p95); on the broad corpus in 1.42 s median (7.4 s at p95). Every self-hosted run on the benchmark's busy GPU had a median of 1.36 s or more: DiffusionGemma 1.36 s and OpenJev 5.19 s on the production-weighted corpus, and DiffusionGemma 3.66 s and 7.35 s and OpenJev 19.4 s on the broad corpus.
- A hook call waits only a few seconds for a model (about 3.4 s on a per-user tool-call hook) before it keeps the rule verdict. At the default
timeoutof 1 second most calls to those self-hosted models time out, so measure your server and raisetimeout(up to the hook's wait) before you rely on cascade 2. A model slower than the hook's wait cannot answer in cascade 2: every call then keeps the rule verdict.
Check each model's licence before you deploy it (the OpenJev weights are CC BY-NC 4.0, non-commercial).
Limits
- Tool calls only. Prompts, completions and tool results go to the judge as before.
- A connector in neither
decision_model.hook_connectorsnor the judge's list gets no decision model (doctorandsetup decision-modelsay so). - Even the best model in the benchmark blocked only about 58% of proven compromises: it adds a layer, it does not replace the rules.
- The skill-scan score is advisory and is not used by the install watcher.
- Secure Client deployments refuse
decision_model.
Unified LLM key
Wire up DEFENSECLAW_LLM_KEY — the single environment variable that powers the LLM judge, the MCP / skill / plugin scanners, and any custom LLM call DefenseClaw makes through Bifrost.
Deterministic detection benchmarks
Public F1, false-positive, benign-block, YARA, privacy, and bounded-chain results for DefenseClaw's deterministic guardrails.