Along the way to a world of driverless cars there are many potential roadblocks: infrastructure issues, different technical standards, restrictive state licensing policies, and more. But something more problematic might be the one most likely to derail this important technology: excessive lawsuits. To avoid the chilling effect that excessive litigation might have on this life-saving innovation, Congress may need to provide a certain amount of legal immunity for creators of driverless car technologies, or at least create an alternative legal compensation system for when things go wrong.

To understand why such legal protection may be needed, let’s remember what’s at stake in the debate over driverless cars and vehicle safety.

As more driver-assist features are built into our cars and then fully autonomous vehicles start hitting the roads, we can expect a major reduction in the staggering toll associated with vehicular crashes. That’s great news because, according to the National Highway Traffic Safety Administration, every day in the United States, approximately 90 people die and 6,400 are injured in automobile accidents. And 94 percent of all those accidents are caused by human error.

Just imagine if everyone who was drunk behind the wheel was in the backseat of a robot car instead. In 2014, 9,967 people were killed in alcohol-impaired driving crashes (28 per day), and there was an average of one alcohol-impaired driving fatality every 53 minutes. Motor vehicle crashes are also the leading cause of deathfor people age 16 through 24.

It doesn’t seem outlandish to predict that the majority of these tragedies could be avoided if autonomous systems took over the job of driving for us. In 2013, the Eno Center for Transportation forecasted that even at just a conservative 10-percent penetration rate, autonomous vehicles would help save more than 1,000 lives per year and result in comprehensive cost savings for society of almost $18 billion annually. But if we achieved 90 percent adoption, the group estimates almost 22,000 lives would be saved yearly, and society would garner a staggering $350 billion in cost savings.

Such a result would certainly constitute one of the greatest public health success stories of modern history. But that doesn’t mean that some accidents won’t still occur in a world full of driverless cars. When they do, who will be on the hook? The manufacturer of the car? The software designer who programmed it? The company that owned a fleet of them and ran an Uber-like service of robot cars on demand?

In one sense, this is not a difficult question to answer: Just leave it to the tort system. As new technologies emerge, product liability and accident compensation have been handled traditionally through a variety of legal mechanisms, including: strict liability, negligence, design-defects law, failure to warn, breach of warranty, and so on. In fact, that’s essentially what happened a century ago with the rise of the old-fashioned automobile.

Generally speaking, we should let these new liability norms evolve freely as intelligent-vehicle and driverless-car technologies become more ubiquitous. When crashes occur, courts can assign liability to those parties with the greatest knowledge and control over these systems, which will increasingly be the firms that manufacture or operate robotic cars. So, if the autonomous car maker of the future ends of up putting a fleet of defective robot cars on the road that they knew had serious programming issues, courts would force them to pay for any resulting damages. As a result, those driverless car makers will need to invest in better insurance policies to protect against that risk.

This shift in liability (and insurance) toward the makers of autonomous vehicles is even more likely in a world where auto ownership becomes less necessary. Traditionally, we’ve all owned or leased our vehicles and been in complete control of them at all times. But the car of the future is more likely to be an amalgam of Tesla, Uber, and Zipcar: a fleet of robot cars that are just sitting out there waiting for us to hail them for a ride. As cars become more of a service than a final good, liability will rapidly shift to the owner of the fleet of cars and away from end users.

But if all the liability falls on the manufacturer or fleet owners of driverless cars, there’s one big pitfall with this approach. America’s legal system lacks a “loser-pays” rule—i.e., the party who loses the case covers the other party’s legal fees—which means a perverse incentive exists to file potentially frivolous lawsuits at the first sign of any trouble. If enough lawsuits start flying, it could seriously undermine this potentially unprecedented public health success story.

That’s why it may be necessary to limit liability in some fashion to avoid the chilling effect that excessive litigation can have on life-enriching innovation. But we’ll still need to deal with the handful of accidents that happen.

One potential model to solve this problem can be found in the National Childhood Vaccine Injury Act of 1986. According to the U.S. Department of Health and Human Services, which administers the law, Congress passed the bill “after lawsuits against vaccine companies and health care providers threatened to cause vaccine shortages and reduce U.S. vaccination rates, which could have caused a resurgence of vaccine preventable diseases.”

Importantly, while the law shielded vaccine creators from punishing liability to ensure they would continue to produce life-saving drugs, it did not ignore the potential risks to a small subset of the population who might be injured by taking them. The law included a compensation fund (made up of money collected from a small excise tax on vaccines) for those children suffering some harm from vaccines. Thus, this reform combined a no-fault legal regime (for the creators of the life-saving technology) with a compensation fund (for the handful of victims of that technology) to strike a sensible public health balance.

This model might provide a solution to future litigation over driverless car technology. Initially, the tort system should be allowed to run its course because it may be the case that the gains are so enormous that frivolous lawsuits are not even a cost factor.

But if excessive litigation ensues over just a handful of incidents and begins discouraging more widespread adoption, Congress might need to consider an indemnification regime that ensures the technology is not discouraged but which also compensates the victims. Creating this system will have challenges of its own, but the life-saving benefits of driverless cars are well worth overcoming a few roadblocks.