1. Security measures are based on the criminal dangerousness of the individual to whom they are imposed, as demonstrated by the commission of an act defined as a crime.
2. Security measures may not be more burdensome or of longer duration than the penalty that could be applied to the act committed, nor may they exceed what is necessary to prevent the offender's dangerousness.