New: Decision Runtime — closed-set judgments for Agent OS. Read the guide →
HazelJS LogoHazelJS

Decision Runtime

Decision Runtime (@hazeljs/decision) performs closed-set decide() judgments with confidence and policy. The default provider is hazel-agent. Confidence never means permission — Gatekeeper still authorizes side effects.

01What it is

A bounded judgment API: createDecisionRuntime + decide() over a closed set of options, with strategies like fast | standard | deliberate | human-required | rules. Default provider: hazel-agent. Reasoning ≠ Decision ≠ Policy ≠ Authorization ≠ Execution — Decision Runtime owns only the decide step.

02Problem it solves

  • Stop treating “model said yes” as “system may execute”
  • Typed closed sets instead of free-form tool freelancing
  • Hybrid rules + custom policy before a provider is even called
  • Optional Decision Lab shadow compare (runWithShadow) without changing prod path

03How you use it today

Call decide() with a question and options; optionally resumeFromHuman, replay, getResultAsync. Wire Skillgate risk floors and Gatekeeper deny-by-default so a high-confidence decide still cannot skip authorization. Full walkthrough: Decision guide.

04Where it sits in the stack

Decide layer between Run and Govern: Runtime → Decision → Gatekeeper → Tool. Fits next to Skillgate classification and before any irreversible effect.

05Boundaries

  • Confidence never means permission
  • History is never auto-prompted into the next decide()
  • Decision Runtime is not a replacement for Gatekeeper or Skillgate

06FAQ

Can decide() authorize a refund tool?
No. It picks among closed options. Gatekeeper still allow / deny / require-approval.
What is the default provider?
hazel-agent. You can swap OpenAI / Gemini / local / ensemble providers via the package APIs.
When do I use human-required strategy?
When the closed set must pause for a person before a choice is final — then resumeFromHuman.

07Closed-set decide()

typescript
import { createDecisionRuntime } from '@hazeljs/decision';

const decisions = createDecisionRuntime();
const result = await decisions.decide({
  question: 'Should we auto-refund this order?',
  options: [
    { id: 'auto', label: 'Auto-refund' },
    { id: 'hitl', label: 'Require human approval' },
    { id: 'deny', label: 'Deny' },
  ],
});
// Confidence is not permission — Gatekeeper still authorizes the tool.