Skip to main content
ROI Scale AI logoROI Scale AI
Themes
Free Tools
Blueprints
arrow_forward
Toolkits
arrow_forward
Proof Packs
arrow_forward
View all in Free Tools arrow_forward
Business
AI Economics & ROI
arrow_forward
Work & Workforce
arrow_forward
AI Security & Governance
arrow_forward
Research & Trends
arrow_forward
View all in Business arrow_forward
Technology
AI Tools & Agents
arrow_forward
Models & Benchmarks
arrow_forward
Evals & Observability
arrow_forward
Data & Document Processing
arrow_forward
AI for Developers
arrow_forward
View all in Technology arrow_forward
For AI Agents
search
person_outlineSign In
Categories
Themes
Free ToolsBlueprintsToolkitsProof Packs
BusinessAI Economics & ROIWork & WorkforceAI Security & GovernanceResearch & Trends
TechnologyAI Tools & AgentsModels & BenchmarksEvals & ObservabilityData & Document ProcessingAI for Developers
For AI AgentssearchSearchhomeHome
Community
person_outlineSign In / Join
Home/Free Tools/Proof Packs

Explicit Agent State Machines (No Framework Required)

Mikhail Skradol
Mikhail SkradolPublished Aug 19, 2026
Free

Make your agent's next move predictable. Under the hood, a "reasoning" agent is a state machine: INIT, planning, tool call, waiting, responding, done. This pack is a framework-free reference — an explicit transition graph, a turn ceiling, state-scoped tools and an audit log — compared with a naive loop, so you can see both failure modes side by side.

What's inside

  • A transition whitelist: invalid moves raise an error instead of drifting into an undefined state.
  • A hard turn ceiling that forces escalation instead of unbounded inference spend, plus tools injected only in the states that need them.
  • A human-readable transition audit log for escalation review.
  • A side-by-side naive agent, so you can watch it burn tokens and fail to finish the same task.

For developers who want a debuggable, cost-bounded agent they can step through, not a black box. Free. The full reference is on this page.

Stop guessing what your agent will do next. Build an explicit transition graph with a turn ceiling, state-scoped tools and an audit log. Compare it with a naive loop in a runnable, framework-free reference implementation. Invalid transitions flag errors.

A free reference implementation that proves the article's claim: your "reasoning agent" is a finite state machine with a token-prediction transition function — and designing it explicitly gets you a debuggable, cost-bounded agent instead of a black box that hallucinates in silence.


Get the code: github.com/mskrado/poc/agent-fsm — MIT licensed


pip install -e ".[dev]", python demo.py --scenario all.


Every agent framework sells "autonomous reasoning." Under the hood it's INIT → PLANNING → TOOL_CALL → AWAITING_TOOL → RESPONDING → DONE — a finite state machine, not a mind. This blueprint is the companion code to Agents Are State Machines. Your Framework Is Lying to You. — a working, framework-free FSM orchestrator (~200 lines) plus a naive framework-style loop, so you can see both failure modes side by side.

What's inside:

·        An explicit TRANSITIONS whitelist — invalid moves raise an exception instead of silently drifting into an undefined state

·        A hard max_turns ceiling that forces escalation instead of runaway inference spend

·        State-scoped tool injection (each state sees only the tools it needs)

·        A human-readable transition audit log for escalation review

·        A side-by-side naive agent that burns ~22k tokens and never finishes the same task

Why it's worth 10 minutes: the Berkeley Function-Calling Leaderboard puts single-tool-call accuracy at 90–95% for top models — but a 4-step task at 85% per-step accuracy only succeeds ~52% of the time. That's the math this blueprint is built to survive. One team that adopted this pattern cut time-to-ship a new agent from 9 days to 2.

Loading ratings...

Comments (0)

Join the conversation!

Loading comments...

Themes

  • View all

Contribute

  • How-Tos
  • Business RoadMap
  • Tech RoadMap

Support

  • Contact Us
  • FAQ
  • Privacy
  • Terms

About

  • Mission
  • Editorial

© 2026 ROI Scale AI. All rights reserved.

Powered by Publishi.ai