Yahya related to me from Malik from Ibn Shihab from Ata ibn Yazid al-Laythi that Ubaydullah ibn Adi ibnal-Khiyar said, "Once when the Messenger of Allah ﷺ was sitting with some people, a man came to him and spoke secretly to him. Nobody knew what he had said until the Messenger of Allah ﷺ disclosed that he had asked for permission to kill one of the hypocrites. When he disclosed this, the Messenger of Allah ﷺ said, 'Doesn't he testify that there is no god but Allah and that Muhammad is the Messenger of Allah?' The man replied, 'Of course, but he hasn't really done so.' He said, 'Doesn't he do the prayer?' and the man replied, 'Of course, but he doesn't really do the prayer.' He sai ﷺ 'Those are the ones whom Allah has forbidden me (to kill).' "
أَنَّهُ قَالَ بَيْنَمَا رَسُولُ اللَّهِ ﷺ جَالِسٌ بَيْنَ ظَهْرَانَىِ النَّاسِ إِذْ جَاءَهُ رَجُلٌ فَسَارَّهُ فَلَمْ يُدْرَ مَا سَارَّهُ بِهِ حَتَّى جَهَرَ رَسُولُ اللَّهِ ﷺ فَإِذَا هُوَ يَسْتَأْذِنُهُ فِي قَتْلِ رَجُلٍ مِنَ الْمُنَافِقِينَ فَقَالَ رَسُولُ اللَّهِ ﷺ حِينَ جَهَرَ أَلَيْسَ يَشْهَدُ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ وَأَنَّ مُحَمَّدًا رَسُولُ اللَّهِ فَقَالَ الرَّجُلُ بَلَى وَلاَ شَهَادَةَ لَهُ فَقَالَ أَلَيْسَ يُصَلِّي قَالَ بَلَى وَلاَ صَلاَةَ لَهُ فَقَالَ ﷺ أُولَئِكَ الَّذِينَ نَهَانِي اللَّهُ عَنْهُمْ