DEVELOPER INFRASTRUCTURE

A circuit breaker
for your AI agents.

Halt stops agent execution the moment a budget threshold is exceeded. One install. One line of code. No runaway LLM spend.

$npm install halt
copy
agent.ts
import { halt } from "halt";

const agent = halt(myAgent, {
budget: { usd: 5.00 },
});

// runs fine until $5.00
await agent.run("Summarize all documents")
halt LLM call #47 · $4.89 spent
halt LLM call #48 · budget check...
⊘ BudgetExceededError$5.00 limit reached
at halt.enforce (halt/core.js:12)
execution stopped$5.00 enforced0 cents over
< 1ms
enforcement overhead
1 line
integration
0 config
required
TypeScript
native
HOW IT WORKS

Wrap once.
Protected forever.

Pass your agent into halt() with a budget constraint. Halt instruments every LLM call transparently and throws a BudgetExceededError before a single cent over limit is charged.

01
Install
npm install halt — no peer dependencies, no config files.
02
Wrap
halt(agent, { budget }) — one function call wraps any agent.
03
Ship
Halt intercepts every LLM call and stops execution at the limit.
agent.ts
import { halt } from "halt";
 
const agent = halt(myAgent, {
budget: { usd: 5.00 },
});
 
// Execution stops automatically if $5.00 is exceeded.
// No try/catch required.
await agent.run("Summarize all 10,000 documents");
FEATURES

Built for production.

Hard stop
Throws BudgetExceededError before the over-limit call is made. Not after. Zero overage.
Zero config
No dashboard, no API key, no webhook. npm install and one line of code.
Transparent
Wraps any OpenAI-compatible client. Your agent code doesn't change.
Framework-agnostic
Works with LangChain, AutoGen, custom agents, or raw SDK calls.
< 1ms overhead
Budget checks are in-process. No network round-trip, no latency cost.
Per-call tracking
Token counts, model prices, and cumulative spend logged on every call.
USE CASES

Built for production AI.

MULTI-AGENT PIPELINES
Stop one agent from burning the entire budget.
When a sub-agent enters a loop or hits an unexpected data volume, halt stops it before it drains resources allocated for the entire pipeline.
$halt(researchAgent, { budget: { usd: 0.50 } })
PER-USER BILLING
Enforce per-user spend in SaaS products.
Wrap each user's agent session with their plan limit. Halt ensures no user exceeds their tier without any billing logic in your agent code.
$halt(agent, { budget: { usd: user.planLimit } })
COST OBSERVABILITY
Know exactly what each run costs.
Every LLM call is tracked with token count, model price, and cumulative spend. onBudgetExceeded gives you the full breakdown.
$halt(agent, { onBudgetExceeded: (ctx) => log(ctx) })

Stop runaway agent spend.
Today.

One install. One line of code. Your agents ship with hard budget limits that can't be bypassed.

$npm install halt
copy