Sahih al-Bukhari 835
Musaddad narrated to us, he said: Yahya told us. It is narrated from A'mash: Shaqiq told me. He narrated from Hazrat Abdullah (ra) (bin Mas'ud). He related: When we were in prayer with the Holy Prophet (saw), we used to say: Peace be upon Allah from His servants, and peace be upon so-and-so. Then the Prophet (saw) said: “Do not say ‘As-salamu alallah’ (Peace be upon Allah), for Allah is Himself As-Salam (the Source of Peace). Rather say: All worship of the tongue is for Allah alone, and the worship of the body and the worship of wealth too (are for Allah alone). Peace be upon you, O Prophet, and the mercy of Allah and His blessings, and peace be upon us too and upon the righteous servants of Allah. For when you say (this), (your prayer) will reach every servant in heaven”, or (he said:) “between heaven and earth. (After that say:) I bear witness that there is none worthy of worship except Allah, and that Muhammad (saw) is His servant and His Messenger. Then let him ask for whatever supplication he likes.”
AI-translated by Islam-Today
Book 150: What optional invocation may be selected after the Tashah-hud, and it is not obligatory.