Background Immune-related adverse events (irAEs), characterized by targeted inflammation, occur in up to 60% of patients with melanoma treated with immune checkpoint inhibitors (ICIs). Evidence proved that the baseline peripheral blood profiles of patients at risk for severe irAEs development paralleled clinical autoimmunity. Interleukin (IL)-23 blockade with risankizumab is recommended for cases that are suffering from autoimmune disease, such as autoimmune colitis. However, currently, the role of IL-23 in irAEs onset and severity remains poorly understood.Methods The pro-inflammatory cytokines most associated with severe irAEs onset were identified by retrospective analysis based on GSE186143 data set. To investigate the efficacy of prophylactic IL-23 blockade administration to prevent irAEs, refer to a previous study, we constructed two irAEs murine models, including dextran sulfate sodium salt (DSS)-induced colitis murine model and a combined-ICIs-induced irAEs murine model. To further explore the applicability of our findings, murine models with graft-versus-host disease were established, in which Rag2−/−Il2rg−/− mice were transferred with human peripheral blood mononuclear cells and received combined cytotoxic T-lymphocyte associated antigen 4 (CTLA-4) and programmed cell death protein-1 (PD-1) treatment. Human melanoma cells were xenografted into these mice concomitantly.Results Here we show that IL-23 was upregulated in the serum of patients suffering from irAEs after dual anti-CTLA-4 and anti-PD-1 treatment, and increased as a function of irAEs severity. Additionally, Augmented CD4+ Tems may preferentially underlie irAEs onset. Treating mice with anti-mouse IL-23 antibody concomitantly with combined CTLA-4 and PD-1 immunotherapy ameliorates colitis and, in addition, preserves antitumor efficacy. Moreover, in xenografted murine models with irAEs, prophylactic blockade of human IL-23 using clinically available IL-23 inhibitor (risankizumab) ameliorated colitis, hepatitis and lung inflammation, and moreover, immunotherapeutic control of tumors was retained. Finally, we also provided a novel machine learning-based computational framework based on two blood-based features—IL-23 and CD4+ Tems—that may have predictive potential for severe irAEs and ICIs response.Conclusions Our study not only provides clinically feasible strategies to dissociate efficacy and toxicity in the use of combined ICIs for cancer immunotherapy, but also develops a blood-based biomarker that makes it possible to achieve a straightforward and non-invasive, detection assay for early prediction of irAEs onset.