A witness who, when required, refuses to recognize, either with or without sureties, shall, except as provided in the following section, be committed to jail until he complies with such order or is otherwise discharged; but if the court or justice finds that the witness, unless he is the prosecutor or an accomplice, is unable to procure sureties when so ordered, he shall, except in cases of felony, be discharged upon his own recognizance. Upon a complaint or indictment for a felony, against a defendant not in custody, a material witness committed for failure to furnish sureties upon his own recognizance may be held in custody for a reasonable time, pending the pursuit and apprehension of the defendant.
Mass. Gen. Laws ch. 276, § 49