Pandemics, cyberattacks and supply-chain disruptions are pushing the government to work more with outside groups.