one possibility is today's system - whoever owns the car (whether it's a private individual, a cab company, or the city) will pay for insurance, and that insurance will pay out to cover any damages.
Now, what happens if there's a bug in the software, causing a lot of damage at once? Can the insurance sue the programmers to recover losses? Probably; but at the least, the victims should be paid promptly by the insurance contract, without the need to wait for a court settlement.
Yeah, but if insurers have to assume that liability until they can maybe recover damages (just think, the car manufacturer or software firm might not even exist anymore and the car still on the road), insurance is going to be very expensive for these things. Insurance companies aren't a charity, they're going to have to pass on those losses into the premiums.
I think the only way it works is if the state certifies the vehicle and requires a liability policy that will pay for any incident.
If the systems are good, I think such policies will be cheaper than liability insurance for a bad driver. If the systems are bad, I wonder such a policy will be available at all.
The manufacturer would still be on the hook for defects found after the certification, and I expect defective vehicles with no remaining manufacturer will simply not be licensed for operation.
I think one of the main issues with liability here isn't the expected loss - I would be extremely surprised if driverless cars weren't much safer than ones with drivers, at least once the major kinks are worked out - it's the correlation between accidents. Currently, accidents happen more or less at random; when controlled by software, a bunch of cars might go berserk at once, bankrupting an insurance company in a fit of bad zeroes and ones.
Now, what happens if there's a bug in the software, causing a lot of damage at once? Can the insurance sue the programmers to recover losses? Probably; but at the least, the victims should be paid promptly by the insurance contract, without the need to wait for a court settlement.