I've implemented PD balancing control for the torso. Previously there were prismatic constraints keeping the torso parallel to the ground, but now the robot is entirely self-balancing.
To prevent the feet from slipping, the controller limits the balancing torque according to the current axial force on the leg. When the axial leg force is small (such as immediately after touchdown or right before liftoff), the controller knows not to apply too much balancing torque to that leg.
Conversely, during the double support phase (both legs on the ground), the controller evenly distributes the balancing torque between both legs. This keeps it from simultaneously applying full balancing torque to both legs, which would cause the robot to "overbalance" and fall over.