He should treat them based on what they reveal. Those who have shown their Islamic faith should be treated as Muslims, however, caution should be practiced for fear of their betrayal. Allah Almighty told His Prophet pbuh: ‘They are the enemy, so beware of them’
It is known that the Prophet pbuh, did not treat the hypocrites based on what Allah revealed to him about them, but he treated them based on the actions that they revealed. So he, who pretended to be a Muslim was treated as a Muslim.
This is the Islamic verdict with which Allah Almighty treats them. In this world, they are treated as Muslims but in the Hereafter they will be treated differently.
(On that Day hypocrite men and women will beg the believers, “Wait for us so that we may have some of your light.” It will be said ˹mockingly˺, “Go back ˹to the world˺ and seek a light ˹there˺!” Then a ˹separating˺ wall with a gate will be erected between them. On the near side will be grace and on the far side will be torment.) Al-Hadid 57: 13
يعاملهم بظاهر أحوالهم، فمن أظهر الإسلام يعامله بالإسلام مع الحذر منهم ومن مكرهم، كما قال الله تعالى لنبيهﷺ:” هُمُ الْعَدُوُّ فَاحْذَرْهُمْ
والمعلوم من تعامل النبي ﷺ معهم أنه لم يعاملهم بأنه يعلم بواطنهم بما أعلمه الله، وإنما على ظاهر أحوالهم، فمن أظهر الإسلام فهو مسلم.
وهذا الأمر الشرعي لهم من خداع الله عز وجل لهم، فهم يعاملون في الدنيا معاملة المسلمين لكنهم في الآخرة يعاملون بضد ذلك، كما قال الله تعالى:
“يَوْمَ يَقُولُ الْمُنَافِقُونَ وَالْمُنَافِقَاتُ لِلَّذِينَ آمَنُوا انْظُرُونَا نَقْتَبِسْ مِنْ نُورِكُمْ قِيلَ ارْجِعُوا وَرَاءَكُمْ فَالْتَمِسُوا نُورًا فَضُرِبَ بَيْنَهُمْ بِسُورٍ لَهُ بَابٌ بَاطِنُهُ فِيهِ الرَّحْمَةُ وَظَاهِرُهُ مِنْ قِبَلِهِ الْعَذَابُ (١٣) يُنَادُونَهُمْ أَلَمْ نَكُنْ مَعَكُمْ قَالُوا بَلَى وَلَكِنَّكُمْ فَتَنْتُمْ أَنْفُسَكُمْ وَتَرَبَّصْتُمْ وَارْتَبْتُمْ وَغَرَّتْكُمُ الْأَمَانِيُّ حَتَّى جَاءَ أَمْرُ اللَّهِ وَغَرَّكُمْ بِاللَّهِ الْغَرُورُ (١٤) فَالْيَوْمَ لَا يُؤْخَذُ مِنْكُمْ فِدْيَةٌ وَلَا مِنَ الَّذِينَ كَفَرُوا مَأْوَاكُمُ النَّارُ هِيَ مَوْلَاكُمْ وَبِئْسَ الْمَصِيرُ” .