Moutan cortex has demonstrated antitumor properties attributed to its bioactive compound Paeoniflorigenone (PA). Nevertheless, there is limited research on the efficacy of PA in the prevention and treatment of hepatocellular carcinoma (HCC). We aimed to investigate the potential pharmacological mechanisms of PA in the treatment of Aflatoxin B1 (AFB1)-induced hepatocarcinogenesis using network pharmacology and bioinformatics analysis approaches. Through various databases and bioinformatics analysis approaches, 34 shared targets were identified as potential candidate genes for PA in fighting liver cancer caused by AFB1. Pathway analysis revealed involvement in cell cycle, HIF-1, and Rap1 pathways. A risk assessment model was developed using LASSO regression, showing an association between the identified genes and the tumor immune microenvironment. The genes within the risk model were found to be linked to the immune response in liver cancer. Molecular docking studies indicated that PA interacts with its targets through hydrogen bonding and hydrophobic interactions. This study provides insights into the possible mechanisms of PA in liver cancer treatment and offers a predictive model for assessing the risk level of individuals with liver cancer. These findings have significant implications for the therapeutic strategies in managing liver cancer patients.