When he reflected on his time as a Navy SEAL serving in Afghanistan a decade ago, Brandon Tseng wondered why he and his team did not have any way to see inside buildings they were about to raid and reduce the chances of walking into a deadly trap.

He brought that question to his brother Ryan, a tech whiz who had invented a type of wireless cellphone charger when he was in college. After Brandon Tseng left the military, he joined with his brother to find ways to apply technology to national security challenges and quickly had what he remembers as his “aha” moment.

The rapidly emerging field of artificial intelligence, he believed, could be applied to fast-evolving hardware like drones to transform how they are used in war, like sending a tiny, self-piloted vehicle to do reconnaissance inside a structure that troops were about to enter. Even fighter jets could perhaps be turned into A.I.-controlled robot drones.

The company the Tseng brothers created in 2015, named Shield AI, is now valued by venture capital investors at $2.7 billion. The firm has 625 employees in Texas, California, Virginia and Abu Dhabi. And the Tsengs’ work is starting to show real-world results, with one of their early products having been deployed by the Israel Defense Forces in the immediate aftermath of the coordinated attacks last month by Hamas.

Israeli forces used a small Shield AI drone last month, the company said, to search for barricaded shooters and civilian victims in buildings that had been targeted by Hamas fighters. The drone, called the Nova 2, can autonomously conduct surveillance inside multistory buildings or even underground complexes without GPS or a human pilot.

Shield AI is one of a handful of start-ups demonstrating the potential of cutting-edge technology to revolutionize war-fighting tools and help the United States keep its military advantage over China.

The company and others like Anduril Industries, Autonodyne, EpiSci and Merlin Labs are developing new and more powerful ways for the Pentagon to gather and analyze information and act on it, including flying planes without pilots, creating swarms of autonomous surveillance and attack drones, and making targeting decisions faster than humans could.

Shield AI’s efforts to convince the Pentagon of the technology’s capabilities were on display one recent morning on the prairies of North Dakota as three of its larger military drones lifted off, buzzed across the sky and then were turned over to Shield AI’s artificial intelligence programming to decide on their own how to carry out the surveillance mission they had been assigned.

“HiveMind is operational,” said Brian Marchini, an aerospace engineer for Shield AI, referring to the company’s artificial intelligence program. “We have control,” he told the human pilots sitting in a tower above him, who until that point had been remotely directing the drones.

Shield AI’s business plan is to build an A.I. pilot system that can be loaded onto a variety of aerial platforms, from small drones like Nova 2 to fighter jets.

The drones flying over North Dakota demonstrated how far the technology has come. Their mission for the test was to search for ground fire nearby, a task not unlike monitoring troop movements. When the A.I. program kicked in, it created perfectly efficient flight patterns for the three vehicles, avoiding no-fly zones and collisions and wrapping up their work as fast as possible.

But Shield AI’s story also demonstrates the many hurdles that the new generation of military contractors face as they compete for Pentagon funding against the far bigger and more entrenched weapons makers that have been supplying the military for decades. And the growing role of artificial intelligence in national security is playing out against concerns about granting life-or-death decisions to software programs and at a time when governments are taking initial steps to regulate development of the technology.

Shield AI is still losing money, burning through what it has raised from investors as it plows the funding into research — it intends to invest $2 billion over the coming five years to build out its A.I. pilot system.

More fundamentally, the Tsengs and their team have so far won only a tiny sliver of funding from the Pentagon, at least by the standards of the multibillion-dollar contracts that go to the traditional arms makers like Lockheed, Boeing and Northrop Grumman. If solving the technological problems and building the systems they envision is the first challenge, cracking the byzantine and cutthroat government procurement culture is the second, one they have come to recognize requires lobbying and a deep understanding of how Washington works.

The task is all the more complicated because the Pentagon is moving slowly and cautiously — too cautiously, critics say — away from its focus on big weapons platforms like planes and ships to embrace smarter systems and the potential of artificial intelligence.

“Put simply, the Pentagon needs to accelerate — not slow — its adoption of responsible A.I.,” Michèle A. Flournoy, a deputy under secretary of defense in the Obama administration, said in a recent article in Foreign Affairs.

“If it doesn’t, Washington could lose the military superiority that underwrites the interests of the United States, the security of its allies and partners, and the rules-based international order,” said Ms. Flournoy, who has advised Shield AI.

Shield AI’s 125-pound V-Bat drone, lifting off vertically from the remote weapons testing center in North Dakota and filling the air with the smell of fuel, was loaded with software seeking to do far more than what an autopilot program could.

What distinguishes artificial intelligence from the programs that have for decades helped run everything from dishwashers to jetliners is that it is not following a script.

These systems ingest data collected by various sensors — from a plane’s velocity to the wind speed to types of potential threats — and then use their computer brains to carry out specific missions without continuous human direction.

“A brilliant autopilot still requires that you tell it where to go or what to do,” said Nathan Michael, Shield AI’s chief technology officer and a research professor at the Robotics Institute of Carnegie Mellon University. “What we are building is a system that can make decisions based on its observations in the world and based on the objectives that it is striving to achieve.”

The advances in the software first grabbed headlines in August 2020, when an early version being developed by a company since acquired by Shield AI had a breakthrough moment in an Air Force competition called AlphaDogfight. The company’s software defeated programs built by other vendors, including Lockheed Martin, the world’s largest military contractor, and then moved on to a virtual showdown with an Air Force pilot, call sign Banger, who had more than 2,000 hours experience flying an F-16.

“Human versus A.I. — fight’s on,” said Chris DeMay, a former test pilot who was helping supervise the Defense Department competition.

Again and again, the A.I. pilot quickly defeated the human-piloted jet, in part because the A.I.-guided plane was able to both maneuver more quickly and target its opponent accurately even when making extreme turns.

“The standard things we do as fighter pilots are not working,” the Air Force pilot said just before his virtual plane was destroyed for the fifth and final time.

To some, this was the military equivalent of when IBM’s Deep Blue computer defeated the grandmaster Garry Kasparov in a game of chess in 1997.

The Tseng brothers are part of a new breed of military contractors who combine a Silicon Valley start-up ethos with an eagerness to bring greater technological sophistication to national security challenges.

They grew up in the Seattle area and Florida in a household where their Taiwan-born father was an electrical engineer and small-business owner, a cross between scientist and entrepreneur that rubbed off on his sons.

Brandon Tseng, now 37, first began to wonder what kind of new tools he could try to build for the military while at a Navy SEAL training camp in Mississippi. He was practicing the kind of raid on a building that he would soon be carrying out in Afghanistan, except the enemy in this case was holding a paint gun. A slug of paint hit him in the face.

“You’re dead,” his instructor told him, leaving Mr. Tseng frustrated that he had no way of knowing the shot was coming. He felt similarly when his SEAL team was clearing buildings in Afghanistan without any sense of what threats might be inside.

Ryan Tseng, now 39, made a name for himself as an undergraduate at the University of Florida when he came up with a lower-cost, more compact way to use wireless charging pads to power cellphones, an idea he ultimately patented and sold to Qualcomm, the wireless technology giant. They have a third brother, Nick Tseng, 34, also an electrical engineer, who works at the company.

The software that Shield AI is developing for small drones like the Nova 2 that was used in Israel could be loaded onto a robot fighter jet drone that would fly out in front of a human-piloted F-35, looking for missile threats or enemy planes, taking on the risks before the human pilot gets into harm’s way. But turning these ideas into a reality is a matter of clearing daily challenges.

When Shield AI sent three of its drones on an early test run, they ran into trouble: The drones were sending too much data back and forth. “We were bludgeoning the available bandwidth,” explained Mr. Marchini, the Shield AI aerospace engineer, resulting in adjustments to fix the problem.

The Nova 2 also at times had issues operating indoors, running into shower curtains. It turned out that its propeller was making the curtains move, confusing the device.

The challenges of developing a system that can carry out a mission on its own and make decisions about when to unleash lethal weapons are complex enough that some of Shield AI’s competitors are aiming for more incremental progress, such as better autopilot tools.

Merlin Labs is focusing on a system that can fly one of the Pentagon’s giant transport planes or refueling tankers, first with just one pilot instead of two and eventually entirely on its own.

Another competitor, Anduril, is building a software system to integrate all of the data that will flood into the Air Force from drone and satellite sources to help human pilots find and strike targets. It is also building a new generation of robot drones that can fly on their own.

“What we are talking about is not just building a pilot,” said Christian Brose, the chief strategy officer at Anduril. “It is building a weapons system. And the weapons system encompasses piloting.”

None of the competitive or technological hurdles facing Shield AI will matter much if the company cannot solve an even more pressing problem: bringing in some substantial revenue.

Its revenues have grown from $23 million in 2019 to $102 million last year, according to company documents obtained by The New York Times. That is a big jump, in a way, but the total is still tiny for a company with more than 600 employees.

The company lost about $100 million between 2019 and 2021, internal data shows, and it expects to lose another $70 million this year. Its biggest source of revenue now is the V-Bat, its vertical takeoff drone that operates in most of its current Marine Corps deployments without artificial intelligence. The company has told investors that its goal is to generate nearly $750 million in annual sales and $100 million in profit by 2026.

Shield AI has raised about $770 million in venture capital, but subsists largely on money given out by research divisions at the Pentagon and the one long-term military contract, which it secured by buying an even smaller drone maker that already had secured the deal.

It just raised another $200 million in venture capital, including from a fund led by Thomas Tull, a onetime Hollywood producer of films like “Inception” and “Superman Returns” who is now investing in military start-ups.

One recent afternoon, in a conference room in the company’s offices in Crystal City, Va., Brandon Tseng was huddled with his growing team of lobbyists. They were about to head to Capitol Hill to try, once again, to round up support among lawmakers to squeeze the Pentagon to start buying A.I. pilot tools, including perhaps the company’s products, in larger numbers.

In 2021, Shield AI hired Chip Burkhalter, a former State Department official, to create Shield AI’s first in-house lobbying team. Along with a team of outside consultants, the company is now burning more than $1 million a year lobbying the Pentagon, Congress and the administration.

Its agenda includes adding around $30 million to the Pentagon budget that could be used to help fund contracts that Shield AI could tap into, or at least to promote creation of a new Pentagon office that would help push progress on building autonomous systems.

But progress still was slow. Mr. Burkhalter told Brandon Tseng during their government affairs update meeting — a reporter from The Times was allowed to sit in the room and listen — that he had been unable to secure support this year to set up the new Pentagon unit they hope will be called the “Joint Autonomy Office,” meaning a decision on it will be pushed until at least 2025.

“Are these going to be the exact same problems in 2026?” Mr. Tseng asked his team.

“Yes, I think so,” Mr. Burkhalter responded.

The lobbying team is still making trips to Capitol Hill, looking for ways to shake some funding loose. “OK guys — go reform the acquisition system,” Mr. Tseng joked with his in-house lobbying team as they prepared to get into an Uber for the ride over to Capitol Hill.

Pentagon officials said the A.I. software being developed by companies like Shield AI is at the heart of their plan to build a new force of more than 1,000 robot drones that can act as wingmen to human-controlled fighter jets.

But Frank Kendall, the Air Force secretary, said the problem, in part, is that Congress has been slow to approve his spending plans, including

$5.8 billion over the next five years to build the fleet of robot fighter jets. “I’ve got a long list of things I want to buy and I can’t buy right now,” he said in an interview.

So at least for now, Shield AI’s search for meaningful revenue continues.

“Shield has a really great software technology. This is their key asset,” said one of the company’s lead investors, Peter Levine of the venture capital firm Andreesen Horowitz. “But look, it’s never a done deal. I deal with start-ups all the time. There’s a lot of complexity and a lot of hurdles that start-ups face.”