Language-model agents often run for hours on tasks that follow a set procedure, like processing accounts or debugging code. Over time, they drift away from the instructions, taking shortcuts or stopping early, even when reminded. Restating the rules does not fix the problem.
The researchers built an executable finite-state machine (FSM), which is a structured workflow that stores the current step outside the model's memory. The runtime enforces what tools the agent can use, when it can move to the next step, and when it can stop, so the agent cannot skip or stray from the procedure.
In a test with 200 accounts, the agent with the FSM correctly followed the procedure on 139 accounts, versus 48 for the best alternative. This method works with smaller models too, offering long, reliable automation at lower cost.
