The impetus for the effort came largely from Mr. Smith, who has been arguing for several years that the world needs a “digital Geneva Convention” that sets norms of behavior for cyberspace just as the Geneva Conventions set rules for the conduct of war in the physical world. Although there was some progress in setting basic norms of behavior in cyberspace through a United Nations-organized group of experts several years ago, the movement has since faltered.

Mr. Smith said over the weekend that the first move needed to come from the American companies that often find themselves acting as the “first responders” when cyberattacks hit their customers. “This has become a much bigger problem, and I think what we have learned in the past few years is that we need to work together in much bigger ways,” Mr. Smith said in an interview. “We need to approach this in a principled way, and if we expect to get governments to do that, we have to start with some principles ourselves.”

Microsoft played a central role in trying to extinguish the WannaCry attack last year that struck the British health care system and companies around the world. The Trump administration, along with several other Western governments, later blamed that attack on North Korea. Last summer the NotPetya attack struck Ukraine, crippling systems throughout the country. Iran is suspected in a recent attack on a Saudi petrochemical plant.

Yet not all governments are likely to embrace the “Cybersecurity Tech Accord” in part because the principles it espouses can run headlong into their own, usually secret efforts to develop cyberweapons.

When Russia’s intelligence agencies obtained some of the National Security Agency’s secrets about its own cyberweapons, it appeared to do so by manipulating a virus protection program sold by Kaspersky, a Russian firm. The company said it knew nothing about the intrusion into its products, but American officials do not believe the denials and have banned Kaspersky products from United States government systems. Kaspersky is not a signer to the new accord.