The judge granting the writ may require bond conditioned that the person detained shall not escape by the way, and for the payment of costs. The bond shall be filed with the record of the proceedings, and shall be sued on by the Commonwealth for the benefit of anyone injured by the breach of it.
KRS 419.040