When a person has been sentenced to a custodial sentence of seven years or more for a felony or misdemeanour for which socio-judicial supervision is incurred, or of five years or more for a felony or misdemeanour committed again as a repeat offender, the sentence enforcement court may, at the request of the public prosecutor, order as a security measure and for the sole purpose of preventing a repeat offence, the risk of which appears to be proven, that he or she will be placed under judicial supervision as soon as he or she is released and for a period that may not exceed that corresponding to the reductions in sentence from which he or she has benefited and which have not been the subject of a withdrawal decision.