People who form their ideas about the U.S. military based on Hollywood movies might get the impression that cutting-edge technology is standard in the fighting forces. In fact, the opposite is true. At nuclear sites around the country, technicians still use floppy disks. Only this summer is the U.S. Navy expected to upgrade from Windows XP, an operating system long since scrubbed from home computers. The new F-35 stealth fighter jet, touted as the most sophisticated in the world, was first conceived of in the 1990s.

So when the Defense Department announced last year that it wanted to partner with Silicon Valley to build a massive cloud storage unit where it could securely warehouse and categorize the secret data it collects from intelligence agencies and the military, some experts scoffed. Companies such as Amazon and Google are defined by an ethos of agility and innovation. The Pentagon, by contrast, is known to be clunky and risk averse. Just getting a contract through the department’s famously byzantine procurement process would require a kind of bureaucratic wrangling that a Jeff Bezos or a Tim Cook would find abhorrent.

It has also forced the Pentagon to confront a sobering truth: If it hopes to maintain U.S. military dominance, it must make such partnerships work.

Yet the Defense Department’s effort to advance the cloud project is making slow progress. The grueling process has revealed all the ways in which the two sides in the partnership are fundamentally incompatible. But it has also forced the Pentagon to confront a sobering truth: If it hopes to maintain U.S. military dominance, it must make such partnerships work. The imperative is bound up with the way technological innovation has shifted over the past few decades from government-funded labs around the country to commercial companies. It’s also tied to some broader changes in the world, including the rise of China as a great power.

The fact that the U.S. government pioneered many of the great technological breakthroughs of the 20th century has become common knowledge. The internet began decades ago as a computer networking project in the offices of the Advanced Research Projects Agency—essentially a Defense Department incubator. The satellite navigation systems that now feature on most smartphones were hatched in the same place.

But starting in the 1990s, as military budgets declined and investment in tech companies soared, the private sector gained a huge advantage in innovation. Most tech firms have focused on producing consumer goods. But some of the technology they’ve developed, if applied to the military, could transform the way war is waged.

U.S. Defense Secretary James Mattis, for one, appears to be well aware of this fact (though his service on the board of the failed tech company Theranos didn’t exactly burnish his credentials in Silicon Valley). The Pentagon’s latest National Defense Strategy identifies eight technologies the military wants to leverage for its own advantage, including advanced computing, big data analytics, artificial intelligence, and robotics. “Success does not go to the country that develops a new technology first but rather to the one that better integrates it and more swiftly adapts its way of fighting,” Mattis said when the strategy was unveiled in January.

What stood out about his list was the fact that the commercial sector is largely driving six of the eight technologies on it, according to Robert Work, who served as the deputy defense secretary until last year. Work was one of the Pentagon’s main proponents of partnerships with the commercial sector. More than most of his colleagues, he understood the challenges of bridging the culture gap between the two sides.

To try to do so, three years ago Work helped set up the Defense Innovation Unit Experimental, or DIUx, a kind of Pentagon outpost in Silicon Valley that was meant to serve as a liaison between the Defense Department and the tech world. (In August, DIUx shortened its name to DIU, on the grounds that it was no longer experimental.) Though it scored some successes early on—the Pentagon expanded the program to Boston and Austin—it has started to lose steam since the departure of its managing director, Raj Shah, this year. Still, Work believes that the Pentagon has already learned some valuable lessons from the experience.

Last year, when he was still in office, Work launched Project Maven, one of the Pentagon’s deepest forays to date into the high-tech realm. The program makes use of AI to analyze huge amounts of drone data—a painstaking process traditionally handled by humans. Project Maven aims to eventually replace and improve on much of that work, identifying threats, tracking enemy movements, and detecting anomalies that the human eye may overlook. “I remain convinced that we need to do much more, and move much faster, across DoD to take advantage of recent and future advances in these critical areas,” Work wrote in an April 2017 memo.

Project Maven is already operating in at least five secret locations in the Middle East and Africa. But it has hit some snags. This April, more than 3,000 employees at Google signed a letter protesting the company’s involvement in the project on the grounds that “Google should not be in the business of war.” The company responded by vowing not to renew the partnership when it expires next year. Still, the Pentagon’s investment in AI and Project Maven continues as other tech companies find these lucrative contracts hard to resist.

Building on Maven’s success would require the Defense Department to consolidate its data, including the information it gets from surveillance drones and from the military intelligence community, and label it in a machine-readable format. To that end, in July the Pentagon launched an enormous tender for a cloud storage contract, code-named JEDI (Joint Enterprise Defense Infrastructure). In both the Pentagon and Silicon Valley, JEDI’s success—or failure—is being watched as a test case for whether the two cultures can cooperate.

“The road to AI begins with a lot of banal, boring steps that sound like putting in a telephone system and archiving and databasing, but that is the work we have to do.”

Should it succeed, the program will offer significant advantages for both the government and the commercial sector. The contract is estimated to be worth $10 billion, making it a huge prize for even the biggest firms. The company that wins JEDI, a two-year contract with an option for more work thereafter, would also get a leg up in securing other Pentagon deals—including filling the department’s further needs for cloud storage. As for the Defense Department, the project would allow for faster and deeper analysis of its intelligence data. “The road to AI begins with a lot of banal, boring steps that sound like putting in a telephone system and archiving and databasing, but that is the work we have to do,” said Will Roper, the U.S. Air Force’s top acquisition official and formerly head of the Pentagon’s secretive Strategic Capabilities Office.

Critical as it is, the initiative has been bogged down by the Defense Department’s antiquated acquisition system. It took officials until late July to release the final request for proposals, and it’s not clear when the contract will be awarded. During a May 31 press conference, Pentagon spokeswoman Dana White declined to commit to a timeline. “We are working on it, but it’s important that we don’t rush toward failure,” she said. “We also want to take in all of the different stakeholders and consider how we move best forward.”

The Pentagon wants to avoid a situation where one or more of the bidders protests the results of the contracting process, which is one reason it’s moving carefully—and slowly. Most analysts assume that Amazon is the front-runner—in part because it is among the world’s largest cloud services providers and already works with the U.S. intelligence community on other projects. But a coalition of tech companies from Microsoft to Red Hat is reportedly coordinating efforts to keep the JEDI contract from going exclusively to Amazon. Google was considering making a bid as well, though the decision to pull out of Project Maven may complicate the issue. “Amazon sort of feels like the Lebron James of this field,” said Daniel Goure, the senior vice president of the Lexington Institute, a public policy think tank that focuses on security-related issues.

The tender process was supposed to be the easy part. Once the Pentagon chooses a contractor for JEDI, the winner will have to meet the government’s many regulatory requirements, particularly in the area of cybersecurity. Frank Kendall, the Pentagon’s top acquisition official until 2017, said the commercial world does not fully understand these obscure demands. “I would just urge a bit of caution,” he said. “I think people rushing headlong into embracing some of these commercial firms—they need to be a little more careful.”

As a cautionary example, Kendall pointed to the intelligence community’s effort to migrate to the commercial cloud. Since 2014, the CIA and the 16 other U.S. intelligence agencies have been working to shift top-secret and classified information onto Amazon’s cloud. Though some CIA officials tout the move as transformational, Kendall said implementation has been “slower than expected” due to cybersecurity concerns and the Pentagon’s stringent regulatory process.

To be sure, whenever the Pentagon contracts with outside companies, the process tends to be painstaking and time-consuming. The production of the F-35, Lockheed Martin’s latest fighter jet, underscores that point. Originally planned to be deployed starting in 2010, the stealth fighter suffered years of delays, cost overruns, and technical challenges. The Air Force only declared the aircraft ready for deployment in 2016.

Given the rapid technological advances being made by potential U.S. adversaries, particularly China, however, the U.S. military can’t afford similar delays in JEDI and other high-tech partnerships. Today, three of the world’s five most valuable tech start-ups are Chinese, and companies such as Baidu, Alibaba, Tencent, and Huawei are narrowing the research and development spending gap with their U.S. competitors, according to the Council on Foreign Relations. Unlike Washington, moreover, authoritarian powers have an easy time working with local tech firms: They simply tell them what to do. That’s one of the reasons that Eric Schmidt, the former chairman of Alphabet (Google’s parent company) and the chairman of the Defense Innovation Board, recently warned that China was poised to surpass the United States in the AI race by 2025.

“We are now in a big technological competition with great powers,” Work said. “We cannot assume that our technological superiority is a given. We are going to have to fight for it.”

This article originally appeared in the Fall 2018 issue of Foreign Policy magazine.