A civil liberties group has published a new guide for people concerned about Canadian border agents searching their electronic devices like smartphones, laptops and tablets.

Although there are unsettled legal questions about how these searches should work, 鈥渢he bottom line is that the CBSA can and does search electronic devices at the border鈥 without a warrant and sometimes randomly.

That means border agents could end up seeing private emails and text messages, photos, web browser histories and sensitive documents, even if you鈥檝e done nothing wrong.

Here鈥檚 a look at what border agents can and can鈥檛 do, and ways to fight back if you feel your privacy is being breached.

Do border agents need to have a reason to search my device?

No, unlike police they don鈥檛 need to suspect anything.

However, CBSA policy is that officers ought to only 鈥渢ake a quick look鈥 at each document before moving on to the next. For example, they should only look at documents or photos 鈥渇or long enough to determine that they do not contain contraband such as child pornography or hate literature.鈥

If the CBSA officer sees something that raises their suspicions, a more thorough search may be conducted, according to the BCCLA guide.

Can border agents demand my password or that I use my finger to unlock a phone?

This may or may not be legal under the Customs Act, which states that people are required to 鈥渙pen or unpack any package or container that the officer wishes to examine.鈥

The question has not been settled in court, but the CBSA has admitted they do it on a 鈥渃ase-by-case basis.鈥

The BCCLA points out that not handing over a password could create a variety of problems, including increased suspicion, denial of entry into Canada, seizing of the device and even arrest.

The BCCLA says you may politely ask, 鈥淒o I have to do what you are asking me to, or am I allowed to refuse?鈥 If the border agent insists, you might 鈥渃ommunicate clearly that you do not consent to the search and that you are complying under protest.鈥

Can border agents download photos, text messages or emails to the device?

No. 鈥淚f the CBSA wants to search information on the phone that is only accessible once it is connected to the cloud, they said, the agency must first obtain a warrant issued by a judge,鈥 according to the BCCLA.

The CBSA鈥檚 policy is that officers should set the device to airplane mode before searching to 鈥渞educe the possibility of triggering remote wiping software, inadvertently accessing the Internet or other data stored externally or changing number versions or dates.鈥

Officers are supposed to only read emails that have been downloaded and opened, and they鈥檙e supposed to assess this 鈥渂y seeing whether the emails have been marked as read.鈥 The BCCLA assumes this also applies to text messages.

Can border agents copy the contents of my phone or keep the phone for further inspection?

Yes, in some situations. 鈥淭he Customs Act gives the CBSA the power to detain goods if the officer is not satisfied that the goods have been properly screened for admission into Canada,鈥 according to the guide. 鈥淭his includes the contents of electronic devices.鈥

They may also make an exact copy.

They can also run 鈥減assword-cracking software to try and access any data you did not provide a password to access,鈥 according to the guide.

Is there anything I can do reduce the risk of border agents going through my device?

Yes. Meghan McDermott, counsel with the BCCLA, tells CTV News Channel that although 鈥渢he best protection of your privacy is to not bring anything private with you,鈥 not bringing a phone could raise the suspicion of border officials, leading to a time-consuming search.

Instead, she advises people to back up their devices on a hard drive at home or in the cloud, deleting anything sensitive from the device, and 鈥渢hen you arrive at the border with kind of a clean phone.鈥

It鈥檚 also a good idea to log out of programs and turn off the device so that agents will need to demand a password to get in. They may be too busy to bother waiting for you to turn on the device or enter passwords.

What can I do if there鈥檚 a problem?

The BCCLA recommends trying to record names and badge numbers of the officers involved, in case you want to file a complaint.

CBSA complaints can only be officially taken up with the CBSA itself, although their decisions can be appealed in federal court.

Other places to get help include human rights tribunals and civil liberties groups like the BCCLA.