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.
Built for single-turn chatbots. They treat multi-step agent workflows as isolated, fragmented API calls.
Built for autonomous agents. StateLoom natively groups complex tool calls, sub-agents, and retries into stateful sessions.
Wrap any AI agent in a stateful session. Budget enforcement, caching, and crash recovery — all automatic.
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
Open source for individual developers. Enterprise features for teams at scale.
Session-scoped cost tracking with per-model breakdown. Hard USD budget limits per session stop runaway agents before they drain your wallet.
Crash on step 49? Restart and resume from cache — zero repeated API calls, zero wasted spend. Exact-match + semantic caching built in.
Detect emails, SSNs, credit cards, API keys. 32 injection patterns blocked. NLI classifier and Llama-Guard support.
Vote, debate, and self-consistency across multiple models. Shadow-test candidates against production.
Replay any session step-by-step. Inspect prompts, responses, costs, and timing at each checkpoint.
Route simple requests to local Ollama models, complex ones to the cloud. Automatic provider failover.
Point Claude Code or Gemini CLI at StateLoom. Full session tracking, guardrails, and budget enforcement with zero code changes.
Real-time PII redaction and injection blocking on every CLI agent call. Transparent proxy — the agent never knows.
One command shuts down all running agents. Granular rules let you target specific sessions, models, or teams.
Waterfall trace of every step your CLI agent takes. See models, costs, latency, and status in real time.
Hard budget caps for non-subscription CLI users. Set per-session or per-day limits. Auto-terminate on breach.
Programmable firewall rules for agent traffic. Block specific patterns, rate-limit calls, and enforce content policies.
Runs inside your VPC. Your data never passes through a third-party proxy. Isolated sandboxes per team.
Org → Team → Session hierarchy. Per-model breakdowns, automated chargebacks, and budget controls at every level.
Scoped virtual API keys with RBAC (5 roles). OAuth2/OIDC integration. Audit every key's usage.
Instantly halt all agents org-wide or force-reroute traffic to a different model/provider.
Shadow-test new models against production traffic. A/B experiments with built-in metrics. Distill knowledge across models.
Guardrails, PII vault, in-memory secret storage, CPython audit hooks, and HIPAA/GDPR/SOC 2 compliance profiles.
See how StateLoom can secure and optimize your AI infrastructure. We'll walk you through a live demo tailored to your use case.