(a) Whenever a complaint for damages is filed against any architect, landscape architect, engineer, building designer, or land surveyor, duly licensed as such under the laws of this state, in an action for error, omission, or professional negligence in the creation and preparation of plans, specifications, designs, reports or surveys which are the basis for work performed or agreed to be performed on real property, any such defendant may, within 30 days after service of summons, move the court for an order, upon notice and hearing, requiring the plaintiff to file an undertaking in a sum not to exceed five hundred dollars ($500) as security for the costs of defense as provided in subdivision (d), which may be awarded against the plaintiff. The motion shall be supported by affidavit showing that the claim against the defendant is frivolous.
At the hearing upon the motion, the court shall order the plaintiff to file the undertaking if the defendant shows to the satisfaction of the court that (i) the plaintiff would not suffer undue economic hardship in filing the undertaking, and (ii) there is no reasonable possibility that the plaintiff has a cause of action against each named defendant with respect to whom the plaintiff would otherwise be required to file the undertaking. No appeal shall be taken from any order made pursuant to this subdivision to file or not to file the undertaking.
A determination by the court that the undertaking either shall or shall not be filed or shall be filed as to one or more defendants and not as to others, shall not be deemed a determination of any one or more issues in the action or of the merits thereof. If the court, upon any such motion, makes a determination that an undertaking be filed by the plaintiff as to any one or more defendants, the action shall be dismissed as to the defendant or defendants, unless the undertaking required by the court has been filed within such reasonable time as may be fixed by the court.
(b) This section does not apply to a complaint for bodily injury or for wrongful death, nor to an action commenced in a small claims court.
(c) Whenever more than one such defendant is named, the undertaking shall be increased to the extent of not to exceed five hundred dollars ($500) for each additional defendant in whose favor the undertaking is ordered not to exceed the total of three thousand dollars ($3,000).
(d) In any action requiring an undertaking as provided in this section, upon the dismissal of the action or the award of judgment to the defendant, the court shall require the plaintiff to pay the defendant’s costs of defense authorized by law. Any sureties shall be liable for such costs in an amount not to exceed the sum of five hundred dollars ($500) or the amount of the undertaking, whichever is lesser, for each defendant with respect to whom the sureties have executed an undertaking.