Rapamycin preserves cardiac function in autoimmune myocarditis by reprogramming Cxcl9+ macrophages via the mTORC1–C/EBPβ–OSM axis. Here, CEBPB is linked to autoimmune myocarditis.