The Messenger of Allah ﷺ used to say toward the end of his life, whenever he wished to rise from a gathering, "Glory be to You, Allah, and praise be to You. I bear witness that there is no god but You. I seek Your forgiveness and turn to You in repentance."A man said, "Messenger of Allah, you are saying words that you did not used to say before."He replied, "It is an expiation for whatever may have occurred in the gathering."
كان رسول الله ﷺ يقول بأخرة إذا أراد أن يقوم من المجلس: سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت، أستغفرك وأتوب إليك. فقال رجل يا رسول الله: إنك لتقول قولا ما كنت تقوله فيما مضى قال: كفارة لما يكون في المجلس.
Abu Dawud (4859), Nasai in Amal al-Yawm wal-Layla (426), Ahmad (19812), and Hakim (1/537) all narrated it through routes going back to Hajjaj bin Dinar, from Abu Hashim (who is Rumani), from Abu Aliyah, from Abu Barza Aslami, who related it.Its chain is hasan because of Hajjaj bin Dinar, since there is disagreement about him. The majority of the scholars deemed him reliable, while Daraqutni criticized him, but the correct view is that of the majority. This is also the view preferred by Hafiz bin, who said in Fath al-Bari (13/545), "Its chain is strong."However, Nasai narrated it in Amal al-Yawm wal-Layla (2428) through the route of Mansur bin Mutamir, from Fudayl bin Amr, from Ziyad bin Husayn, from Abu Aliyah, from the Prophet ﷺ, as a mursal narration.An addition from a reliable narrator is accepted, except that Abu Hatim, Abu Zura, and Daraqutni preferred the mursal version.And Allah knows best.