Wikipedia (Near-Earth Supernova) says that a 25 ly away supernova would wipe out half the ozone layer so that's probably the lower bound for what we want
That’s fair. It’s also a little misleading because there are other cosmic events that could happen that are both closer to us and potentially further away, and have in the past. I wouldn’t say we are immune from the hazards of space but my comment could have been construed that way.