We study a model in which rational agents decide whether or not to commit a crime based on a utility calculation, influenced by a judge who sets a society-wide threshold corresponding to the likelihood of an individual being found guilty and a legislator who sets a society-wide punishment level. We study how the overall crime rate is influenced by the judge’s threshold and the legislator’s punishment level, propose an objective function for the judge and legislator to minimise, and study the optimal threshold and punishment levels for this objective. We then consider the case in which the overall society is subdivided into multiple groups with varying characteristics, introducing a constraint on fairness in treatment between the groups. We study how an optimal threshold and punishment level might be chosen under this fairness constraint, what ramifications the constraints have on outcomes for individuals, and under what circumstances the constrained optimum agrees with the unconstrained optimum.