backstab
backstab is a Python library for game-theoretic analysis and Monte Carlo simulation of social deduction games in the Traitors/Mafia/Werewolf family.
It accompanies the paper "The Vote-Left Equilibrium: A Deterministic Coordination Strategy for the Faithful in The Traitors."
Where to start
This documentation is organised using the Diataxis framework.
- Tutorials
Step-by-step lessons for newcomers. Start here if you have never used backstab before.
- How-to guides
Practical recipes for common tasks. Start here if you know what you want to do.
Compare strategies · Analyse deviations · Run parameter sweeps
- Reference
Complete, authoritative description of every public API.
- Explanation
Background reading on the theory and design decisions behind the library.
The game model · The FixedOrder protocol
Installation
python -m pip install backstab
Or with uv:
uv add backstab