Hospitality is valued very highly in Judaism, witness Abraham [Gen. 18:1-5], Lot [Gen. 19:1-8], Laban [Gen. 24:28–32], Manoah [Judges 13:15-16] or the unhappy matter of the concubine of Gibeah [Judges 19:23–24].
The Talmud says that there are six matters for which a person enjoys the profits in this world, while the principal remains for him for the World-to-Come, and hospitality is the first one listed [Shabbat 127a].
But hospitality has limits: (1) God did not look kindly on Lot offering his daughters to protect his guests [Midrash Tanhuma, Vayera 12]; (2) priorities must be set clearly (story of woman offering what little bread she had to comfort a stranger during a siege when there wasn't enough for her own family [Lam. R. 4:13]; and (3) possible strain on the family if the wife or children are not as eager as the husband to welcome guests [Bava Metzia 87a, Ber. 10b].
But I could not find anything in the Sources about the biggest deterrent of all to hospitality: Security. It could be very dangerous to welcome in your house a stranger who may turn against you. Is there anything in halacha about this? (I an sure I don't need to dwell on the current relevance of this issue.)
Added: The other article concludes: "If a loss or any damage will result from hosting a particular guest one would not be obligated to host him [Orech Maisharim 17-2]." That is not an answer to my question. You don't know beforehand whether you will suffer a loss or not. I am bothered by the fact that I did not find even a simple "just be careful" in the Sources.