Except as otherwise in the general laws provided, the attorney general, whenever requested, shall act as the legal adviser of the individual legislators of the general assembly, of all state boards, divisions, departments, and commissions and the officers thereof, of all commissioners appointed by the general assembly, of all the general officers of the state, and of the director of administration, in all matters pertaining to their official duties, and shall institute and prosecute, whenever necessary, all suits and proceedings which they may be authorized to commence, and shall appear for and defend the above-named individual legislators, boards, divisions, departments, commissions, commissioners, and officers, in all suits and proceedings which may be brought against them in their official capacity.
R.I. Gen. Laws § 42-9-6