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

HazelJS

Local-first · Apache 2.0 · TypeScript

What Is an Agent OS?

An Agent OS is the production lifecycle for AI agents — runtime, orchestration, governance, security, durability, and observability. It is not a bootable host OS. HazelJS implements Agent OS for TypeScript inside your Node backend.

npm install -g @hazeljs/cli
hazel new agent support-agent
cd support-agent && npm install
hazel apply

Architecture

Inside HazelJS Agent OS

TypeScript
01

Define & Deploy

Version identity, prompt, skills, and policies as DNA. Declare desired state with Store/Apply — tools stay in TypeScript.

DNAStoreApply
02

Run

Agent Runtime executes the loop. Agent VM classifies effects and enables speculation/undo. Organism self-organizes specialists from a mission and environment signals.

RuntimeAgent VMOrganism
03

Decide

Bounded closed-set judgment before side effects. Evidence, judge, critic, and confidence inform policy — never authorize. Default provider is native hazel-agent, not an external-model wrapper.

Decision RuntimeConfidencePolicy
04

Govern

Skillgate curates which APIs become capabilities. Gatekeeper authorizes each tool call — default deny, approvals, rewrite.

SkillgateGatekeeper
05

Survive

Durable runs, crash-safe HITL, leases, state, and recovery — so agents outlive process restarts.

Durable RunsHITLRecovery

TypeScript / Node.js Backend

Runs beside your APIs — local-first, no separate runtime plane required.

Define → Run → Decide → Govern → Survive

What is unique

What you cannot get from LangChain alone

Packaging, durable approvals, and governed skills — inside the same Node process as your APIs.

01

DNA + Store

Version prompt and policies like libraries. Tools stay in @Tool code — DNA is not the implementation.

02

Crash-safe HITL

Refunds and freezes suspend on durable AgentRun. Restart mid-approval without losing the run.

03

Skillgate + apply

Curate REST into governed skills. Declare Definitions locally — apply does not restart Node. Kubernetes optional.

04

Agent Gatekeeper

Authorize every protected tool call before execution. Default deny, deterministic policies, and crash-safe approval — independent of the LLM.

05

Decision Runtime

Closed-set choose before side effects. Confidence informs policy; Gatekeeper still authorizes. Native hazel-agent pipeline — not an external-model wrapper.

06

Agent VM

Effect-typed tools (@Pure, @Read, @Reversible, @Irreversible) — speculative branches, transactional undo, automatic compensation on losing paths.

support-desk.ts
await runtime.execute('support-desk', message, {
  loop: { maxIterations: 4, successScore: 90 },
  contract: { name: 'support-slo', maxLatencyMs: 30_000, fallbackAgent: 'safe-desk' },
  recovery: { maxRetries: 2, fallbackAgent: 'safe-desk' },
});
Mental model

DNA ≠ tools · Store ≠ platform ≠ run

Three layers, one backend. Overlay never replaces your @Tool handlers with stubs.

1DNA / Store

Package identity, prompt, policies, versions, lockfile

2Platform apply

Desired Definitions / Deployments — local control plane

3App runtime

Real @Tool / Skillgate execute, HITL, timelines

Anti-confusion

Pick the right command

Apply declares desired state. Your app still runs the tools. Chat is always real execute.

hazel apply

Start hazeld + register DNA — survives terminal close

hazel agent apply

Files-only desired state (no supervisor)

hazel agent run

DNA smoke with stubs — not product money moves

Flagship

Clone Meridian — see the whole Agent OS

One repo that teaches DNA vs tools, Store vs platform vs run, Skillgate, router, and HITL. Copy the pattern into your product.

01

store:sync

Publish DNA packages + lockfile

02

platform:sync

Apply Definitions / Deployments

03

npm run dev

Chat with real @Tool handlers

terminal

cd hazeljs-meridian-ops && npm i && npm run store:sync && npm run platform:sync && npm run dev
FAQ

Agent OS, explained

Short answers for the search query — then clone Meridian or read the guide.

What is an Agent OS?+

An Agent OS is the production lifecycle for AI-native agents: durable runs, packaging, governance, recovery, and CI — not a bootable host operating system. HazelJS Agent OS runs that lifecycle inside your TypeScript / Node backend, in the same DI app as your APIs. Read the long-form article

What is HazelJS Agent OS?+

HazelJS Agent OS is durable AI agents inside your TypeScript backend: DNA packages, crash-safe HITL, Skillgate, Gatekeeper authorization, and local apply/reconcile. It is not a bare-metal OS and not a Python-only kernel.

Is HazelJS the same as Builder Methods Agent OS, Agno AgentOS, or agentos.sh?+

No. Builder Methods Agent OS is a markdown standards and spec system for coding agents (Claude Code, Cursor). Agno AgentOS is a Python FastAPI runtime for serving agents. Framers AgentOS (agentos.sh) is a separate TypeScript agent framework. HazelJS Agent OS is the production lifecycle for durable agents inside your TypeScript / Node backend — DNA, Skillgate, Gatekeeper, crash-safe HITL, and local apply in the same DI app as your APIs.

Is DNA the same as tool implementation?+

No. DNA owns identity, prompt, tool names, and policies. Real side effects stay in TypeScript @Tool handlers or Skillgate. Overlay never replaces tools with stubs.

Does apply restart my Node app?+

hazel apply ensures the local hazeld node, registers DNA, and returns — agents keep running after you close the terminal. The older hazel agent apply path only writes desired state files without starting a supervisor.

Can I undo agent side effects or speculate across plans?+

Yes — with @hazeljs/agent-vm. Tools declare effect classes (@Pure, @Read, @Reversible, @Irreversible). @Speculate forks K reasoning branches; the winner commits and losers roll back via @Compensate handlers. @Atomic enables transactional undo of entire runs.

What is an Agentic Organism?+

With @hazeljs/organism you deploy a mission, genes, and constitution — not a fixed agent graph. Environment signals drive spawn, reuse, specialization, survival, and a resource economy under hard safety limits. Embed with createOpsOrganism and OrganismHostRegistry; a durable OrganismRepository hydrates the same organism across process replicas.

What is Decision Runtime?+

@hazeljs/decision is the native Decision Runtime for Agent OS: closed-set choices, confidence, and deterministic policy before Gatekeeper authorizes side effects. Confidence never means permission. The default provider is hazel-agent — not a wrapper around an external decision model.

Do I need Cloud or Kubernetes?+

No. Local registry and local backend are enough. Hosted registry and K8s are optional.