Skip to main content

Microloop Python SDK

Python bindings for the Microloop local reliability runtime.

from microloop import InterventionAction, Monitor, Policy

policy = Policy(
    stalled=InterventionAction.Replan,
    regressing=InterventionAction.Stop,
    cooldown_steps=5,
)
monitor = Monitor(policy=policy)

for step in agent.steps():
    decision = monitor.observe(
        action=step.action,
        observation=step.result,
        state=step.state,
        metrics={"exit_code": step.exit_code},
    )
    if decision.should_intervene:
        agent.inject(decision.recovery_context)

Monitor.observe(...) returns a Decision with status, reasons, intervention, severity, verified_progress and feedback. The default policy only observes; automatic recovery requires explicit opt-in.

You own the agent loop. Monitor classifies and advises; it never runs tools, calls a model, or stops a process.

CLI

microloop inspect trajectory.jsonl   # detection only, default observe-only policy
microloop replay trajectory.jsonl --json  # re-run recorded events through the engine
microloop monitor trajectory.jsonl --follow
microloop doctor

replay re-runs recorded events through the current engine. It does not reproduce the original agent execution. A trajectory with an incompatible schema_version major version is rejected rather than analyzed.

Building

pip install maturin
maturin develop --manifest-path python/microloop/Cargo.toml

No external credentials or network connections are required. All trajectory evaluation runs locally in Rust via PyO3.

Release files for microloop 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for microloop 0.3.0
File Interpreter ABI Platform
microloop-0.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
microloop-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details
microloop-0.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 1.8 MB

Release files / microloop-0.3.0-cp310-abi3-win_amd64.whl

Download URL microloop-0.3.0-cp310-abi3-win_amd64.whl
Size 528.5 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0a6500034710c0c02f31317c83d62c5f84d550a739ec717b44367db694cd34af
BLAKE2b-256 checksum
How to use checksums
78c080c8407d0c8b4a82db66c3df6d05bf812b375748b159fdc9f890dc322423
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / microloop-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL microloop-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl
Size 676.2 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
30d2a09c8dade7c25e10ba87e30806d861c19b95493b11c27defa5c4871ce77e
BLAKE2b-256 checksum
How to use checksums
ee7962366656ef8bd3023af0cfd1c76d1998db5286ced1a2a36ce86deb477601
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / microloop-0.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL microloop-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 570.7 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9ee1140d3e3868ea8a97328583c4b3c5a9c2a83ade95877dcc3fda808f2503fe
BLAKE2b-256 checksum
How to use checksums
54cfbf55eb1a2f5a5609b392edc7fabe0427fe08af1d60a212e6b6627c7b5aea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.3.0 This release

3 release files

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

2 release files

0.1.2

1 release file

0.1.1

1 release file

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