Andrew was convicted of attacking an Uber driver. The judge…

Andrew was convicted of attacking an Uber driver. The judge sentenced him to three years in prison with the justification that Andrew is a threat to others and the public needs to be protected from him. This is an example of which type of justification for punishment?