The Prophet ﷺ said, "If a slave-girl (Ama) commits illegal sexual intercourse, scourge her; if she does it again, scourge her again; if she repeats it, scourge her again." The narrator added that on the third or the fourth offense, the Prophet ﷺ said, "Sell her even for a hair rope."
عَنِ النَّبِيِّ ﷺ قَالَ إِذَا زَنَتِ الأَمَةُ فَاجْلِدُوهَا ثُمَّ إِذَا زَنَتْ فَاجْلِدُوهَا ثُمَّ إِذَا زَنَتْ فَاجْلِدُوهَا فِي الثَّالِثَةِ أَوِ الرَّابِعَةِ بِيعُوهَا وَلَوْ بِضَفِيرٍ