I have a couple hides for my beardie and he seems to enjoy sleeping in them at night or retiring to them during the day when he gets hot. Is he just sitting under the heat source with his beard out? If so that's just him basking and regulating his temperature. If he does it when you reach in to grab him then it's defensive.