← All papers
First page of Provable Coordination for LLM Agents via Message Sequence Charts

Provable Coordination for LLM Agents via Message Sequence Charts

Benedikt Bollig, Matthias Függer, Thomas Nowak

cs.PL Apr 19, 2026 · v3 cs.AI
All definitions of the MSC-based coordination DSL and the projection's correctness and deadlock-freedom results are formalized and machine-checked in Lean 4.
Multi-agent systems built on large language models (LLMs) are difficult to reason about. Coordination errors such as deadlocks or type-mismatched messages are often hard to detect through testing. We introduce a domain-specific language for specifying agent coordination based on message sequence charts (MSCs). The language separates message-passing structure from LLM calls, tool calls, and human control points, whose outcomes remain unpredictable. We define the syntax and semantics of the language and present a syntax-directed projection that generates deadlock-free local agent programs from global coordination specifications. We illustrate the approach with a diagnosis consensus protocol and show how coordination properties can be established independently of LLM nondeterminism. We also describe a runtime planning extension in which an LLM dynamically generates a coordination workflow for which the same structural guarantees apply. An open-source Python implementation of our framework is available as ZipperGen.

LLM-based multi-agent systems are prone to coordination errors such as deadlocks and type-mismatched messages, which testing rarely uncovers. Existing agent frameworks provide no formal coordination guarantees.

The authors define a domain-specific language based on message sequence charts. It separates message-passing structure from opaque LLM, tool, and human actions, and gives the language a formal syntax and MSC semantics. A syntax-directed projection turns global workflows into local agent programs, using explicit control broadcasts from the owner of each decision. All definitions and correctness results are machine-checked in Lean 4, and the framework is implemented in Python as ZipperGen, including a runtime planning extension where an LLM generates the workflows.

The projection is always defined, needs no realizability check, and is deadlock-free by construction. This is illustrated on a medical diagnosis consensus protocol. In the runtime-planning experiment, GPT-4.1 and GPT-4.1 mini had all 10 generated workflows accepted and executed, while small local models and GPT-4o mini produced none that were accepted.

ModelAccepted firstAccepted within 8ExecutedCorrect
qwen2.5:14b (local)0000
GPT-4o mini0000
GPT-4.1 mini010109
GPT-4o7887
GPT-4.11010106
Runtime planning: LLM-generated workflows (10 cases each)