What is an Agent OS? (HazelJS)
Agent OS is the production lifecycle for AI-native TypeScript agents inside a Node backend — durable runs, Skillgate, policies, DNA — not a bare-metal OS.
Read more →Operate agents like production systems.
Durable execution · Agent DNA · Skillgate · Gatekeeper · HITL · Observability
Frameworks build agents. HazelJS operates them.
Architecture
Control Plane
L1Agent DNA
L2Agent Runtime
L3Skillgate
L4Agent Gatekeeper
L5Durable Kernel
L6TypeScript / Node.js Backend
Define → Deploy → Run → Govern → Observe → Evolve
Agents are easy to prototype but difficult to operate reliably. Production agents need durable execution, governed capabilities, policy enforcement, approval flows, observability, testing, and safe rollout workflows. HazelJS brings these primitives together in one TypeScript-native platform.
01
Prompt loops, tool calling, and model adapters get you to a demo.
02
Durable runs, governed skills, Gatekeeper authorization, DNA packaging, HITL, and deployment lifecycle keep agents alive in production.
03
Runtime, governance, kernel, and control plane — not a glue stack of Nest + LangGraph + workers + a vendor console.
Operate agents like production systems. Agent OS gives them the lifecycle primitives demos never need — and real traffic always does.
Agent crashes mid-run
Runs survive process restarts with checkpointed state.
Agent wants to perform risky actions
Default-deny authorization before every tool call, with governed skills and human approval.
Prompt / model / skill behavior changes
Version identity, model, skills, and policy like packages.
Need safe rollout and testing
Test agent behavior before it reaches production traffic.
Need debugging and visibility
Trace plan → execute → critique with full run history.
Multiple workers / concurrency control
Coordinate workers safely without lost or double work.
Need resilient stateful execution
Runs, HITL, leases, state, and recovery as OS primitives.
Every piece is a layer of the operating system — not a standalone feature bolted on later.
Desired-state / deployment
Store, Deployments, Reconcile, and Observe — declare how agents should run and keep reality in sync.
Packaging / definition
Identity, model, skills, policy, and SLO packaged as versioned specs — tools stay in TypeScript code.
Execution loop
Plan → Execute → Critique → Validate inside your DI app — the same process as your APIs.
Governance boundary
Turn selected APIs into governed agent capabilities. Reads by default. Writes need approval.
Authorization boundary
Whether this agent may call this tool now. Default deny, deterministic policies, approvals, and rewrite — not a prompt guardrail.
Lifecycle primitives
Runs, HITL, leases, state, and recovery — the substrate production agents need to survive.
Built on your TypeScript / Node.js backend. Local first. Kubernetes optional — never the product.
From definition to production — a clear operating loop, not a one-shot prompt script.
Define with Agent DNA
Deploy through control plane workflows
Run with durable runtime
Govern via Gatekeeper, Skillgate, and policies
Observe with Inspector
Evolve safely with tests and digital twins
A Kubernetes-like mental model for AI agents — apply desired state, run, inspect, and read logs.
$ hazel agent apply support-agent.yaml
$ hazel agent run support-agent
$ hazel agent inspect support-agent
$ hazel agent logs support-agentapiVersion: hazeljs.ai/v1
kind: Agent
metadata:
name: support-agent
spec:
dna:
version: 1.2.0
runtime:
replicas: 3
skills:
- orders.read
- refunds.create
policy:
refunds.create:
approval: required
budget:
maxCostPerRun: 0.05One 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 devLocal Store is enough to start. Hosted registry (promote/share packages) is an optional Team SKU — never required for local correctness.
NestJS gives you APIs. LangChain gives you loops. HazelJS is the open-source Agent OS — durable process, DNA packaging, Skillgate, and local apply inside the same TypeScript backend.
Great APIs — AI agents are still an add-on.
NestJS structures backends well. Shipping durable agents still means bolting on LangChain, state stores, and approval workflows yourself.
Run durable agents with @hazeljs/agent. Authorize every tool call with @hazeljs/agent-gatekeeper. Clone Meridian to learn the full path; add Skillgate when REST becomes tools.
Runtime pair
The kernel executes the loop. Gatekeeper is the authorization boundary before every protected tool call — default deny, deterministic policies, not a prompt guardrail.
Runtime + durable lifecycle
Durable runs, HITL, leases, policies, and DNA overlay — the Agent OS kernel inside your TypeScript DI app.
Install
npm install @hazeljs/agentAgent OS example
const result = await runtime.execute('support-desk', goal, {
loop: { maxIterations: 4, successScore: 90 },
contract: { fallbackAgent: 'safe-desk' },
});Authorize every tool call
Deterministic authorization before protected tool execution. Agents propose. Gatekeeper decides — default deny, not a prompt guardrail.
Install
npm install @hazeljs/agent-gatekeeperGatekeeper example
await gatekeeper.execute({
context,
tool: fromFunction('stripe.refund', refund),
});Learn the path
Primary path — clone and learn
See the full Agent OS in one repo — DNA, Store, Skillgate, HITL, and local apply. Copy the pattern into your product.
Install
npm run store:sync && npm run platform:sync && npm run devTour path
# DNA ≠ tools · Store ≠ platform ≠ run
# apply does not restart Node — overlay on bootGovernance boundary
Turn selected REST endpoints into governed agent capabilities. Reads by default. Writes need approval.
Install
npm install @hazeljs/skillgate @hazeljs/agentSkillgate example
const gate = Skillgate.fromOpenApi(spec, {
include: { tags: ['agent'] },
});
gate.register(registry, 'api-concierge');Proof that HazelJS packages ship real products. Zynli is multi-tenant AI support (RAG, flows, billing) — supporting ecosystem, not the Agent OS teaching path. For DNA, HITL, Skillgate, and apply, clone Meridian.
Zynli.AI
Live in productionMulti-tenant AI support — RAG, flows, billing, and real-time handoff. Built by HumanBee AB.
01
Visitors get KB-grounded answers first; low-confidence turns escalate to live agents with full context.
02
Intent routing runs order tracking, ticket creation, and custom HTTP actions — HazelJS stack patterns in production.
03
Multi-tenant workspaces, subscriptions, real-time Socket.IO, and an embeddable React widget — shipped, not a demo repo.
HazelJS stack in production
Try the support widget on this page — it runs on the same HazelJS RAG stack as Zynli.
// KB → guided flow → ticket bot → LLM → human handoff
await askRag(question, tenantId, { sessionId });
await matchVisitorIntent(tenantId, message);
await tryExecuteVisitorFlow({ conversationId, tenantId, ... });Prefer Meridian or Agent OS for durable agents. Use @hazeljs/ai only if you need a light prompt→RAG→agent chain inside an existing app.
npm install @hazeljs/core @hazeljs/aicd my-app && npm install && npm run devBrownfield HCEL — orchestration without Agent OS packaging or HITL.
// 1. Setup DI
// 2. Configure OpenAI Adapter
// 3. Setup LangChain Chain
// 4. Manually pipe input to RAG
// 5. Manually pipe RAG output to Agent
// 6. Handle tool failures manually
// 7. Write 50 lines of boilerplate...
async execute(input) {
const docs = await this.rag.search(input);
const prompt = this.template.fill(input, docs);
const agent = new AgentExecutor({ ... });
return agent.call({ prompt });
}// 1. Just call the chain.
// Context flows implicitly.
async execute(input) {
return await this.ai.hazel
.prompt(template)
.rag('docs')
.agent('specialist')
.execute(input);
}Deep dives on Agent OS, agent lifecycle, Skillgate, DNA, and what we are shipping next.
Agent OS is the production lifecycle for AI-native TypeScript agents inside a Node backend — durable runs, Skillgate, policies, DNA — not a bare-metal OS.
Read more →Curate OpenAPI / REST into agent tools with HITL defaults, then register on Agent OS or export to MCP. Opt-in by design.
Read more →
Crash-safe HITL, Prisma SQL AgentRun stores on any SQL provider, worker leases, and hazel agent run — Agent OS kernel Gamma.
Read more →Get help from developers shipping production AI agents. Share patterns, debug runs, and shape the Agent OS roadmap.
Connect with students and researchers building on HazelJS at your institution.
Ask questions, share agent patterns, and get feedback from builders in the trenches.
Shape the roadmap, test new packages, and get direct access to the core team.
Clone Meridian to see Agent DNA, Store, Skillgate, and HITL in one TypeScript backend. Then keep @hazeljs/agent in your app. Apache 2.0.
Later
Today: run Agent OS locally in your Node app. Cloud registry and managed deploy are optional Team SKUs — never required to ship agents.
Correct without Cloud or Kubernetes
Promote DNA packages when you are ready
Optional — not the product
Coming later — not required now
Join 9+ developers for early access to HazelJS.Cloud
Our official consulting partner helps teams architect, implement, and ship HazelJS Agent OS in production — faster.