In any action brought in the right of a cooperative by less than three percent of the members or by holders of less than three percent of any class of stock outstanding, the defendants may require the plaintiff to give security for the reasonable expenses of defending such action, including attorney's fees. The amount of such security may thereafter be increased or decreased in the discretion of the court upon showing that the security provided is or may be inadequate or is excessive.
SDCL 47-16-39