HazelJS LogoHazelJS
HazelJS Blog

2.0.14 Release notes: AI call contract + Agent OS governance

Author
HazelJS Team
11/7/2026
General
2.0.14 Release notes: AI call contract + Agent OS governance
← Back to Blog

Named models, budgets, @AgentTool, context-native complete(), runAiGolden, durable Gatekeeper HITL — plus Decision Plane, GovernedRuntime, and GovernedMemory. What shipped vs roadmap.

Shipping production LLM features takes more than a thin provider wrapper. Teams need named models, tool loops, budgets, streams, and — for HazelJS — wiring into context layers, Gatekeeper, and eval.

This release ships two stories: a production @hazeljs/​ai call contract on native providers, and Agent OS governance surfaces — Decision Plane, governed runtime, and governed memory — that enforce one policy across harnesses.


Why this release

Teams already using HazelJS for HTTP + agents were choosing between:

  1. DIY provider glue (timeouts, budgets, FakeModel, SSE) in every app, or
  2. Adopting another call layer that ignores CAG/RAG/KAG, Gatekeeper, and eval.

We closed that gap without rewriting providers onto a third-party AI SDK. Named models, retry/fallback, @AgentTool, budgets, and UI streams land on Hazel’s existing OpenAI / Anthropic / Gemini / Cohere / Ollama adapters — then plug into context, Gatekeeper, and @hazeljs/​eval.


What’s new in @hazeljs/​ai

Call contract (native providers)

CapabilityAPI
Named models + pricing + fallbackAIModule.register({ models }) + modelName
Timeout / selective retry / abortCall policy + abortSignal
Token & cost budgetsbudget: { maxTokens, maxCost }
Structured outputgenerateObject with OUTPUT_INVALID (not blind retry)
Tools@AgentTool + maxSteps loop
StreamsText + UI SSE with keep-alive and client abort
TestsFakeModel

Docs: AI package.

Three differentiators

1. Context-native calls — Pass a duck-typed @hazeljs/​context assembler so complete() / ChatBuilder / HCEL can assemble CAG + RAG + KAG + Memory before the model runs. Soft-fail matches Agent Runtime. Response includes contextMeta.

await ai.chat('Refund policy?').context(contextService, { tenantId: 'acme' }).send();

2. Eval-native goldens — runAiGolden / runAiGoldenCi wrap @hazeljs/​eval with a fresh FakeModel per case and optional metadata.expectedCalls matchers. Optional LLM judge blends into runGoldenDataset.

3. Durable Gatekeeper HITL on the tool loop — ApprovalDecision may be { pending: { approvalId } }. The loop suspends (finishReason: 'approval-required'), checkpoints, and resumes with resumeAfterApproval. Use GatekeeperApprovalPort + InMemoryCallCheckpointStore or a HumanTask-backed store.

Full Agent OS durability (DNA, run store, ledger) remains on createGovernedRuntime.


What’s new in Agent OS governance

Decision Plane (@hazeljs/​decision)

Opt-in defineDecision / createDecisionPlane — finite answers, discriminated PlaneResult union, rules + structured providers, Redis cache port. Does not replace DecisionRuntime.

Docs: Decision package — Decision Plane.

Governed runtime (@hazeljs/​agent-gatekeeper)

createGovernedRuntime / createGovernedToolExecutor: server-built TrustedCallerContext, optional argument digest on approvals, Redis lock + tool attempt ledger, reject hosted computer-use / shell without toolMediation.

Ships today: Redis lock/ledger; in-memory run store. OpenAI Agents adapter is opt-in (HAZEL_OPENAI_AGENTS_LIVE=1).

Docs: Agent Gatekeeper — governed runtime.

Governed memory (@hazeljs/​memory)

GovernedMemoryService lifecycle: capture → accept / quarantine / reject → retrieve → correct / forget / promote. Tenant filters before rank. Runtime store: InMemoryGovernedMemoryStore. SQL migration exists; no Prisma store adapter yet.

Docs: Memory — governed learning.

Shipped vs roadmap

See the governance slice table in the Agent OS guide.


What we are not claiming

  • Drop-in compatibility with third-party AI SDK call surfaces
  • Multi-instance Postgres for governed memory out of the box
  • Governed SQL run store (Agent createSqlDurableRunStore is a separate API)
  • HIPAA/GDPR certification or complete computer-use mediation

Upgrade path

  1. Register named models on AIModule and switch hot paths to modelName + budgets.
  2. Add @AgentTool for tool loops; keep InMemoryApprovalPort in tests.
  3. Wire contextService when you already use @hazeljs/​context.
  4. Add runAiGolden to CI for prompt/tool regressions.
  5. Adopt Decision Plane for routing labels, then GovernedRuntime for destructive tools.

Existing DecisionRuntime, AgentGatekeeper.evaluate / execute, and MemoryService paths stay unchanged if you never call the new entry points.


Links

Orchestration gets agents running. Agent OS — and a serious AI call contract — gets them shippable.