Atopic dermatitis (AD) is a chronic and recurrent inflammation disease associated with immune dysfunction. The high level of reactive oxygen species (ROS) causes high oxidative stress and further results in the deterioration of AD. At the same time, the ROS produced by bacterial infection can further aggravate AD. Here, the prepared PVA-based hydrogel (Gel) has a high ROS scavenging ability, and the antibacterial agent Zn-MOF(ZIF-8) loaded into the hydrogel shows a lasting and effective antibacterial activity. Thus, a Zn-MOF hydrogel (Gel@ZIF-8) is prepared to regulate ROS-mediated inflammatory microenvironment. In vitro experiments show that Gel@ZIF-8 has good antibacterial effect and cell biocompatibility. In the AD-induced mouse model, Gel@ZIF-8 can significantly enhance the therapeutic effect, such as reduce the thickness of epidermis, the number of mast cells and IgE antibodies. The results indicate that the ROS-scavenging hydrogel could treat the AD by regulating the inflammatory microenvironment, providing a promising treatment for managing AD.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12951-023-01924-0.