When you’re entering the United States, federal agents have broad authority to search citizens and visitors alike – but a new lawsuit filed Wednesday is trying to change that.

The lawsuit, filed by the Electronic Frontier Foundation and the American Civil Liberties Union, seeks to prevent agents from flipping through your phone, computer, and any other electronic devices you have with you without getting a warrant first.

As the US Customs and Border Protection (CBP) outlines in a tearsheet it provides to people at the border, federal agents today can seize and search your phone, and even make a copy of it to have forensic experts analyze its contents off-site.

“This isn’t rogue officers; this is the official, written policy of the US government,” Adam Schwartz, senior staff attorney with the Electronic Frontier Foundation (EFF) said in a conference call on Wednesday.

The EFF and ACLU filed the lawsuit against the US Department of Homeland Security on behalf of 11 people who have had their phones and laptops searched at the border, in order to require the government get warrants before searching electronic devices.

Agents looked through just over 8,500 travelers’ devices in 2015, jumping to 19,000 in 2016, according to CBP data released in April. This year, agents have already searched nearly 15,000 devices – putting them on track to thumb through 30,000 by the end of 2017.

In 25 cases from 2016 NBC analyzed by talking to people who had their phones searched at the border and verifying the instances with experts, 23 of the victims were Muslim. Several of the plaintiffs in the ACLU lawsuit are Muslim or people of color.

How can they do that?

The Supreme Court decided in 1976 and 2004 that people have fewer claims to their Fourth Amendment privacy rights granted by the Constitution when entering the country, because the government has to protect its borders.

While the court has ruled that police can’t search peoples’ phones inside the country without a warrant because they contain troves of personal information, it hasn’t yet decided on a case about phone searches at the border.

“Searches of people at the border is an area where there’s a wide gap between what we think people’s rights are and what their facts are on the ground,” Nathan Freed Wessler, a staff attorney with the ACLU, told Business Insider in February. “Various courts haven’t had an opportunity to weigh in on these issues yet, so CBP is operating with a lot of claimed authority and a lot of latitude.”

Here’s what you need to know and what you can do to protect the personal information on your electronic devices at the border:

Can you refuse to give them your phone?

customs passport border airport

Foto: A CBP officer checks the passport of a nonresident visitor to the US at McCarran International Airport in Las Vegas in December 2011.sourceAP Photo/Julie Jacobson

Yes, but border agents can then make your life difficult.

Wessler said agents can detain you – courts are divided on how long is too long – take your phone and try to unlock it on site, and even take your phone and send to experts to unlock it.

They may also make copies of your devices to peruse later. The Department of Homeland Security says it will destroy that copy if the data’s not “necessary for law enforcement purposes.”

If you are a citizen or legal permanent resident, a green-card holder, they have to let you back into the country eventually. If you are not a citizen, border agents can refuse your entry to the US.

“People need to decide whether they’re willing to endure those inconveniences when they’re deciding whether to give their password,” Wessler said. “For noncitizens, visa holders, and others, people often need to consider whether there’s a risk they’ll be denied entry and turned away at the border for refusing to comply. We’ve received scattered results of that happening.”

Can you say you have confidential files on your phone?

Lawyers, medical professionals, and journalists can say they have privileged, confidential files, Wessler said, but there is no guarantee agents will recognize it as a deterrent.

CBP has recognized that lawyers, in particular, have attorney-client privilege and that agents have to get approval from an agency attorney before proceeding with the search – but they can still search the phone.

Should you ask for a lawyer?

immigration lawyer

Foto: source Reuters/Monica Almeida

If you decline to unlock your phone and agents give you a hard time, Wessler said you should feel “empowered” to ask for a lawyer, though you would have to pay for their services yourself. The government is not required to provide you with one for free if you ask.

If you anticipate running into issues at the border, Wessler said, it would help to carry a signed letter from your attorney saying they would represent you.

“US citizens and green-card holders have the right to request an attorney,” he said. “It’s not clear at all whether the government has been respecting those requests to the extent that it should.”

How common is it?

The 19,033 travelers who had their devices searched in 2016 were among 391 million travelers to the US that year. In 2015, 8,503 travelers had their devices searched, and through April 2017, 14,993 travelers had their devices searched.

From October 2008 to June 2010, by contrast, over 6,500 people had their electronic devices searched at the border, nearly half of whom were US citizens, according to government data provided to the ACLU through a Freedom of Information Act request.

Wessler said that while seizing phones at the border “is not a new problem,” the ACLU has seen an uptick in people saying their devices have been searched. DHS data show that the number of devices searched increased 124% from fiscal years 2015 to 2016, a trend that looks poised to continue this year.

customs cbp us border california mexico

Foto: The customs border crossing at Calexico, California. source Josh Denmark/DHS

What that data doesn’t reveal is the breakdown of people’s race, religion, nationality, why agents decided to search the devices, or if people’s information gleaned from the searches is being stored in government databases.

Diane Maye, a plaintiff in the ACLU lawsuit who is a former Air Force captain, was detained in a small interrogation room at the Miami airport after returning from Norway.

Border agents asked her to unlock her laptop and phone, searched her computer, then took her phone to another room for two hours, presumably to search it, as well.

“As I sat in the interrogation room, I felt humiliated and violated. I worried that border agents would read my email messages and texts, look at my banking information, and look through my photos. I feared they would download all of my personal information and contact lists and share it with other government agencies,” Maye said on the conference call on Wednesday.

“This was my life, and a border agent held it in the palm of his hand.”

How can you protect your data?

locked phone unlock pin code password

Foto: sourceShutterstock

First, Wessler says, travel only with the data that you need. That may mean using burner phones or laptops for traveling. After all, he said, “authorities can’t search what you don’t have.”

Second, use encryption services. The EFF and Wired both have exhaustive guides to keeping federal authorities – or hackers, for that matter – from accessing your data. Always choose long, strong, unique passwords for each device and account.

Third, turn your devices completely off before going through customs. This is when the encryption services are at their strongest.

These recommendations aren’t options for everyone, but adopting one or more of them can help you keep your data under wraps.

Will this change in the future?

customs us border airport search luggage

Foto: A US Customs and Border Patrol officer checks a passenger’s documents and luggage.sourceCBP

CBP maintains that searches are done to “protect the American people.”

“Electronic device searches are integral in some cases to determining an individual’s intentions upon entering the United States,” John Wagner, deputy executive assistant commissioner for CBP’s Office of Field Operations, said in an agency press release in April. “These searches, which affect fewer than one-hundredth of 1% of international travelers, have contributed to national security investigations, arrests for child pornography and evidence of human trafficking.”

The Ninth US Circuit Court of Appeals – covering Alaska, Arizona, California, Hawaii, Idaho, Montana, Nevada, Oregon, and Washington – has ruled that border agents must demonstrate a reasonable suspicion of criminal wrongdoing before doing a full forensic search of electronic devices, in which they download and analyze the full contents. However, they can do a cursory search, in which they thumb through the phone, without that suspicion.

The Supreme Court decided in Riley v. California in 2014 that searching cell phones without a warrant violated the Fourth Amendment’s right to privacy.

This new lawsuit filed Wednesday from the ACLU and EFF could clarify whether agents are allowed to conduct such searches. The attorneys on the case said they hope to force the government to get warrants before searching electronics at the border, and to delete any information it’s storing from devices searched this way.