The California assembly passed a law that forces the US federal government to ask for a warrant before scrutinizing aspects of people’s digital privacy, according to the ACLU.

California Electronic Privacy Act (CalECPA) says governments can’t access someone’s private data “such as emails, text messages and GPS coordinates “stored in the cloud and on smart phones, tablets, laptops and other digital devices unless they get their consent or, in special circumstances, obtain a warrant from a judge.

“While technology has advanced exponentially, California’s communications laws are stuck in the Dark Ages, leaving our personal emails, text messages, photos and smartphones increasingly vulnerable to warrantless searches,” said Democrat Senator Mark Leno, who co-authored the bill.

“CalECPA was carefully crafted to ensure that the personal information of Californians of all ages is adequately protected and our law enforcement has the tools they need to fight crime in the digital age. The bill strikes just the right balance to protect privacy, spur innovation and safeguard public safety,” he added.

The bill is supported by Silicon Valley’s major tech companies, including Google, Apple, Facebook and Twitter, which have received thousands of demands for consumer data in the past. If the state governor signs it into law, California will join other states such as Texas, Virginia, Maine and Utah that have already updated their privacy laws for the digital age.