Customs and Border Protection officers violated a citizen's rights when they demanded he turn over passwords to his electronic devices at the airport, the American Civil Liberties Union Foundation of Northern California said in a civil complaint filed Tuesday. (Daniel Acker/Bloomberg)

When Andreas Gal returned from a business trip in Sweden last fall, he was carrying two company-owned devices: an iPhone XS that flashed “Confidential and Proprietary” on its lock screen and a MacBook Pro bearing a sticker that read “PROPERTY OF APPLE. PROPRIETARY.”

The three U.S. Customs and Border Protection officers who stopped Gal at San Francisco International Airport ordered him to unlock the phone and hand it over, the software engineer said in a Medium post. Gal told them he couldn’t do anything without first consulting a lawyer or his employer, due to the nondisclosure agreement he had with Apple that specifically prohibited him from giving such access.

“This request seemed to aggravate the customs officers,” he wrote in the post titled, “No one should have to travel in fear,” published Tuesday. “They informed me that I had no right to speak to an attorney at the border despite being a U.S. citizen, and threatened me that failure to immediately comply with their demand is a violation of federal criminal code.”

The officers let him go about an hour later, but not before stripping him of the Global Entry card that gave him expedited travel privileges. They also gave him a handwritten note with a supervisor’s name and phone number, and instructed Gal to have his boss at Apple call in.

Gal told The Washington Post on Wednesday that he has crossed the U.S. border hundreds of times because of his work but has never encountered such extensive questioning or screening.

“This didn’t feel random to me,” he said.

Gal’s account has now sparked a civil rights complaint by the American Civil Liberties Union Foundation of Northern California. It also highlights what other travelers, lawmakers and privacy advocates have described as alarming and invasive government requests to search personal devices at border crossings and airports.

The ACLU Foundation alleges Gal was subjected to interrogation and retaliation by customs officers, according to the March 28 complaint filed with the U.S. Department of Homeland Security. The group is demanding an investigation into whether Customs and Border Protection agents violated Gal’s First and Fourth Amendment rights, and has called for a review of the agency’s border search policies.

“Digital devices contain huge amounts of personal data about our lives and our work,” said Jacob Snow, an attorney with the ACLU of Northern California “Border Patrol agents should not be able to access this data without a search warrant.”

In a statement issued Wednesday, Customs and Border Protection said, “All travelers arriving to the U.S. are subject to CBP inspection,” which may include computers, mobile phones, cameras and other devices. “Keeping America safe and enforcing our nation’s laws in an increasingly digital world depends on our ability to lawfully examine all materials entering the U.S.”

In 2018, the agency conducted 33,293 border searches involving electronic devices. That’s a more than 10 percent jump from 2017.

Privacy and civil liberty questions routinely come into play when law enforcement seeks access to electronic devices. In 2015, Apple famously refused to unlock an iPhone used by one of the shooters in the San Bernardino, Calif., terrorist attack. The Justice Department ultimately found its own way in and abandoned efforts to force the tech giant into compliance.

The debate gets trickier for people coming into or leaving the country. Anyone can be searched or detained at a border crossing, according to Customs and Border Protection. The agency’s guidelines state that travelers flagged for additional screening could be asked to turn over their unlocked device or give up their passcodes.

Sen. Ron Wyden (D-Ore.) has criticized such searches as overly intrusive. “Americans’ constitutional rights shouldn’t disappear at the border,” he said last year.

Gal, who works in the home products space at Apple, said he does not know why he was initially flagged for additional screening. He said Wednesday that he suspects the search was triggered by his previous work at Mozilla, where he advanced initiatives on privacy and encryption. He’s also recently voiced his opposition to the Trump administration’s immigration policies on social media.

According to the ACLU’s “Know Your Rights” Web page, it is illegal for law enforcement officers to perform searches and detentions based solely on a person’s religion, race or political beliefs. But officers at airports and the border generally have wide latitude to quiz people about their citizenship and itinerary and search their belongings. Law enforcement officers can’t deny citizens entry to the U.S. for refusing to provide the passwords to their devices, but declining to do so can lead to extended questioning and the seizure of the devices.

Gal said he is speaking out, in part, to find out why he was flagged and to try to compel the government to explain its conduct.

He said he is also concerned about the invasive nature of phone searches, which can pry open years of intimate information about an individual, and the potential chilling affect such searches may have for expressing political beliefs in public.