The Messenger of Allah ﷺ said, "Any condition that is not in the Book of Allah is invalid, even if there be a hundred such conditions."
حدثنا وكيع حدثنا هشام عن أبيه
قال رسول الله ﷺ ما كان من شرط ليس في كتاب الله فهو باطل وإن كان مائة شرط
Its isnad is sahih, mentioned previously at 25380.