How the Rule of Law Safeguards Moral Agency