The Prophet ﷺ said, "There is no prophet and no caliph," or he said, "There is no prophet, except that he has two inner circles. One inner circle commands him to do good and forbids him from evil, and another inner circle that spares no effort in corrupting him. Whoever is protected from the evil of the wicked inner circle has truly been protected." He said this three times. "And he belongs to whichever of the two prevails over him."
حدثنا مؤمل بن إسماعيل حدثنا حماد بن سلمة حدثنا برد بن سنان عن الزهري عن أبي سلمة
أن النبي ﷺ قال ما من نبي ولا خليفة أو قال ما من نبي إلا وله بطانتان بطانة تأمره بالمعروف وتنهاه عن المنكر وبطانة لا تألوه خبالا ومن وقي شر بطانة السوء فقد وقي يقولها ثلاثا وهو مع الغالبة عليه منهما
Its isnad is sahih. Barad bin Sinan Abu Ala, his reliability was already established at 4469, and we add here that Ibn Abu Hatim mentioned him in his biographical entries at 1/1/422. The hadith is a repetition of 7238, narrated by Uzai from Zuhri.