When an action or proceeding of any nature is commenced in any court against any member of the militia for an act done by the member in his or her official capacity in the discharge of his or her duty, or for an alleged omission by the member to do an act that it was his or her duty to perform, or against any officer or enlisted person acting under proper authority or by virtue of a warrant issued to that person pursuant to law, the defendant in that action or proceeding may require the person instituting or prosecuting the action to file security in an amount to be fixed by the court for the payment of costs that may be awarded to the defendant therein. The defendant in all cases may make a general denial and give the special matter in evidence. A defendant in whose favor a nonsuit or a final judgment is rendered in any such action or proceeding shall recover treble costs. The governor shall appoint special counsel, to defend the action or proceeding, at the expense of the state.
R.I. Gen. Laws § 30-7-4