The misdiagnosis of tumors due to insufficient penetration depth or signal interference and damage to normal tissues due to indiscriminate treatment are the biggest challenges in using photothermal agents for clinical translation. To overcome these limitations, a strategy of switching from the near-infrared (NIR)-I region to the NIR-II region was developed based on tumor microenvironment (TME)-mediated gold (Au) self-assembly. Using zeolitic imidazolate framework-8 (ZIF-8) metal-organic framework-coated gold nanorods (AuNRs@ZIF-8) as a model photothermal agent, we demonstrated that only a NIR-I photoacoustic imaging signal was observed in normal tissue because ZIF-8 could prevent the aggregation of AuNRs. However, when ZIF-8 dissociated in the TME, the AuNRs aggregated to activate NIR-II photoacoustic imaging and attenuate the NIR-I signal, thereby allowing an accurate diagnosis of tumors based on signal transformation. Notably, TME-activated NIR-II photothermal therapy could also inhibit tumor growth. Therefore, this TME-activated NIR-I-to-NIR-II switching strategy could improve the accuracy of deep-tumor diagnoses and avoid the injury caused by undifferentiated treatment. STATEMENT OF SIGNIFICANCE: Photothermal agents used for photoacoustic imaging and photothermal therapy have garnered great attention for tumor theranostics. However, always “turned on” near-infrared (NIR)-I laser (700-1000 nm)-responsive photothermal agents face issues of penetration depth and damage to normal tissues. In contrast, tumor microenvironment-activated NIR-II “smart” photothermal agents exhibit deeper penetration depth and tumor selectivity. Therefore, a NIR-I-to-NIR-II switching strategy was developed based on tumor microenvironment-mediated Au self-assembly. This work provides a new strategy for developing tumor microenvironment-activated NIR-II smart photothermal agents.