Autoimmune diseases, including inflammatory bowel disease, multiple sclerosis and rheumatoid arthritis, have distinct clinical presentations but share underlying patterns of gut microbiome perturbation and intestinal barrier dysfunction. Their potentially common microbial drivers advocate for treatment strategies aimed at restoring appropriate microbiome function, but individual variation in host factors makes a uniform approach unlikely. In this Perspective, we consolidate knowledge on diet–microbiome interactions in local inflammation, gut microbiota imbalance and host immune dysregulation. By understanding and incorporating the effects of individual dietary components on microbial metabolic output and host physiology, we examine the potential for diet-based therapies for autoimmune disease prevention and treatment. We also discuss tools targeting the gut microbiome, such as faecal microbiota transplantation, probiotics and orthogonal niche engineering, which could be optimized using custom dietary interventions. These approaches highlight paths towards leveraging diet for precise engineering of the gut microbiome at a time of increasing autoimmune disease.