Open source · MIT runtime · CC0 spec

The runtime that makes AI agents safe to ship.

Nexus is a durable runtime that turns every agent run into a persistent, auditable, replayable record, with human approval gates, hard budget caps, and OpenTelemetry traces of every step. Zero dependencies. No cluster, no cloud, no vendor.

Try the interactive demo How it works
run journal · liverunning
task
llm
tool
approval
gated tool
done
0 RUNTIME DEPENDENCIES· ~1 MB INSTALLED· 74 MS COLD START· 171 TESTS / CI· OPENTELEMETRY EXPORT· SELF-HOSTED· ANTHROPIC / OPENAI / OLLAMA
The problem

Everyone's agent demo works.
Almost nobody's agent production does.

Agents in the wild crash mid-task, take irreversible actions no one approved, burn five-figure API bills overnight, and leave no defensible record. The model isn't the problem, the runtime is.

Kill it. It doesn't care.

Every state change is persisted before execution continues. A crashed run is just a run you haven't resumed yet, from any process, hours or days later, exactly where it stopped.

$ kill -9 <agent>   # mid-run
$ nexus resume run_8a4f21
  ← tool issue_refund ok
✔ run_8a4f21  support  completed

Dangerous tools wait for a human.

Mark a tool requiresApproval and the run pauses durably before it executes. Policy rules auto-decide the routine cases; every decision is journaled with who made it.

approvalPolicy: ({ arguments: a }) =>
  a.amountUsd < 50 ? 'approve' : 'ask'
// journaled: decidedBy 'policy' | 'human'

Hard budgets, enforced pre-flight.

Token and USD caps are checked before every model call, not reported after the invoice. Runs halt at the cap and resume when you raise it. Of every open runtime we tested (July 2026), none ships this natively.

budget: { maxUsd: 0.50,
          maxTotalTokens: 100_000 }
// status: 'halted_budget', resumable

And you can see all of it

Durable, governable, and observable.

The record that makes a run resumable also makes it traceable. One call ships OpenTelemetry spans for every step, and one tag turns "which customer moved the bill" into a filter. Both zero dependencies, both landing in the tools you already run.

Traces to the stack you already have.

attachOtel emits GenAI-convention spans, invoke_agent, chat, execute_tool, with token usage, over OTLP/HTTP. They land in Datadog, Grafana, Langfuse, any OTLP backend. No vendor SDK; prompt content stays off by default.

attachOtel(runtime, {
  endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT });
// invoke_agent → chat → execute_tool, with tokens

Every dollar, attributed to a customer.

Tag a run with a customerId and it flows through the record, the journal, your webhooks, and every OTel span. When the LLM bill doubles, listRuns({ tags }) tells you who caused it, no forensics.

await runtime.run('support', ticket, {
  tags: { customerId: 'acme-42' } });
// tags ride the record, journal, webhooks & spans

The idea underneath

A run is a record, not a prayer.

Nexus defines the Open Agent Run format, a small, public-domain specification for durable agent runs. Because the record is complete and open, three things fall out for free:

Audit

Every LLM call, tool execution, approval, and cost, in a journal any tool can read. Auditable, vendor-independent, outlives the framework.

Resume

Any conforming runtime can continue a run another process started. Deploys and crashes stop being existential events.

Replay

Re-execute any production run offline for $0.00, or diff it against a new model or prompt. Incidents become regression tests.

Read the format and the state machine →


Durable MCP

Your MCP servers, made safe to run unattended.

MCP standardized how agents reach tools. Nexus wraps any unmodified MCP server, stdio or HTTP, so every tool call is journaled, budget-metered, resumable, replayable, and approval-gated. One line of policy.

durable-mcp.ts
import { McpClient, mcpTools } from '@nexusaiframework/runtime';

const client = await McpClient.connect({
  command: 'npx', args: ['-y', '@your/mcp-server'],
});

const tools = await mcpTools(client, {
  requiresApproval: ['issue_refund', 'delete_record'],
});
DurabilityApprovalsPer-run budgets
Workflow engines¹
Agent frameworks¹checkpoints
MCP approval proxies¹per-key
Nexus✓ journal + resume✓ human + policy✓ tokens & USD

¹ Temporal/Restate/Inngest · LangGraph/CrewAI/Mastra · Helio/Preloop/LiteLLM, detail and citations on the benchmarks page. Assessed mid-2026.


Getting started

Sixty seconds. Versus an afternoon of infrastructure.

Same goal in every stack: one durable agent with human approval and cost control. Here is what that actually takes, sourced from each project's own docs on our benchmarks page.

with nexus
npm install @nexusaiframework/runtime
# zero deps. works offline, right now.

# then ~25 lines: agent + tools + budget + policy.
# durability, approvals, audit, replay: included.

The standard stack

1. Pick a framework and install 63 to 314 packages.
2. Provision Postgres for checkpoints, or stand up a workflow server.
3. Build the approval transport yourself: endpoint, UI, resume plumbing.
4. Budgets: not available, write your own middleware.
5. Audit trail and replay: build them, or go without.

That is the gap. Not a benchmark trick, an architecture decision.


Why this exists

Agents will run entire operations.
Humans should keep the final word.

Nexus was started on a conviction: the next decade of software is not people clicking buttons with AI assistance. It is agents running whole operational businesses end to end, procurement to support to payroll, while humans hold the one role that must never be delegated: final judgment on the things that matter. Safety. Health. Money. People.

That world only works if we build for it now. Not just smarter models: trustworthy runtimes. Every action recorded. Every consequential step waiting for a human signature. Every cost bounded before it is spent. Built in the open, where anyone can inspect exactly how it works.

And the point is not efficiency. When systems carry the routine, people get their time back: for each other, for craft, for the purposes a job title never captured. Humans were never meant to be defined by their work. We are building the guardrails so that future arrives safely, with people still holding the pen.

If you believe that too, write to us or bring us one workflow.


See it run. Kill it. Resume it.

Type a task, approve or deny the dangerous step yourself, kill the process mid-flight, resume it, and replay the whole thing, in your browser.

Open the interactive demo