Insurance Code (usually included in commercial codals)
Section 124. A deviation is proper:
(a) When caused by circumstances over which neither the master nor the owner of the ship has any control;
(b) When necessary to comply with a warranty, or to avoid a peril, whether or not the peril is insured against;
(c) When made in good faith, and upon reasonable grounds of belief in its necessity to avoid a peril; or
(d) When made in good faith, for the purpose of saving human life or relieving another vessel in distress.