Ubada bin Samit reported,

I gave the pledge of allegiance to the Messenger of Allah ﷺ along with a group of men. He said, "I take your pledge that you will not associate anything with Allah, nor steal, nor commit fornication, nor kill your children, nor come up with a slander that you fabricate between your hands and feet, nor disobey me in what is right. Whoever among you fulfills this, his reward is with Allah. Whoever commits any of these and is punished for it in this world, that punishment is his purification. And whoever Allah conceals, his affair is with Allah. If He wills, He punishes him, and if He wills, He forgives him."

Nasai 4183

Sahih

أخبرنا يعقوب بن إبراهيم قال حدثنا غندر قال أنبأنا معمر قال أنبأنا ابن شهاب عن أبي إدريس الخولاني قال سمعت

عبادة بن الصامت قال

بايعت رسول الله ﷺ في رهط فقال أبايعكم على أن لا تشركوا بالله شيئا ولا تسرقوا ولا تزنوا ولا تقتلوا أولادكم ولا تأتوا ببهتان تفترونه بين أيديكم وأرجلكم ولا تعصوني في معروف فمن وفى منكم فأجره على الله ومن أصاب من ذلك شيئا فعوقب فيه فهو طهوره ومن ستره الله فذاك إلى الله إن شاء عذبه وإن شاء غفر له

النسائي 4183صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Pledge of allegiance
Chapter
Pledging allegiance to part ways with the polytheist
Numbering
Darussalam 4183
Nasai 4183