Introduction

Moven is an in-process circuit breaker for AI agents. It wraps your tools, detects runaway loops, runaway spend and hallucinations in under 0.8ms, and automatically rewinds execution to the last safe checkpoint — protecting your budget without a proxy in the hot path.

LAST VERIFIED // SDK v2.4.1 · JULY 2026APPLIES TO // moven-python · moven-tsRUNTIME // IN-PROCESS
DOC_01 // OVERVIEW

What is Moven?

AI agents fail expensively: a single recursive tool loop can burn hundreds of dollars overnight. Moven evaluates every tool call deterministically in-memory, before execution — no network hop, no proxy, no added latency. When a heuristic trips, Moven throws a typed MovenKillError, persists a full trace to your dashboard, and can time-travel rewind the agent to the last clean checkpoint.

<0.8ms overhead
Sub-millisecond in-process evaluation. Zero proxy in the hot path.
Cost circuit breaker
Hard dollar ceilings per run with per-token pricing for 20+ models.
Loop & hallucination kill
Repeat-call, depth, no-progress and semantic fingerprint detection.
Time-travel rewind
Roll back to the last checkpoint, prune the loop, replay safely.
DOC_02 // QUICK PREVIEW

Quick preview

Wrap any tool function with the breaker. That is the entire integration.

agent.ts
typescript
import { createMovenCircuitBreaker } from 'moven-sdk'; const moven = createMovenCircuitBreaker({  agentName: 'support-agent',  maxRepeatCalls: 3,  maxCostDollar: 2.0,  provider: 'openrouter',  currentModel: 'openai/gpt-4o-mini',}); // Any runaway call now trips in-process before it executesexport const runTool = moven.wrap(async (query: string) => {  return db.execute(query);});
agent.py
python
from moven_sdk import MovenCircuitBreaker, BreakerConfig breaker = MovenCircuitBreaker(BreakerConfig(    project_id="your-project-id",    max_repeats=3,    spend_ceiling_usd=2.00,    model_name="openai/gpt-4o",)) breaker.protectdef execute_sql_query(query: str):    return db.execute(query)
DOC_03 // PIPELINE

How it works

Every tool call passes through a four-stage in-memory pipeline before your tool code ever runs:

  1. 1
    Intercept
    The wrapTools() trap captures tool name, payload, timestamp and stack context.
  2. 2
    Hash
    Arguments are canonicalized (sorted keys) and SHA-256 hashed for exact repeat detection.
  3. 3
    Evaluate
    Heuristic layers run against sliding windows: repeats, cost, depth, no-progress, semantic fingerprints.
  4. 4
    Recover or kill
    Healthy calls pass through. Loops trip the breaker, dispatch alerts and route to checkpoint rewind.

Telemetry (traces, spans, checkpoints, kill alerts) is dispatched asynchronously to api.moven.dev/events with retry and backoff — so a cloud outage never blocks your agent.

DOC_04 // CORE CONCEPTS

Core concepts

DOC_05 // WEBHOOKS

Webhooks & alerts

When a breaker trips, Moven instantly POSTs the offending tool parameters, trip reason and money-saved estimate to your configured Slack channels and custom HTTP webhooks. Alerts are also recorded per-trace in the dashboard under Kill Alerts, with optional email escalation for critical heuristics such as prompt injection.

DOC_06 // TROUBLESHOOTING

Troubleshooting

What if the Moven cloud is unreachable?

Moven runs standalone. All circuit breaker rules keep evaluating in-memory and throw MovenKillError locally — the agent is protected even with zero connectivity.

Are false-positive repeat kills possible?

No. Result-Delta Hashing distinguishes legitimate progress (a poll whose status changes) from stagnant loops, and safe-to-retry polling tools get their own TTL window.

My trace shows 0 tokens / $0 cost

Upgrade to the latest moven-sdk — recent versions report prompt/completion tokens and per-step cost with every completed (200 OK) run, and the backend falls back to model-pricing estimates when usage is missing.