We derive a necessary and sufficient criterion for when a two-dimensional gapped many-body system with Abelian anyons and a unitary Z2 symmetry has a protected gapless edge mode. Our criterion is phrased in terms of edge theories—or more specifically, chiral boson edge theories with Z2 symmetry—and it applies to any bosonic or fermionic system whose boundary can be described by such an edge theory. At an operational level, our criterion takes as input a chiral boson edge theory with Z2 symmetry, and then produces as output a prediction as to whether this edge theory can be gapped without breaking the symmetry. Like previous work, much of our derivation involves constructing explicit perturbations that gap chiral boson edge theories. Interestingly, however, we find that the standard class of gapping perturbations—namely, cosine terms constructed from null vectors—is not sufficient to gap some edge theories with Z2 symmetry, and thus we are forced to go beyond the usual null-vector analysis to establish our results.