Latae sententiae penalties are not to be established, except perhaps for some outstanding and malicious offences which may be either more grave by reason of scandal or such that they cannot be effectively punished by ferendae sententiae penalties; censures, however, especially excommunication, are not to be established, except with the greatest moderation, and only for offences of special gravity.
Source: Code of Canon Law (Vatican.va)