Classical theologians disagreed about the place of reason and revelation in judgments of goodness and badness. The discussion includes Sunni approaches and Muʿtazilī approaches.
Rational goodness refers to the mind's ability to recognize features such as excellence and defect. Legal goodness addresses obligations, prohibitions, reward and punishment established by the Lawgiver.
Some Muʿtazilī formulations give reason a more independent role in establishing duty and desert before revealed commands. The Hanafi treatment here distinguishes recognizing an act's merit from assigning a specific religious obligation by revelation. Reason alone does not settle every duty.