Skip to main content

🧵 Loom

PyPI CI Python License: MIT

English · 中文

The black box, firewall & debugger for AI agents.

Your agent ran — touched files, called tools, spent tokens — and you have no idea what it did or why. Loom records every action, replays it byte-for-byte for $0, firewalls dangerous calls before they run, and lets you step through the whole run like a debugger. Works with any Claude/OpenAI-API agent — Claude Code, LangGraph, CrewAI, your own.

pip install loom-harness          # zero dependencies
loom record claude "fix the failing test" --safe
recorded 17 steps · 42k tokens → session.loom.json
🛡  firewall blocked 1 risky call:  Read(".env")
🔬 loom debug session.loom.json   # step through it, fork any turn live

Loom's step-debugger: walk a multi-agent run — reasoning, tools, the exact context the model saw, and fork any turn live

Step through any agent run — the reasoning, the tools, the exact context the model saw, and fork any turn live.


Why Loom

  • 🎥 Record any agent — proxy Claude Code / Codex / Cursor / your own, one command, zero code changes.
  • Replay for $0 — every call recorded at one boundary → byte-identical, offline. Deterministic CI for a stochastic agent.
  • 🔬 Step-debug it — walk each step, see the exact context the model saw, then edit a turn and re-run it live.
  • 🕸 Any multi-agent framework — LangGraph · CrewAI · AutoGen · OpenAI-Agents · Claude-SDK, recovered into one agent tree from the wire, zero code changes.
  • 🛡 Firewall it — deny / confirm dangerous calls before they run, by capability (cap:money_movement) or sequence (after Read(.env): deny network).
  • 🕵 Catch exfiltration — a secret flowing to an egress, even base64-encoded or paraphrased, confirmed by an LLM judge.
  • Undo the world — revert the files an agent changed, or snapshot & restore a whole workspace + database.

The debugger

loom debug run.loom.json (or loom live to watch it run) opens a step-debugger in your browser:

  • Step through every action — the model's reasoning, the tool call + args, the world-diff (file / SQL row / DOM), risk, tokens.
  • Context frame — the exact conversation the model saw at each step: the debugger's stack & variables.
  • Fork & re-run live — inject a message or switch the model at any turn; only the divergent tail costs a call, and the branch appears beside the original.
  • Multi-agent tree — a supervisor/sub-agent system (yours or a third-party framework) recovered from the wire and shown as a collapsible tree, laned by agent.
  • Ask & assert — send the live agent a new message, or check plain-English expectations (never issue_refund, output contains …) as a CI gate.

loom studio <trace> freezes the whole UI into one shareable HTML file (no server, no agent).


Debug a live agent

loom live --agent app:agent        # watch it run, send follow-ups, fork any turn

Behind a gRPC / HTTP endpoint? Point your server at the recording proxy and drive it from the same debugger — no code, just your grpcurl:

loom live --proxy-port 9000 \
  --trigger 'grpcurl -d "{\"prompt\": $LOOM_PROMPT_JSON}" -plaintext :50051 agent.Agent/Run'
# then start your server with ANTHROPIC_BASE_URL=http://127.0.0.1:9000

Loom reconstructs the agent's full internal hierarchy even though it's behind an endpoint.


Use it as a Python harness

from loom import Agent, tool, Policy

@tool
def search(q: str) -> str:
    "Search the docs."
    return db.search(q)

agent = Agent(model="claude-opus-4-8", tools=[search],
              policy=Policy(deny=["issue_refund*"], budget_tokens=50_000))  # in-loop firewall
run = agent.run("What changed in the API last week?")

run.replay()        # byte-identical, no API calls
run.fork(at=3)      # rewind to turn 3, continue live on a new branch

One effect boundary records every model + tool call — so replay, fork, free CI, human-in-the-loop, the firewall, and every analyzer fall out of the same primitive. The kernel is zero-dependency.


A few more commands

loom replay <trace> re-run byte-identical, $0, offline
loom taint · loom dlp --judge exfiltration lineage · semantic DLP
loom redteam run --generate <m> AI red-teamer — invents attacks for your tool surface
loom mcp gateway -- <server> firewall + record any MCP server
loom undo <trace> revert the files the agent changed

Run loom --help for the full set — record, replay, debug, live, studio, firewall, taint, dlp, redteam, mcp, undo, cost, rootcause, experiment, and more.


Install

pip install loom-harness                # kernel + CLI, zero deps
pip install "loom-harness[anthropic]"   # + live Claude
pip install "loom-harness[mcp]"         # + MCP gateway

Python 3.10–3.13 · MIT · import loom

Loom shrinks an agent's blast radius and makes its behavior inspectable — it is not a guarantee a model can't misbehave. See the threat model.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loom_harness-0.33.12.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loom_harness-0.33.12-py3-none-any.whl (396.4 kB view details)

Uploaded Python 3

File details

Details for the file loom_harness-0.33.12.tar.gz.

File metadata

  • Download URL: loom_harness-0.33.12.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for loom_harness-0.33.12.tar.gz
Algorithm Hash digest
SHA256 780dff81c313fdacf96ce2c713d11eb218312508928d09eef6c3cd9dfc8fc472
MD5 8d89a9efbbb707453e943dba2f0cf9e4
BLAKE2b-256 1d08886f87082f300ba2e96536b85f2a8ca70a92d817fd60e2a88fabd66821f2

See more details on using hashes here.

File details

Details for the file loom_harness-0.33.12-py3-none-any.whl.

File metadata

  • Download URL: loom_harness-0.33.12-py3-none-any.whl
  • Upload date:
  • Size: 396.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for loom_harness-0.33.12-py3-none-any.whl
Algorithm Hash digest
SHA256 c043004ee0ea06ee1cef05c738809e9bb149c6c9f9eb6c4d00a3b7b5c5e77c95
MD5 723eaf2547f7d83ab09f75108f6a3f6c
BLAKE2b-256 ec2f3b52984adb9b7ae34c8f38f41dab303d7e792d9bcfad10192823091ad4cd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.33.12 This release

2 files

0.33.11

2 files

0.33.10

2 files

0.33.9

2 files

0.33.8

2 files

0.33.7

2 files

0.33.6

2 files

0.33.5

2 files

0.33.4

2 files

0.33.3

2 files

0.33.2

2 files

0.33.1

2 files

0.33.0

2 files

0.32.4

2 files

0.32.3

2 files

0.32.2

2 files

0.32.1

2 files

0.32.0

2 files

0.31.4

2 files

0.31.3

2 files

0.31.2

2 files

0.31.1

2 files

0.31.0

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page