🚀 StateLoom is live on GitHub

The Stateful Control Plane
for AI Agents.

Standard API gateways route single LLM calls. StateLoom tracks, secures, and optimizes complex, multi-step agent workflows. Resume crashed agents for free, enforce budgets, and deploy zero-trust guardrails in two lines of code.

Legacy API Gateways

Built for single-turn chatbots. They treat multi-step agent workflows as isolated, fragmented API calls.

  • ×
    Wasted Compute
    A crash on step 49 means starting over and paying for steps 1–48 all over again.
  • ×
    Runaway Loop Risk
    Blind to recursive tool-calling loops. One rogue agent can drain your entire API key balance.
  • ×
    Black-Box Debugging
    Flat, disjointed server logs make tracking an agent's chain of thought impossible.
  • ×
    SaaS Data Leaks
    Forces you to pipe sensitive, proprietary prompts through a 3rd-party cloud proxy.
  • ×
    Passive Routing
    Simply forwards requests. Cannot orchestrate multi-model consensus or semantic retries.

StateLoom Control Plane

Built for autonomous agents. StateLoom natively groups complex tool calls, sub-agents, and retries into stateful sessions.

  • Durable Resumption
    Checkpoints every step natively. Resume crashed agents instantly for $0.
  • Blast Radius Containment
    Enforce strict USD budgets per task and automatically sever looping agents.
  • Absolute Observability
    Visualize the entire thought process and cost in hierarchical waterfall traces.
  • Data Sovereignty
    100% self-hosted zero-trust architecture. Your data never leaves your VPC.
  • Active Orchestration
    Force models to debate and reach mathematical consensus before returning an answer.

Get started in seconds.

Wrap any AI agent in a stateful session. Budget enforcement, caching, and crash recovery — all automatic.

agent.py
pip install stateloom
import stateloom

# The Magic: If this script crashes on Step 3, restarting it skips
# Steps 1 & 2 instantly from cache. $0 API cost, 0ms latency.
with stateloom.session("research-agent", budget=2.00, durable=True):
    res1 = claude.messages.create(..., content="Search")   # [Cache Hit]
    res2 = claude.messages.create(..., content="Analyze")  # [Cache Hit]
    res3 = claude.messages.create(..., content="Format")   # Crashes!

Works with every major provider

OpenAI Anthropic Gemini LangChain Ollama Mistral LiteLLM

Everything you need to govern AI agents

Open source for individual developers. Enterprise features for teams at scale.

Cost Tracking & Budget Enforcement

Session-scoped cost tracking with per-model breakdown. Hard USD budget limits per session stop runaway agents before they drain your wallet.

Durable Resumption & Caching

Crash on step 49? Restart and resume from cache — zero repeated API calls, zero wasted spend. Exact-match + semantic caching built in.

PII Detection & Guardrails

Detect emails, SSNs, credit cards, API keys. 32 injection patterns blocked. NLI classifier and Llama-Guard support.

Multi-Agent Consensus

Vote, debate, and self-consistency across multiple models. Shadow-test candidates against production.

Time-Travel Debugging

Replay any session step-by-step. Inspect prompts, responses, costs, and timing at each checkpoint.

Auto-Routing & Local Models

Route simple requests to local Ollama models, complex ones to the cloud. Automatic provider failover.

Zero-Code Proxy

Point Claude Code or Gemini CLI at StateLoom. Full session tracking, guardrails, and budget enforcement with zero code changes.

PII Detection & Guardrails

Real-time PII redaction and injection blocking on every CLI agent call. Transparent proxy — the agent never knows.

Kill Switch

One command shuts down all running agents. Granular rules let you target specific sessions, models, or teams.

Session Timeline

Waterfall trace of every step your CLI agent takes. See models, costs, latency, and status in real time.

Budget Enforcement

Hard budget caps for non-subscription CLI users. Set per-session or per-day limits. Auto-terminate on breach.

OpenClaw Firewall

Programmable firewall rules for agent traffic. Block specific patterns, rate-limit calls, and enforce content policies.

Watch StateLoom wrap Claude Code CLI

Data Sovereignty & Sandboxes

Runs inside your VPC. Your data never passes through a third-party proxy. Isolated sandboxes per team.

Full Cost Visibility

Org → Team → Session hierarchy. Per-model breakdowns, automated chargebacks, and budget controls at every level.

Virtual Keys & IAM

Scoped virtual API keys with RBAC (5 roles). OAuth2/OIDC integration. Audit every key's usage.

Global Kill Switch & Force Reroute

Instantly halt all agents org-wide or force-reroute traffic to a different model/provider.

Dark Launching & Distillation

Shadow-test new models against production traffic. A/B experiments with built-in metrics. Distill knowledge across models.

Zero-Trust Security Perimeter

Guardrails, PII vault, in-memory secret storage, CPython audit hooks, and HIPAA/GDPR/SOC 2 compliance profiles.

Book an Enterprise Demo

See how StateLoom can secure and optimize your AI infrastructure. We'll walk you through a live demo tailored to your use case.