BackgroundCurrently, the development of breast cancer immunotherapy based on the PD-1/PD-L1 pathway is relatively slow, and the specific mechanism affecting the immunotherapy efficacy in breast cancer is still unclear.MethodsWeighted correlation network analysis (WGCNA) and the negative matrix factorization (NMF) were used to distinguish subtypes related to the PD-1/PD-L1 pathway in breast cancer. Then univariate Cox, least absolute shrinkage and selection operator (LASSO), and multivariate Cox regression were used to construct the prognostic signature. A nomogram was established based on the signature. The relationship between the signature geneIFNGand breast cancer tumor microenvironment was analyzed.ResultsFour PD-1/PD-L1 pathway-related subtypes were distinguished. A prognostic signature related to PD-1/PD-L1 pathway typing was constructed to evaluate breast cancer’s clinical characteristics and tumor microenvironment. The nomogram based on the RiskScore could be used to accurately predict breast cancer patients’ 1-year, 3-year, and 5-year survival probability. The expression ofIFNGwas positively correlated with CD8+ T cell infiltration in the breast cancer tumor microenvironment.ConclusionA prognostic signature is constructed based on the PD-1/PD-L1 pathway typing in breast cancer, which can guide the precise treatment of breast cancer. The signature geneIFNGis positively related to CD8+ T cell infiltration in breast cancer.Supplementary InformationThe online version contains supplementary material available at 10.1007/s12672-023-00669-4.