Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:9:56

And they swear by Allah that they are from among you while they are not from among you; but they are a people who are afraid.  

And they swear by God that they truly are of you, that is, ˹that they are˺ believers; but they are not of you; they are a folk who are afraid, that you should deal with them as you have done with the idolaters, and so they swear merely in pretence, in order to protect themselves.
القرآن:٩:٥٦

وَيَحْلِفُونَ بِاللَّهِ إِنَّهُمْ لَمِنْكُمْ وَمَا هُمْ مِنْكُمْ وَلَٰكِنَّهُمْ قَوْمٌ يَفْرَقُونَ  

{ويحلفون بالله إنهم لمنكم} أي مؤمنون {وما هم منكم ولكنهم قوم يفرقون} يخافون أن تفعلوا بهم كالمشركين فيحلفون تقية.