The Messenger of Allah ﷺ said, "When you are three, two should not converse privately to the exclusion of their companion."Sufyan, in his version of the hadith, said, "Two should not converse privately to the exclusion of the third, for that grieves him."
حدثنا هناد قال حدثنا أبو معاوية عن الأعمش قال ح و حدثني ابن أبي عمر حدثنا سفيان عن الأعمش عن شقيق
قال رسول الله ﷺ إذا كنتم ثلاثة فلا يتناجى اثنان دون صاحبهما و قال سفيان في حديثه لا يتناجى اثنان دون الثالث فإن ذلك يحزنه
Agreed upon [by Bukhari and Muslim]. Muslim also recorded it in the Book of Salam, the chapter on the prohibition of two people conferring privately without a third, excluding him, without his consent, hadith no. 2184, from Muhammad bin Abu Umar, and Bukhari, hadith no. 6290, from the hadith of Shaqiq, with the wording, "Two people should not confer privately excluding one..." and so on.Bukhari also related it in Tarikh al-Kabir 2/304–305, and Abu Yaala, hadith no. 2444, and others besides them. Busiri said, "Its narrators are trustworthy," though Bukhari noted a defect in it.On this subject there are also narrations from Ibn Umar [Bukhari, hadith no. 6288, and Muslim, hadith no. 2183], Abu Hurairah [Ahmad 2/351], and Ibn Abbas [Abu Yaala in his Musnad, 4/332, hadith no. 2444].