Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:11292Abū al-Fatḥ al-ʿUmarī > Abū al-Qāsim al-Saqaṭī Bimakkah > Abū Jaʿfar Muḥammad b. Yaḥyá b. ʿUmar b. ʿAlī b. Ḥarb > ʿAlī b. Ḥarb > Sufyān > Muḥammad b. Isḥāq > Abū Jaʿfar > ʿAlī

[Machine] Verily, imprisonment is only to clarify to the leader, so whatever is imprisoned thereafter, it is oppression.  

البيهقي:١١٢٩٢وَأَخْبَرَنَا أَبُو الْفَتْحِ الْعُمَرِيُّ ثنا أَبُو الْقَاسِمِ السَّقَطِيُّ بِمَكَّةَ ثنا أَبُو جَعْفَرٍ مُحَمَّدُ بْنُ يَحْيَى بْنِ عُمَرَ بْنِ عَلِيِّ بْنِ حَرْبٍ ثنا عَلِيُّ بْنُ حَرْبٍ ثنا سُفْيَانُ عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ عَنْ أَبِي جَعْفَرٍ أَنَّ عَلِيًّا ؓ قَالَ

إِنَّمَا الْحَبْسُ حَتَّى يَتَبَيَّنَ لِلْإِمَامِ فَمَا حَبَسَ بَعْدَ ذَلِكَ فَهُوَ جَوْرٌ