At any stage of the action, upon motion by the defendant, or upon its own initiative, the court may order the plaintiff to give an undertaking for costs and taxable disbursements not to exceed the sum of twenty-five hundred dollars. If plaintiff shall not have given such undertaking at the expiration of sixty days from the date of service of the order upon him or her, the court may, upon motion of the defendant, dismiss the action and award costs to the defendant. This section shall not apply to any action commenced by the attorney general in the name of and on behalf of the people of the state.
N.Y. State Fin. Law § 123-D