http://chriskresser.com/harmful-or-harmless-xanthan-gum
Wheat, corn, soy, and dairy allergies
I mentioned in the opening section that xanthan gum is produced by bacterial fermentation of a sugar-containing medium. Unfortunately, that ‘medium’ is often a potentially allergenic substance such as corn, soy, dairy, or wheat. Many xanthan gum manufacturers aren’t eager to share what their ‘medium’ is, but one common supplier, Bob’s Red Mill, discloses their production practices.
It looks like they originally used corn or soy as a medium, but they’ve since changed their medium to a glucose solution derived from wheat starch. However, they claim that the xanthan gum is still gluten-free, and it continues to be marketed as such.
It can be difficult to find production info online, but just be aware that if you have a severe allergy to corn, soy, wheat, or dairy, it would be prudent to either avoid xanthan gum entirely or check with the manufacturer to see how it’s produced.
Conclusion
Based on the available evidence, the worst xanthan gum seems to be capable of (in adults) is causing some digestive distress in those who are susceptible by increasing stool bulk, water content, and sugar content. But as I just mentioned, those with severe allergies should also be careful.
I recommend that people with digestive problems generally avoid xanthan gum, not because there’s evidence that it could damage your gut, but because its structural properties make it likely to produce unpleasant gut symptoms. Unlike carrageenan, there’s no evidence that xanthan gum can cause serious harm (even in human studies using doses much higher than people would normally encounter), so if you are able to tolerate it, I see no compelling reason to strictly avoid it. I wouldn’t recommend consuming large amounts every day, because xanthan gum appears to have a high propensity for altering the gut microbiome, and it’s unclear whether that alteration could be problematic in the long run. But the small amounts that you would normally encounter in the context of a real-food diet shouldn’t present a problem.