Sex at 23 weeks?

I know sex is supposed to be safe but that contradicts it also supposed to be able to induce labor...? If it can induce labor or soften your cervix don't see how it's safe until 37 weeks... 😕