Ubada bin Samit reported,

I pledged 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, that you will not steal, that you will not commit adultery, that you will not kill your children, that you will not bring forth any slander you have fabricated between your hands and feet, and that you will not disobey me in what is right. Whoever among you fulfills this, his reward is with Allah. Whoever commits any of these offenses and is punished for it in this world, that punishment will serve as his expiation and purification. And whoever commits such an offense and Allah conceals it, his affair rests with Allah. If He wills, He will punish him, and if He wills, He will forgive him."

Bukhari 7468

Sahih

حدثنا عبد الله المسندي حدثنا هشام أخبرنا معمر عن الزهري عن أبي إدريس

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

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

البخاري 7468صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tawhid
Chapter
Will and volition
Numbering
Darussalam 7468
Bukhari 7468