The Google logo at the company’s headquarters in Mountain View, Calif. (Marcio Jose Sanchez/AP)

Palmer Luckey is the founder and chief technology officer of Anduril Industries and the founder of Oculus VR. Trae Stephens is Anduril Industries’ chairman and a partner at Founders Fund.

Chinese President Xi Jinping and Russian President Vladimir Putin are right: A global leader in artificial intelligence will emerge, achieving enormous international clout and the power to dictate the rules governing AI. As Americans working in the technology industry, we disagree with those leaders only about which country that should be.

The world is safer and more peaceful with strong U.S. leadership. That requires the U.S. government to maintain its advantage in critical technologies such as AI. But doing so will be difficult if Silicon Valley’s rising hostility toward working with Washington continues. In June, Google — acceding to a protest letter signed by about 4,000 employees — announced that it would not renew a Pentagon contract for an AI program called Project Maven when it expires next year.

Other Silicon Valley companies, such as Microsoft and Amazon , have recently faced internal and external criticism for providing tools that aid U.S. law enforcement or border control.

We understand that tech workers want to build things used to help, not harm. We feel the same way. But ostracizing the U.S. military could have the opposite effect of what these protesters intend: If tech companies want to promote peace, they should stand with, not against, the United States’ defense community.

Silicon Valley takes pride in advancing new ideas. But it should not dismiss some old ideas, including the one that says the United States is a force for good. The United States will never be perfect, but it remains a stable liberal democracy with strong institutions, the rule of law and protection of individual rights. Around the globe, authoritarianism is rising, democracy is under attack, and ever-more- complex security threats are emerging. Those of us specializing in advanced technologies such as AI, autonomous drones, and augmented and virtual reality can help ensure that the United States maintains superiority over increasingly aggressive challengers. Technological superiority was crucial to U.S. military success in World War II, kept the Soviet Union at bay during the Cold War and enabled the United States to deter untold armed conflicts over the past half-century.

The United States can no longer take this technology leadership for granted. Its adversaries worldwide are marshaling their tech capabilities, often compelling their best scientists to unify behind the goal of achieving preeminence. Putin in September 2017 said that AI leadership was a means to become “the ruler of the world.” China has vowed to achieve AI dominance by 2030. Moscow and Beijing are aggressively pursuing full-scale tech collaborations between the public and private sectors. Meanwhile, much of the top AI talent in the United States is working on things such as ad optimization. That might contribute to the U.S. economy, but it does nothing to protect against competitors who are using their best and brightest to bolster their militaries.

By all means, let’s debate the ethics surrounding any new technologies with military applications. In one of the knottier dilemmas involving AI and the use of force, we agree with many others that the decision to take a human life should not be made without human direction. But an essential part of ensuring that technologies are used ethically is ensuring that the terms are not dictated by authoritarian regimes. For the United States to set ethical norms and assert a moral high ground, it must first hold the technological high ground.

When U.S. tech companies — which have profoundly benefited from the liberties and protections of operating in the United States — shun working with their own government, they do not freeze the global race for defense technology. They simply make the path easier for the United States’ adversaries by default — or worse, by actively collaborating with countries such as China. Whether through action or inaction, companies choose sides.

Tech companies like to talk about making the world a better place. In the past, much of their success in doing so — such as the development of GPS and the Internet — was the result of collaborating with government. Helping ensure that the United States can continue to defend allies and deter aggressors is a powerful way to keep making the world a better place in the coming decades.