The attorney general or any attorney in his or her department designated by him or her shall, upon request of the petitioner, when directed by the court, appear and act for the petitioner in any criminal case under the provisions of this chapter; and the public defender shall, at the direction of the court, appear in criminal cases on behalf of defendants who are found by the court to be financially unable to engage counsel.
R.I. Gen. Laws § 14-1-58