BAYHAQI 17258:
from Kān —
[Machine] It was that when the thief was caught, his hand would be cut off, then he would be punished, then he would be thrown into prison. When they were acquitted and he wanted to release them, he would say, "Raise your hands to Allah as if I see them like red camels." He would ask, "Who cut you?" They would say, "Ali." He would say, "O Allah, they have spoken the truth about You. I cut them in Your name and sent them for Your sake." Ali ibn al-Madini narrated this in the first chain, and the hadith is with me from Ibn Abjar. The sheikh, may Allah have mercy on him, said, "It is as if he was commanding them to confess until they are acquitted. It is not that he was imprisoning them as a punishment." Sufyan al-Thawri narrated from Muhammad ibn Ishaq from Abu Ja'far that Ali said, "Imprisoning the Imam after the establishment of punishment is an injustice."
البيهقي ١٧٢٥٨:
عن كان —
أَنَّهُ كَانَ إِذَا أَخَذَ اللِّصَّ قَطَعَهُ ثُمَّ حَسَمَهُ ثُمَّ أَلْقَاهُ فِي السِّجْنِ فَإِذَا بَرِئُوا وَأَرَادَ أَنْ يُخْرِجَهُمْ فَقَالَ ارْفَعُوا أَيْدِيَكُمْ إِلَى اللهِ كَأَنِّي أَنْظُرُ إِلَيْهَا كَأَنَّهَا أُيُورُ الْحُمُرِ فَيَقُولُ مَنْ قَطَعَكُمْ؟ فَيَقُولُونَ عَلِيٌّ فَيَقُولُ اللهُمَّ صَدَقُوا فِيكَ قَطَعْتُهُمْ وَفِيكَ أَرْسَلْتُهُمْ قَالَ عَلِيُّ بْنُ الْمَدِينِيِّ فِي الْإِسْنَادِ الْأَوَّلِ وَالْحَدِيثُ عِنْدِي حَدِيثُ ابْنِ أَبْجَرَ قَالَ الشَّيْخُ رَحِمَهُ اللهُ وَكَأَنَّهُ كَانَ يَأْمُرُ بِتَعَهُّدِهِمْ حَتَّى يَبْرَءُوا لَا أَنَّهُ كَانَ يَحْبِسُهُمْ تَعْزِيرَا فَقَدْ رَوَى سُفْيَانُ الثَّوْرِيُّ عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ عَنْ أَبِي جَعْفَرٍ أَنَّ عَلِيًّا ؓ قَالَ حَبْسُ الْإِمَامِ بَعْدَ إِقَامَةِ الْحَدِّ ظُلْمٌ
hadithunlocked.com