Whenever any person is convicted of an offense for which under this Sanhita the Court has the power to sentence him to rigorous imprisonment, the Court may, by its sentence, order that the offender shall be kept in solitary confinement for any portion or portions of the imprisonment to which he is sentenced, not exceeding three months in the whole, according to the following scale, namely.
WEBSITE – https://www.leadindia.law/indian-kanoon/bharatiya-nyaya-sanhita-bns/chapter-2-of-punishments/clause-11-solitary-confinement