Andreas Gal said that in November, officers with US Customs and Border Protection (CBP) detained him at San Francisco International Airport as he was returning home from a business trip in Europe.

Gal, Mozilla's former chief technology officer and a current Apple employee, told Business Insider that he believes he was singled out because of his vocal opposition to the Trump administration's privacy and immigration policies.

He said CBP agents demanded to go through his company-issued phone and laptop, and that they threatened him with federal charges when he asked to speak with a lawyer and with Apple.

A CBP spokesperson told Business Insider that searching travelers' electronics is within the agency's authority.

The American Civil Liberties Union has filed a complaint with the Office for Civil Rights and Civil Liberties of the US Department of Homeland Security on Gal’s behalf. They're seeking reform to this policy and action from Congress.

Visit Business Insider's homepage for more stories.

On Tuesday, the American Civil Liberties Union (ACLU) filed an official complaint on behalf of Andreas Gal — Mozilla's former chief technology officer and a current Apple employee — that alleged his constitutional rights had been violated when he was detained by US Customs and Border Protection (CBP) agents at San Francisco International Airport in November 2018.

Gal told Business Insider that he returned home from an international business trip and was detained shortly after his arrival in San Francisco. He said CBP agents demanded access to his Apple-issued mobile phone and laptop, and when he asked to consult with a lawyer and his employer, he was threatened with federal charges. Gal said the agents searched his belongings and confiscated his Global Entry card. He said that when he checked the next day, his Global Entry and TSA Precheck statuses had been revoked. You can read Gal's story in his own words here.

"These agents look like an occupying force. They are heavily armed and each one looks like they are geared up for war. They treat citizens with maximum suspicion, and we are completely helpless," Gal told Business Insider. "When I come back to the US I should not be fearful of the people greeting me."

Read more: Federal agents can search your phone at the US border — here's how to protect your personal information

The ACLU lodged a complaint with the Office for Civil Rights and Civil Liberties of the US Department of Homeland Security over Gal's story — a move the organization believes was warranted because of its concerns over why Gal was chosen and what it sees as an unlawful attempt to search and seize his devices, according to Bill Freeman, a senior staff attorney at the ACLU of Northern California.

In an emailed statement, a CBP spokesperson said that although the agency is unable to comment on specific cases, it's within its authority to search electronic devices.

"Searches of electronic devices at the border are often integral to a determination of an individual's intentions upon entry and provide additional information relevant to admissibility determinations under immigration laws," the CBP spokesperson said in part in the statement. You can read the full statement below.

For his part, Gal said that he's shaken by the notion that his phone could be subject to this kind of search.

"You know, this is my cellphone. It contains at least the last 10 years of my life, every photo, every email, every text. My entire life day-to-day is on my smartphone. To think they have the right to inspect the last 10 years of my life is terrifying," Gal said.

Gal said he now wipes every phone he travels with despite the inconvenience. He told Business Insider that he has lawyers on standby every time he has to go through customs, and they have instructions to act if they haven't heard anything from him within a certain span of time. Gal said he regrets that he finds this necessary.

Read more: US customs reportedly took away a man's life savings of $58,000 — even though he was never charged with a crime

"The government should not be treating citizens this way," Gal said.

Gal, who became a US citizen three years ago, said he wants CBP to explain why he was chosen for this process and that he wants Congress to hold the agency accountable for its actions. Gal’s theory, which is supported by Freeman, is that he was singled out at least partially because of his vocal opposition to the Trump administration’s privacy and immigration policies on social media. Gal said he now tries to be more conscious about what he posts online.

"It chills free speech," Freeman said. "People start to think 'if I say this' or 'if I take this controversial client' or 'if I take this controversial stance' and change their behavior. Does the government have a right to know what I'm saying? I don’t think so."

Freeman said the ACLU of Northern California has filed a Freedom of Information Act request for all documents relating to Gal to learn more about why he was flagged for additional CBP screening in November. If the government doesn't cooperate, Freeman said the ACLU is prepared to sue the agency to get the information.

"We need to shine a light on these practices because they are quite troubling, particularly in the case of someone who is an advocate of privacy and encryption rights is even more so," Freeman said.

Although Gal said he'd like his Global Entry status reinstated, he also hopes that his complaint will spur congressional or legal action to protect others from having a similar experience. He said he is prepared for a lengthy legal battle but that he hopes it leads to reform at the CBP. He said he wants to "fix it for everyone."

Apple was not immediately available for comment.

The full statement from Customs and Border Patrol:

"Searches of electronic devices at the border are often integral to a determination of an individual's intentions upon entry and provide additional information relevant to admissibility determinations under immigration laws. They are critical to the detection of evidence relating to terrorism and other national security matters, human and bulk cash smuggling, contraband, and child pornography. They can also reveal information about financial and commercial crimes, such as those relating to copyright, trademark and export control violations."