Skip to content
Tech News
← Back to articles

Show HN: Statewright – Visual state machines that make AI agents reliable

read original get Statewright Visual State Machine Kit → more articles
Why This Matters

Statewright introduces visual state machines to enhance the reliability of AI agents by constraining their tool usage and workflow phases. This approach reduces brittleness and improves performance across various models, including local and frontier models, by focusing the reasoning process and preventing errors before they occur. It signifies a shift from increasing model size to smarter workflow management, offering more efficient and dependable AI solutions for developers and users alike.

Key Takeaways

statewright

Agents are suggestions, states are laws.

State machine guardrails that control which tools your AI agent can use in each phase. Define a workflow once, enforce it across Claude Code, Codex, Cursor, opencode, and Pi. Full docs →

The problem

AI agents are powerful but brittle. Give a model 40+ tools and an open-ended problem and it barely gets out of the gate. The common fix is bigger models and longer prompts... it helps sometimes. Observability tells you what went wrong after the fact; it doesn't prevent it.

The approach

Instead of making the model bigger, make the problem smaller.

State machines constrain the tool and solution spaces so the model reasons in a focused context at each step. A planning state gets read-only tools. When the agent transitions to implementation, edit tools unlock with limited shell access (write-via-redirect and destructive ops are blocked even when Bash is allowed). Testing only permits designated test commands. If you call a tool that's not in the current phase, you get rejected with a message telling you what IS available and how to transition.

Works the same way on frontier models (fewer tokens to completion) and local models where 13B+ models start solving tasks they'd otherwise fail.

Research results

... continue reading