We consider the optimal contract under cost uncertainty between a risk averse buyer and a risk averse supplier when the supplier can privately discover more cost information after contracting but before production. We show that the optimal contract is often characterized by distortions and rules which restrict the supplier from adjusting the production schedule to the cost realization. The supplier is often constrained by strict rules in high cost states, but enjoys more discretion to adjust the production schedule in low cost states. Moreover, the supplier is granted with more discretion when the buyer becomes more risk averse, but is restricted by more rules when the supplier becomes more risk averse or when the supplier's risk preference becomes private information.