MOUNTAIN VIEW — Google (GOOG) co-founder Sergey Brin and Gov. Jerry Brown carpooled to work Tuesday in a white Toyota Prius, but no one was driving.

One day, in the not-so-distant future, you can join them.

Brown hitched a futuristic ride to Google’s Mountain View headquarters to sign landmark legislation that will allow self-driving cars to hit California streets by 2015.

The governor had a look of utter amazement as he walked out of Google’s “autonomous” Prius after a test-drive with Brin, who is so used to the robot car that he’s tired of driving regular ones.

How’d it go?

“Great,” the governor said. “Only way to go, guys.”

Supporters hailed it as the day science fiction starts to become reality, though it will be at least a few years before the first driverless cars reach the market. Backers envision a time when chains of robot cars will travel closely together and never make mistakes, thereby eliminating traffic and accidents.

“I expect that self-driving cars are going to be far safer than human-driven cars,” Brin said to an audience of reporters and Google workers, who gave their boss the biggest roar of applause when he said: “Self-driving cars do not run red lights.”

The search giant pushed the driverless car bill, overwhelmingly approved by the Legislature last month, as major automakers such as Ford, Audi and BMW and researchers at places such as Stanford work on developing the cars for consumers.

Though the idea of robot cars has been around so long that Caltrans leaders called them “inevitable” in the 1980s, the technology is so new that it’s never mentioned in the California vehicle code. The new law, which follows similar legislation enacted in Nevada and Florida, charges the Department of Motor Vehicles with drafting regulations for self-driving vehicles.

The process will have two parts under the bill, SB1298. First, automakers will have to get their driverless cars approved by the DMV. Second, drivers will need to obtain a separate operating permit and sit behind the wheel of the car in case its computer crashes and a human needs to take control.

Google’s autonomous Priuses, which have logged more than 300,000 test miles, also stop and require human operation in situations like construction zones that are hard for computers to navigate — much to Brin’s chagrin.

“I really quickly got really sick of that,” Brin said. He’d tell the car, “No, you drive!”

Beyond the technical challenge of teaching a computer to navigate a system of roads that can frustrate even the most seasoned drivers, there are many other concerns that still need to be worked out.

Auto manufacturers opposed the bill because of confusion over who would be legally liable if someone alters a car after it’s sold to make it autonomous — and it then gets into a crash.

And some consumer groups charge that Google and other companies are really just interested in using the onboard computers to track people’s movements like they do on the Web.

“There is all kinds of potentially sensitive information that would be gathered from a person using the vehicle, and there is no assurance that it won’t be used for other purposes, like setting insurance rates or advertising,” said John Simpson, privacy project director at Consumer Watchdog, a nonprofit based in Santa Monica.

Brin called building the cars “very hard and fascinating,” while Brown cited his refrain that California should lead the way in innovation.

“These self-driving cars,” Brown said, “are another step forward in the long march of California pioneering the future.”

SB1298 was the most high-profile of the 48 bills Brown signed Tuesday. He also vetoed eight bills, ahead of Sunday’s weekend deadline to sign or veto bills passed at the end of the legislative session in August.

Contact Mike Rosenberg at 408-920-5705. Follow him at twitter.com/rosenberg17.