Andreas Gal, an American citizen of Hungarian descent, said though he had travelled widely, he had never experienced fear during his travels, as he did at San Francisco.
In a post on the Medium website, Gal said he had signed up for the Global Entry program, that allows people to bypass queues using an electronic kiosk, years ago due to his frequent travel.
"On this trip, the kiosk directed me to a Customs and Border Protection agent who kept my passport and sent me to secondary inspection," he said. "There I quickly found myself surrounded by three armed agents wearing bullet-proof vests.
Gal said the agents searched his luggage and demanded that he unlock his smartphone and laptop. He was reluctant to do so as both belong to his current employer, Apple, and contained unreleased software and proprietary information.
When he asked the agents whether he could speak to his employer or a lawyer before unlocking the devices, they told him he had no rights to do so, despite being an American citizen. And they added that failure to comply with their demand was a violation of the federal criminal code 18 USC 111.
"I wasn’t sure what the legal definition of an unreasonable search and seizure was, but three armed men detaining me, threatening me, and refusing to allow me to consult with an attorney definitely felt like one," Gal wrote.
He said he continued to insist that he wanted to speak to a lawyer and refused to answer any further questions. Finally, the agents let him go and let him take his devices as well. But they kept his Global Entry card as punishment.
"As I have learned since, my experience was not unique. While CBP has a long history of mistreating foreigners, immigrants, and asylum seekers entering the US, more recently CBP has also started to aggressively question, unlawfully detain, and in some cases physically assault US citizens crossing the border," Gal wrote.
"These so-called border searches are not random. NBC recently reported that CBP maintains dossiers of US citizens and targets lawyers, journalists, and activists, and monitors social media activity of US citizens. My past work on encryption and online privacy is well documented, and so is my disapproval of the Trump administration and my history of significant campaign contributions to Democratic candidates. I wonder whether these CBP programs led to me being targeted."