An Agentic Flow for Finite State Machine Extraction using Prompt Chaining

📅 2025-07-15
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Existing FSM extraction methods suffer from limited scalability, incomplete coverage of protocol specifications, and inadequate handling of natural language ambiguity in RFC documents. To address these challenges, we propose FlowFSM—a novel framework that integrates large language model (LLM) agents, prompt chaining, and stepwise chain-of-thought reasoning to enable high-accuracy, fully automated extraction of protocol state machines from RFCs. FlowFSM decomposes the extraction task into modular subtasks, employs multi-stage rule generation, and incorporates hallucination suppression mechanisms to enhance reliability in state identification and transition inference. Experimental evaluation on FTP and RTSP protocols demonstrates a 42.7% reduction in erroneous transitions and achieves 98.3% state coverage. This work establishes a scalable, robust paradigm for protocol modeling, formal verification, and vulnerability discovery—bridging the gap between natural-language protocol specifications and precise, executable state-machine representations.

Technology Category

Multiagent Systems: Agent CommunicationIntelligent Robots: State EstimationMachine Learning: Large Multimodal Models (LMMs)

Application Category

Semantics and Knowledge: Data modeling to support human-machine intelligence, including LLMs agents, intelligent system behavior, explanations, and user-friendly interactionsGraph Algorithms and Modeling for the Web: Foundation models and LLMs for Web-related graphsSecurity and Privacy: Large-scale security measurements
📝 Abstract
Finite-State Machines (FSMs) are critical for modeling the operational logic of network protocols, enabling verification, analysis, and vulnerability discovery. However, existing FSM extraction techniques face limitations such as scalability, incomplete coverage, and ambiguity in natural language specifications. In this paper, we propose FlowFSM, a novel agentic framework that leverages Large Language Models (LLMs) combined with prompt chaining and chain-of-thought reasoning to extract accurate FSMs from raw RFC documents. FlowFSM systematically processes protocol specifications, identifies state transitions, and constructs structured rule-books by chaining agent outputs. Experimental evaluation across FTP and RTSP protocols demonstrates that FlowFSM achieves high extraction precision while minimizing hallucinated transitions, showing promising results. Our findings highlight the potential of agent-based LLM systems in the advancement of protocol analysis and FSM inference for cybersecurity and reverse engineering applications.
Problem

Research questions and friction points this paper is trying to address.

Extract accurate FSMs from raw RFC documents
Overcome scalability and coverage limitations in FSM extraction
Minimize hallucinated transitions in protocol state modeling
Innovation

Methods, ideas, or system contributions that make the work stand out.

Uses LLMs with prompt chaining
Extracts FSMs from RFC documents
Constructs structured rule-books systematically
🔎 Similar Papers
F
Fares Wael
Dept. of Computer Science, MSA University, Giza, Egypt
Y
Youssef Maklad
Dept. of Computer Science, MSA University, Giza, Egypt
Ali Hamdi
Ali Hamdi
Computer Science, MSA University
Computer VisionDeep LearningText Mining
W
Wael Elsersy
Dept. of Computer Science, MSA University, Giza, Egypt