DEFINITION
Formal State Machine
Formal State Machine (for agent workflows)
Definition
A deterministic computational model consisting of states, transitions, guards, and tool restrictions that enforces valid sequences of agent actions. Unlike DAGs, state machines support loops and retries, making them suitable for agentic workflows where agents may need to retry failed steps or iterate through multiple attempts.
Examples in the Wild
- Example 1:Planning state with read-only tools
- Example 2:Implementation state with scoped edit tools
- Example 3:Testing state with bash-only access
- Example 4:Failure paths with retry loops