As airports fell into chaos in the wake of Donald Trump’s executive order this weekend, border agents confronted targeted travelers with an unusual request: access to their social media accounts. In Houston, an immigration lawyer named Mana Yegani reported Border Patrol agents checking new arrival’s Facebook pages, alongside questions about political views and associations.

Four federal courts have now issued stays on the order, and the fight over its legality continues — but there’s reason to think scrutiny of arrivals’ Facebook and Twitter accounts will only intensify. On Sunday, multiple outlets reported that the Trump administration was discussing a requirement for all foreign visitors to share their social media and web activity with customs officials, or be denied entry if they refuse.

It’s an alarming proposal, but not unprecedented. Border agents have been seeking access to social media accounts since long before Trump’s executive order, taking advantage of the agency’s strong authority for border searches. There’s still no proven legal mechanism for compelling a person to unlock their phone — customs agents face the same problems as local police — but powerful authority for physical search and detention means travelers can often be intimidated into unlocking devices and handing over account names simply to avoid trouble. Friday’s executive order, which saw many legal US residents deported at the discretion of border agents, has only made that intimidation more powerful.

The most recent push for social media collection came after the San Bernardino shootings. Many outlets reported that the attackers had posted public calls for violence on Facebook. The reports weren’t true, but they fueled public support for collecting account names at the border. In June, Customs and Border Patrol proposed an optional field for social media account names to the visa waiver form, typically handed to travelers on arrival in the country. The new field appeared on travelers’ forms last month.

While the formal field is explicitly optional, border agents have sometimes been aggressive about collecting that data informally. Just days before the executive order arrived, the Center for American-Islamic Relations (CAIR) filed 10 legal complaints over aggressive interrogations by Customs and Border Patrol agents, including demands that travelers unlock phones and provide social media account names. According to the complaint, border agents specifically asked for Facebook, Twitter, and Instagram accounts, alongside questions about political opinions and religious practices.

According to Hassan Shibly, director of CAIR’s Florida branch, those questions are a long-standing reality for muslim citizens at the border. “For American muslims, it’s been happening,” says Shibly. “They’re being held for hours, they’re being asked straightforwardly, what is your social media account?”

If travelers refuse to comply, agents sometimes responded with physical assault. One complaint details an incident involving Shibly’s brother, a US citizen returning from Canada to his home in Buffalo. When he declined to unlock his phone at the border, Shibly says a border agent grabbed him by the neck from behind, while another pinned his legs, and a third reached into his pocket to retrieve his phone.

It’s unclear how far border agents’ authority reaches in such situations. Customs agents have broad authority for physical search and fingerprinting, even without specific suspicion for a given traveler. That authority even extends to confiscating devices to copy their data, although those measures are rarely taken.

But while courts have generally favored Customs’ authority over locally stored data as it crosses the border, it’s unclear how that power applies to social media accounts, which are held in the cloud and aren’t meaningfully stored on a traveler’s person. The same is true for unlocking a phone, which requires active participation from the subject. At the same time, Customs has broad authority to deny entry to non-citizens without a standing visa, so many visitors will comply rather than risk being stopped.

For citizens, the greater risk is simply not knowing their rights. “My advice to everyone is that, if you’re an American citizen, you need to remember that you must be allowed entrance to the country,” says Shibly. “Absolutely don’t unlock the phone, don’t provide social media accounts, and don’t answer questions about your political or religious beliefs. It’s not helpful and it’s not legal.”

Donald Trump's executive order, explained