Loop Engineering You Can Actually Run
Bounded Loops is a runnable harness for loop engineering. A runner proposes a change each lap; an independent gate such as pytest, JSON Schema, a command, or a security scanner verifies it; and a hexagonal engine repeats under nine enforced bounds plus an environment kill switch until the gate passes or a bound trips. The engine never trusts the agent's own claim of "done"—only the gate decides. Version 0.3.1 ships 68 loop folders across finance, legal, retail, operations, enterprise/ERP, security, testing, content, research, business, healthcare, and software. Of those, 64 run keyless out of the box; four framework examples use optional dependencies. The repository includes a deterministic three-lap convergence demo, a real Codex receipt, native plugins, clean-room release gates, and explicit credit to the prior work it builds on.
pip install bounded-loopsFeatures
Nine Bounds + Kill Switch
Iteration cap, stall detection, sandboxed workspace, input quarantine, schema validation, tracing, token budget, human-approval gating, wall-clock timeout — enforced across the engine's layers, plus an env-var kill switch polled before every lap.
The Gate Decides, Not the Agent
A frozen invariant: the engine never accepts the agent's own "done" claim. An independent gate (pytest / JSON-Schema / command / security scanner) is the only thing that can end a loop.
68 Loop Folders, 64 Keyless
Finance, legal, retail, operations, enterprise/ERP, security, testing, content, research, business, healthcare, and software — runnable folders with independent acceptance gates.
Keyless and Offline
The default demos run with no API key and no network via a deterministic stub runner and a real gate. Watch the ungated loop wreck, then the gated one stop clean.
Hexagonal + Framework-Neutral
Ports-and-adapters core; the same bounded loop runs across Claude Code, Codex, and framework examples (LangGraph, CrewAI, AutoGen, ADK).
L1/L2/L3 Rung Ladder + forbid Guards
Every loop declares an autonomy rung and forbid globs, so a cassette or agent can't rewrite the gate's own checker to fake a pass.