Abstract Background Although the classification system of triple-negative breast cancer(TNBC) has become more and more perfect, there is no report on the immune subtype of triple-negative breast cancer based on immune cell infiltration. Results According to immune infiltrating cells, data from 360 patients were divided into cluster A (subtype 1 and subtype 3) and cluster B (subtype 2; with poorly immune phenotype). Expression of memory B cells, naïve B cells, M0 macrophages, M1 macrophages, CD4 memory activated T cells, and CD4 naïve T cells were significantly higher in cluster A (P < 0.05). In contrast, the expression of M2 macrophages and resting mast cells were higher in cluster B (P < 0.05). GSVA results show that B cell receptor pathway and JAK-STAT pathway are activated and more frequently altered in cluster A (P < 0.05). mTOR pathway alterations usually appear in cluster B (P < 0.05). Compared with cluster A, the risk of recurrence in cluster B patients is significantly increased (P < 0.05). Conclusions This analysis of tumor microenvironment revealed the multifaceted nature of TNBC and its impact on patient prognosis, being recurrence more often in those with poorly immune phenotype. These results provide a reference for further exploration of the heterogeneity of TNBC.