Voriconazole (VRC), a widely used antifungal drug, often causes hepatotoxicity, which presents a significant clinical challenge. Previous studies demonstrated that Astragalus polysaccharide (APS) can regulate VRC metabolism, thereby potentially mitigating its hepatotoxic effects. In this study, we aimed to explore the mechanism by which APS regulates VRC metabolism. First, we assessed the association of abnormal VRC metabolism with hepatotoxicity using the Roussel Uclaf Causality Assessment Method scale. Second, we conducted a series of basic experiments to verify the promotive effect of APS on VRC metabolism. Various in vitro and in vivo assays, including cytokine profiling, immunohistochemistry, quantitative polymerase chain reaction, metabolite analysis, and drug concentration measurements, were performed using a lipopolysaccharide-induced rat inflammation model. Finally, experiments such as intestinal biodiversity analysis, intestinal clearance assessments, and Bifidobacterium bifidum replenishment were performed to examine the ability of B. bifidum to regulate the expression of the VRC-metabolizing enzyme CYP2C19 through the gut-liver axis. The results indicated that APS does not have a direct effect on hepatocytes. However, the assessment of gut microbiota function revealed that APS significantly increases the abundance of B. bifidum, which could lead to an anti-inflammatory response in the liver and indirectly enhance VRC metabolism. The dual-luciferase reporter gene assay revealed that APS can hinder the secretion of pro-inflammatory mediators and reduce the inhibitory effect on CYP2C19 transcription through the nuclear factor-κB signaling pathway. The study offers valuable insights into the mechanism by which APS alleviates VRC-induced liver damage, highlighting its immunomodulatory influence on hepatic tissues and its indirect regulatory control of VRC-metabolizing enzymes within hepatocytes.