  Cavity-QED is a promising avenue for the deterministic generation of
entangled and spin-squeezed states for quantum metrology. One archetypal scheme
generates squeezing via collective one-axis twisting interactions. However, we
show that in implementations using optical transitions in long-lived atoms the
achievable squeezing is fundamentally limited by collectively enhanced emission
into the cavity mode which is generated in parallel with the cavity-mediated
spin-spin interactions. We propose an alternative scheme which generates a
squeezed state that is protected from collective emission, and investigate its
sensitivity to realistic sources of experimental noise and imperfections.
