Hadith 738
Abu Mas'ud Al-Badri (May Allah be pleased with him) reported:
عن أبى مسعود البدرى رضى الله عنه قال: دعا رجل النبي صلى الله عليه وسلم لطعام صنعه له خامس خمسة، فتبعهم رجل، فلما بلغ الباب، قال النبي صلى الله عليه وسلم: "إن هذا تبعنا؛ فإن شئت أن تأذن له، وإن شئت رجع" قال: بل آذن له يا رسول الله .((متفق عليه))
A man prepared some food especially for the Prophet (ﷺ) and invited him along with four others. But a man accompanied him. Having arrived at the door, Messenger of Allah (ﷺ) said to the host, "This person has followed us. You may allow him, if you like, and if you like he will return." He said: "O Messenger of Allah, I allow him, too." [Al-Bukhari and Muslim].
In plain words
When an uninvited guest followed him, the Prophet told the host plainly and left the choice in his hands, since the meal was prepared for a set number. Honesty paired with care for everyone's dignity.
Reference : Riyad as-Salihin 738 In-book reference : Book 2, Hadith 12