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

Production AI Agents

A demo agent answers a prompt. A production AI agent survives crashes, respects policy, leaves an audit trail, and can wait for humans. HazelJS Agent OS is the infrastructure layer that closes that gap in TypeScript.

01Demo vs production

Demos usually skip:

  • Retries and timeouts
  • Durable state and recovery
  • Authorization and least privilege
  • Audit logs / timelines
  • Human approval
  • Secrets and rate limits
  • Versioned agent packages (DNA)
  • A node that keeps running after the terminal closes

HazelJS maps these to DurableRunStore, Gatekeeper, HITL, encrypted hazeld secrets, Skillgate classification, DNA packages, and hazel apply / hazeld. See the how-to guide: Production AI agents in Node.js.

02Local-first path

hazel new agent support-agent
cd support-agent
hazel dev          # foreground — dies with the TTY
hazel apply        # hazeld keeps agents Running

03Agent with approval-gated tool

typescript
import { Agent, Tool } from '@hazeljs/agent';

@Agent({
  name: 'ops-agent',
  systemPrompt: 'Triage incidents; escalate refunds.',
})
export class OpsAgent {
  @Tool({
    description: 'Issue a refund',
    requiresApproval: true,
    parameters: [
      { name: 'orderId', type: 'string', required: true },
      { name: 'amount', type: 'number', required: true },
    ],
  })
  async refund(input: { orderId: string; amount: number }) {
    return { ok: true, ...input };
  }
}