In a profound win for digital privacy rights, the Supreme Court ruled Wednesday that police officers must obtain a warrant before searching your phone. If they don’t, the search is illegal—a violation of the U.S. Constitution’s Fourth Amendment.

“Modern cellphones are not just another technological convenience,” wrote Chief Justice John Roberts in the court’s decision. “With all they contain and all they may reveal, they hold for many Americans ‘the privacies of life.’ The fact that technology now allows an individual to carry such information in his hand does not make the information any less worthy of the protection for which the Founders fought.”

For police who feel they need to have access to a suspect’s device, Roberts had one simple instruction: “Get a warrant.”

In a perfect world, all 7.5 million sworn police officers in the U.S. would take the court’s decision to heart and hustle before a judge to get a warrant before they search anyone’s phone.

But let’s be realistic—this ruling reverses a five-decades-old interpretation of the law that allowed arresting officers to search suspects’ pockets, phones, and anything else within his or her reach. Not to mention that some cops don’t always play by the books. Just because the Supreme Court said police must now change the way they do their jobs doesn’t mean they will—or at least not immediately.

So, what is a law-abiding citizen like yourself supposed to do if an officer tries to snoop on your phone without a warrant? Here’s what.

Smartphone lockdown

The absolute best way to protect your phone from police inspection is to keep it locked with a passcode, which will keep an officer from rummaging through your Facebook photos as you stand beside him in handcuffs.

“The most simple precaution you can take is to make sure your phone is locked and/or encrypted,” says Jay Stanley, senior policy analyst for the American Civil Liberties Union (ACLU). “The police may take your phone, may try to look at it unconstitutionally, but they won’t be able to.”

Deny consent, respectfully

If you forgot to lock your phone (or just didn’t feel like it), the next step you must take is to “calmly and respectfully tell the officer that his search is in violation of the Constitution under the court’s Riley decision,” says Stanley. (Riley v. United States is the name of the court case that triggered this new search warrant rule.)

Stanley suggests that anyone who is arrested “repeatedly” state to the arresting officer and any nearby witnesses, “I do not consent to this search.” By saying this key phrase more than once, you help ensure that “there is no question or ambiguity about whether you’ve consented” to the search, Stanley adds.

Making your feelings known is vitally important in this situation. And if you leave any room for the officer to legally justify the search, then no warrant is necessary.

“Anytime there’s ambiguity,” says Stanley, “you end up in a court fight over whether you did or did not consent. If an officer says, ‘I’m going to search your phone now,’ and you don’t say anything, he’s going to argue that he implicitly thought you had consented.

“You don’t want to be in a situation where there’s any doubt.”

If you’re not under arrest, then definitely don’t consent

The Supreme Court’s ruling in Riley specifically addresses searches performed during an arrest. But even if you’re not under arrest—say, you just got pulled over for a blown tail light—then you have absolutely no obligation to consent to a search of your phone, your car, or your person. In fact, says Stanley, the police “are even less allowed to search the phone.”

“If they have evidence that you’ve done something,” says Stanley, “they can bring that evidence to a judge and get a warrant.”

Don’t get physical

If an officer decides to search your phone despite your clear expression that you do not consent, your best option is to let him do it, and leave whatever fight may come to the court room. And whatever happens, says Stanley, “do not physically resist an officer or attempt to physically stop the search.”

“You’re in an arrest situation—you have no power. And you’re just going to make the situation worse if you try anything like that,” he says. “You basically have to wait for the courts to ‘fix’ any injustices that have taken place.”

In addition to keeping your hands to yourself, says Hanni Fakhoury, staff attorney for the Electronic Frontier Foundation (EFF), you should “certainly take note of who the officers are that are conducting the search and then consult with a lawyer.”

There’s always a catch

Despite the strong privacy protections established in the court’s Riley decision, police still have the right to search your phone without a warrant in a few certain scenarios known as “exigent circumstances.” This includes, for example, the abduction of a child, when police suspect a person is in imminent harm, or “some imminent threat of evidence destruction,” says Fakhoury. “So its not like a carte blanche rule.” In those instances, there’s simply not much you can do.

Fortunately for us all, says Stanley, “those kinds of circumstances should be very rare.”

If you have further questions about your rights during encounters with police officers, both the ACLU and the EFF have created handy “Know Your Rights” pages (here and here, respectively) that dive into many of the main questions citizens have about what they can and cannot legally do when confronted by law enforcement.

Updated with the ACLU’s ‘Know Your Rights’ FAQs.

Photo via Robert Couse-Baker (CC BY 2.0)