Learning Inside Types: Epistemic Typestates for Safe Multi-Agent Reinforcement Learning
Lorenzo Bacchiani, Mario Bravetti, Giovanni Pau, Roberto Girau
Abstract
Type disciplines make programs safe by construction: components checked against each other's types compose into programs that cannot go wrong in the ways the types exclude. Types suit reinforcement learning: a type constrains what an agent may choose, not how it chooses, so the guarantee holds for every policy a learner produces. We introduce epistemic typestates, a type discipline for safe multi-agent reinforcement learning. An agent's type is a protocol whose states record its beliefs, the worlds it cannot rule out from its own observations and actions, and permits only actions that are safe in every world of the belief, whatever the others do within their public types. Agents learn inside their types, which are built and checked one agent at a time and run without communication. We prove type soundness and team safety, give a synthesis that is sound and complete, build types from guards when worlds are infinite, and show that shields are a special case. All proofs are mechanised in Rocq. On nine benchmarks, no typed learner causes a safety violation, and task performance does not differ significantly from that of two recent multi-agent shielding methods. Where a contract-based method fails at five and ten agents, types for ten agents are built in under a second. In the two continuous benchmarks, Lagrangian learners cause thousands of violations in every training run.
Create a lesson
Related papers
ChatAtom: A Multi-Agent LLM System for Molecular Dynamics Simulation and Visualization
Shared title terminology · Trupti Mohanty, Ming Du, Mitchell A. Wood et al.
MetaRigor: From Agentic Automation to Verifiable End-to-End Meta-Analysis Through Scientific Decision Boundaries
Shared title terminology · Yifeng Xie, Chenke Li, Yangshuo Miao et al.
From Manufacturing Event Logs to Simulation: Enabling SMEs with Agentic AI for SimPy Simulation Generation
Shared title terminology · Richard Reider, Lina Döring, Sebastian Lang et al.
Evidence sufficiency assessment enables cost-effective review allocation in on-premise clinical AI agents
Shared title terminology · Yiwen Qiu, Che Sun, Shu Shen et al.
γ-Scape: An Agent-Centric World for Mobile Embodied Intelligence
Shared title terminology · Xiaotao Zhang, Lin Qian, Hao Zhang et al.
HookEvo: A Framework for Coordinated Plugin Evolution on Hook-Enabled Agent Runtimes
Shared title terminology · Shengze Huang, Yanyu Mao, Xiaofei Yu et al.