Regulatory T cell (Treg) deficiency leads to immune dysregulation, polyendocrinopathy, enteropathy, and X‐linked (IPEX) syndrome, which is a CD4+ T cell‐driven autoimmune disease in both humans and mice. Despite understanding the molecular and cellular characteristics of IPEX syndrome, new treatment options have remained elusive. Here, we hypothesized that salvianolic acid B (Sal B), one of the main active ingredients of Salvia miltiorrhiza, can protect against immune disorders induced by Treg deficiency. To examine whether Sal B can inhibit Treg deficiency‐induced autoimmunity, Treg‐deficient scurfy (SF) mice with a mutation in forkhead box protein 3 were treated with different doses of Sal B. Immune cells, inflammatory cell infiltration, and cytokines were evaluated by flow cytometry, hematoxylin and eosin staining and enzyme‐linked immunosorbent assay Kits, respectively. Moreover, RNA sequencing, western blot, and real‐time PCR were adopted to investigate the molecular mechanisms of action of Sal B. Sal B prolonged lifespan and reduced inflammation in the liver and lung of SF mice. Moreover, Sal B decreased plasma levels of several inflammatory cytokines, such as IL‐2, IFN‐γ, IL‐4, TNF‐α, and IL‐6, in SF mice. By analyzing the transcriptomics of livers, we determined the signaling pathways, especially the IL‐2‐signal transducer and activator of transcription 5 (STAT5) signaling pathway, which were associated with Treg deficiency‐induced autoimmunity. Remarkably, Sal B reversed the expression of gene signatures related to the IL‐2‐STAT5 signaling pathway in vitro and in vivo. Sal B prolongs survival and inhibits lethal inflammation in SF mice through the IL‐2‐STAT5 axis. Our findings may inspire novel drug discovery efforts aimed at treating IPEX syndrome.