A communication protocol for self-programmed agents
Abstract
Multi-agent systems require language model agents to communicate with each other. A recently developed programming language, called Spell, supports self-programmed agents: the entire model completion is a Spell program, and this program is fully responsible for turn-to-turn orchestration, including the logic which gives the agent its own next turn, spawns other agents, and handles communication. This paper proposes a communication protocol for Spell which allows agents to communicate and delegate tasks programmatically. Communication is ordinary program logic, fully composable with tool calls and control flow; for example, an agent could send multiple versions of the same message to different recipients, forward a message without regurgitating its content, or install an event listener which triggers a message. It supports asynchronous and synchronous communication, without causing deadlock. Four models were evaluated across fourteen tasks requiring communication, delegation, and composition of messaging with tool calls or control flow; frontier models successfully learned the protocol in-context and achieved very high scores (nearly perfect for GPT-6 Astra), while slightly weaker models scored under 50%.