Sunan an Nasai 4051
The Book of Fighting [The Prohibition of Bloodshed]
أَخْبَرَنَا أَحْمَدُ بْنُ سُلَيْمَانَ، قَالَ حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُوسَى، قَالَ أَنْبَأَنَا إِسْرَائِيلُ، عَنْ مُغِيرَةَ، عَنِ الشَّعْبِيِّ، عَنْ جَرِيرِ بْنِ عَبْدِ اللَّهِ، قَالَ إِذَا أَبَقَ الْعَبْدُ إِلَى أَرْضِ الشِّرْكِ فَلاَ ذِمَّةَ لَهُ .
It was narrated that Jarir bin 'Abdullah said:"If a slave runs away to the land of Shirk, there is no protection (or immunity) for him
Grading: Abu Ghuddah: Sahih · Al-Albani: Sahih · Zubair Ali Zai: Hasan
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.