Section 116(3) in The Code of Criminal Procedure, 1973
(3)After the commencement and before the completion of the inquiry under sub-section (1), the Magistrate, if he considers that immediate measures are necessary for the prevention of a breach of the peace or disturbance of the public tranquillity or the commission of any offence or for the public safety, may, for reasons to be recorded in writing, direct the person in respect of whom the order under section 111 has been made to execute bond, with or without sureties, for keeping the peace or maintaining good behaviour until the conclusion of the inquiry, and may detain him in custody until such bond is executed or, in default of execution, until the inquiry is concluded :Provided that -(a)no person against whom proceedings are not being taken under section 108, section 109 or section 110 shall be directed to execute a bond for maintaining good behaviour;(b)the conditions of such bond, whether as to the amount thereof or as to the provision of sureties or the number thereof or the pecuniary extent of their liability, shall not be more onerous than those specified in order under section 111.