Bacteria commonly face attacks from other strains using the type VI secretion system (T6SS), which acts like a molecular speargun to stab and intoxicate competitors. Here we show how bacteria can work together to collectively defend themselves against these attacks. This project began with an outreach activity: while developing an online computer game of bacterial warfare, we noticed that one strategist (“Slimy”) that made extracellular polymeric substances (EPS) was able to resist attacks from another strategist that employed the T6SS (“Stabby”). This observation motivated us to model this scenario more formally, using dedicated agent-based simulations. The model predicts that EPS production can serve as a collective defence mechanism, which protects both producing cells and neighbouring cells that do not make EPS. We then tested our model with a synthetic community that contains a T6SS-wielding attacker (Acinetobacter baylyi), and two T6SS-sensitive target strains (Escherichia coli) that either secrete EPS, or not. As predicted by our modelling, we find that the production of EPS leads to collective protection against T6SS attacks, where EPS producers protect each other and nearby non-producers. We identify two processes that explain this protection: EPS sharing between cells and a second general mechanism whereby groups of resistant cells shield susceptible cells, which we call “flank protection”. Our work shows how EPS-producing bacteria can work together to defend themselves from the type VI secretion system.