Sura Yusuf

12:75

قَالُوا۟ جَزَٰٓؤُهُۥ مَن وُجِدَ فِى رَحْلِهِۦ فَهُوَ جَزَٰٓؤُهُۥ ۚ كَذَٰلِكَ نَجْزِى ٱلظَّٰلِمِينَ

[Bröderna] svarade: "Den i vars packfickor [bägaren] påträffas skall betala för detta med sin frihet; så straffar vi dem som begår en sådan orätt."

Tafsir 12:75

Joseph’s brothers said that the payment for any thief among them was that the person in whose bag the stolen item was found would become the slave of whoever he stole from. This punishment of being made into a slave is the way they punished thieves.