To make this recipe gluten free, replace the all-purpose flour with a high-quality 1:1 gluten-free baking flour blend that includes xanthan gum or a similar binder. Also confirm that the vanilla extract, powdered sugar, and nuts are certified gluten free, as ingredients and manufacturing practices can vary by brand. Because gluten-free flour can produce a more delicate texture, chill the dough thoroughly and handle the cookies gently after baking to help them hold their shape.