statewright  by statewright

State machine guardrails for AI agent workflows

Created 2 weeks ago

New!

321 stars

Top 84.4% on SourcePulse

GitHubView on GitHub
Project Summary

Statewright provides state machine guardrails for AI agents, addressing their brittleness when faced with numerous tools and complex tasks. It enables engineers and researchers to define structured workflows, controlling tool access per phase to make problems more manageable and enhance agent reasoning, particularly benefiting smaller models.

How It Works

The core of Statewright is a deterministic Rust engine that evaluates state machine definitions, including states, transitions, guards, and tool restrictions, operating independently of LLMs. A plugin layer integrates with coding agents via MCP or hooks, automatically enforcing tool restrictions relevant to the current state. This focused context and limited toolset guide the agent's reasoning, preventing inefficient exploration and improving task execution.

Quick Start & Requirements

To install in Claude Code, run /plugin marketplace add statewright/statewright, followed by /plugin install statewright and /reload-plugins. An API key from statewright.ai is required. Workflows are initiated using commands like /statewright start bugfix. Detailed documentation is available at docs.statewright.ai.

Highlighted Details

  • Demonstrated significant performance gains on a 5-task SWE-bench subset, improving task completion rates for 13.8GB and 19.9GB models from 2/10 to 10/10.
  • Features per-state tool enforcement, bash command discernment (blocking destructive operations), and edit guards (limiting lines/files modified per state).
  • Integrates with Claude Code (hard enforcement), Codex, opencode, Pi (alpha), and Cursor (advisory alpha).
  • The deterministic Rust engine ensures reliable state machine execution.

Maintenance & Community

Contributions are welcomed via "Discussions & feedback," with guides available for creating custom workflows. Specific community channels or contributor details are not detailed in the provided text.

Licensing & Compatibility

The core engine is licensed under Apache 2.0. Full stack self-hosting is permitted under an FSL license, which converts to Apache 2.0 on May 3, 2029. A patent pledge covers independent implementations. Solo developers, researchers, and open-source projects are covered.

Limitations & Caveats

Cursor integration is advisory and in alpha. Performance claims are based on a limited SWE-bench subset. Overly restrictive workflows can lead to agent deadlocks, necessitating the statewright_deactivate escape hatch. Some integrations may require repeated API key entry due to security caution.

Health Check
Last Commit

17 hours ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
324 stars in the last 15 days

Explore Similar Projects

Feedback? Help us improve.