The COVID-19 pandemic highlighted the need for agile governance to effectively address and prevent future global crises. Scholars have examined China’s grid system and its application by local governments in controlling the spread of COVID-19. Our research supports these findings, and we further argue that the grid system enhances responsiveness, inclusiveness, and transparency in governance, thereby benefiting both the government and its citizens. Through a detailed case study of grid governance in the M District of Shanghai from July 2020 to August 2022, we explore the operational mechanisms of the grid system. By incorporating the safety valve theory, we propose that the community grid, the smallest administrative unit in China, functions as an institution to issue pre-emptive warnings, integrate communities, and alleviate pressures during times of crisis, contributing to governance agility. As grid governance has constantly been strengthened, this research not only advances our comprehension of the effectiveness of grassroots governance in China, but also offers valuable insights pertaining to crisis management in mega-cities worldwide.