import Note from '../../components/Note.astro';
import Quote from '../../components/Quote.astro';
# Discussion
## When Does It Work?
The four tasks in this article, workflow memory, next-step prediction, failure detection, and runtime monitoring, look different, yet one object served all of them. When a system's action vocabulary is bounded, its behavioral topology is bounded too, and a compact, stable automaton is the natural summary. Beating four bespoke pipelines with it is a consequence, not a design goal.
The topology is also model-invariant: a single FSM achieves perfect fitness across four large language models on the same task, so it is shaped by the **system**, the tools and prompts and task distribution, more than by the model driving it. It stays stable across extraction granularities too, shifting failure-prediction AUROC by less than 0.03 over four levels of $\phi$.
A 25-state machine can be read and checked by a person; the 59,510-state prefix tree it came from cannot. That auditability is a direct dividend of minimality.
## Limitations
The FSM accepts the observed prefix language, not the agent's true generating language: like any trace-replay method, it cannot tell a trace that stays within the observed transition patterns from a legitimate one. The extraction function $\phi$ needs a small amount of per-domain knowledge, and fully automatic discovery of it is future work. Failure prediction degrades on simpler machines: AUROC falls to 0.799 on SWE-agent and 0.70 on the 10-state SWE-smith, smaller task spaces with less structure to exploit. Extending the workflow-memory comparison beyond AWM to other memory-injection methods is future work.
For agents with much larger action spaces or weaker sequential structure, the construction stays minimal but stops being compact, and the per-state observation density that drives every result above would degrade with it.
## Broader Impact
Compact FSM representations make agent behavioral structure inspectable, which supports safety auditing. The same analysis could be misused to find exploitable behavioral patterns, so deployment should restrict FSM analysis to authorized auditing.
## Conclusion
A finite-state machine, built in milliseconds from positive examples with one classical merge, does the work of four bespoke learned pipelines. The same 7-to-43-state object remembers workflows (beating AWM on all eight datasets), predicts the next action (62% lower cross-entropy than a unigram), predicts failure (held-out AUROC up to 0.94), and stops bad runs early at 32% of trace completion. It uses 15 to 3,036$\times$ fewer states than RPNI, and its state count is identical across every random split.