You searched for: “nulla poena sine lege
nulla poena sine lege
No punishment without a law.

If a law didn't exist before a specific action was committed, one can't be sentenced to prison for that activity.