Ali bin Abu Talib reported,

Ali said, "We did not write down anything from the Prophet ﷺ except the Quran and what is in this document."The Prophet ﷺ said, "Madinah is a sanctuary, from Air to such-and-such a place. Whoever introduces an innovation in it or shelters an innovator, upon him is the curse of Allah, the angels, and all people. No obligatory worship or voluntary deed will be accepted from him. The protection granted by the Muslims is one, extending even through the least of them. Whoever betrays a Muslim's protection, upon him is the curse of Allah, the angels, and all people. No voluntary deed or obligatory worship will be accepted from him. Whoever attaches himself as a client to a people without the permission of his patrons, upon him is the curse of Allah, the angels, and all people. No voluntary deed or obligatory worship will be accepted from him."

Bukhari 3179

Sahih

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

عن علي رضي الله عنه قال

ما كتبنا عن النبي ﷺ إلا القرآن وما في هذه الصحيفة قال النبي ﷺ المدينة حرام ما بين عائر إلى كذا فمن أحدث حدثا أو آوى محدثا فعليه لعنة الله والملائكة والناس أجمعين لا يقبل منه عدل ولا صرف وذمة المسلمين واحدة يسعى بها أدناهم فمن أخفر مسلما فعليه لعنة الله والملائكة والناس أجمعين لا يقبل منه صرف ولا عدل ومن والى قوما بغير إذن مواليه فعليه لعنة الله والملائكة والناس أجمعين لا يقبل منه صرف ولا عدل

البخاري 3179صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Jizya and truce
Chapter
Breaking a covenant after making it
Numbering
Darussalam 3179
Bukhari 3179