Testifying before a House subcommittee last year, the head of the Drug Enforcement Administration warned that marijuana legalization is bad for dogs. DEA Administrator Michele Leonhart was talking about pets that inadvertently eat cannabis-infused snacks. But she could have been referring to marijuana-detecting police dogs, which face an uncertain future in jurisdictions where a whiff of pot is no longer evidence of a crime.

As legalization takes effect in two more states this year, police and prosecutors in Oregon and Alaska are confronting the same canine conundrum that their counterparts in Colorado and Washington have been dealing with since 2012: What good is a dog trained to find marijuana when marijuana is legal?

Drug dogs typically are trained to detect marijuana and several other substances. When they smell one of those drugs, they are supposed to alert their handlers with a signal such as barking, scratching, or sitting down. But the dogs cannot indicate which drug they have smelled, let alone distinguish different quantities—a crucial issue in Colorado, Washington, Oregon, and Alaska, where adults 21 or older are allowed (or soon will be allowed) to possess up to an ounce of marijuana in public.

Until recently, those canine limitations did not matter, because any quantity of marijuana was unambiguously illegal throughout the country. But the ongoing collapse of marijuana prohibition is undermining the legal assumptions that have made drug-detecting dogs such a handy law enforcement tool, one that can be deployed at will to justify searches that would otherwise be unconstitutional.

According to the Supreme Court, letting a police dog sniff a suitcase or a car is not a search, so it does not require probable cause. At the same time, an alert by that dog provides probable cause for a search. Those conclusions, which have always been questionable because they are based on a grossly exaggerated sense of the average police dog's accuracy, look even shakier in light of marijuana legalization.

In the 1983 case U.S. v. Place, the Court concluded that a dog sniff does not qualify as a search under the Fourth Amendment because it "discloses only the presence or absence of narcotics" and "does not expose noncontraband items that otherwise would remain hidden from public view." But that is not true in states where an ounce or less of marijuana does not qualify as contraband. "If a drug dog can reveal non-criminal information about a person," writes University of South Carolina law professor Seth Stoughton in a 2014 Justia essay, "it may fundamentally change the Fourth Amendment character of police canine sniffs."

Even if cops in states where marijuana is legal can continue using the same old dogs without any evidence of wrongdoing, those dogs will be much less useful. A dog's alert to a car (assuming it is accurate) will now indicate anything from a perfectly legal half an ounce of weed in the glove compartment to a felonious kilo of heroin in the trunk. The former scenario will be much more common than the latter, since motorists will be much more likely to have marijuana than the other drugs that police dogs are trained to detect, especially now that people are allowed to possess it in public. If a search triggered by a dog's alert typically finds legal quantities of marijuana (when it finds anything at all), it is hard to see how that alert indicates "a fair probability" that evidence of a crime will be found, which is how probable cause is defined. "If a drug dog could be hitting on a legal substance," Stoughton writes, "courts could very well find that the alert itself does not establish probable cause."

Pam Loginsky, a lawyer with the Washington Association of Prosecuting Attorneys, anticipated this problem in a memo she wrote a month after voters approved I-502, that state's legalization initiative. "Officers will no longer be able to rely solely upon an alert by any of the narcotic canines currently on patrol," she advised prosecutors in December 2012. "If the suspect is under the age of 21 or the canine was not trained to detect marijuana, a positive alert by a trained and certified dog will be sufficient to establish probable cause for a search warrant. In all other cases, the officer will need to develop additional evidence to support a belief that: (1) the substance being detected is heroin, methamphetamine, cocaine or crack cocaine; (2) that marijuana is present in an amount greater than one ounce; and/or (3) that the suspect is manufacturing or distributing marijuana."

Under the Washington Supreme Court's interpretation of the state constitution's privacy clause, police generally need a warrant to search a car. By contrast, the U.S. Supreme Court has long held that the Fourth Amendment allows police to search cars without a warrant as long as they have probable cause, which is the rule that prevails in most states. But either way, police in states where marijuana is legal will face the problem identified by Loginsky: In situations involving adults, an alert by a conventionally trained dog is no longer specific enough to justify a search.

Cops who ignore this new reality do so at their peril, risking lawsuits and evidence suppression. If a vehicle search turns up half an ounce of pot and a kilo of heroin, there will be no way to tell which triggered the dog's alert, and the defense will argue that the heroin cannot be admitted as evidence because it was found illegally. The defense would have an even stronger argument if the search discovered stolen property or a murder weapon along with a small amount of marijuana.

In light of these difficulties, the Washington State Patrol and the Seattle Police Department decided to phase out the use of marijuana-trained dogs, gradually replacing them with animals that alert only to heroin, methamphetamine, crack, and cocaine powder. Police in some Oregon jurisdictions, including Clackamas County and Medford, also are moving away from marijuana-trained dogs.

Meanwhile, Seattle police are trying to retrain their older dogs so they no longer alert to marijuana, a tricky approach that may invite legal challenges to searches triggered by retrained animals. As the lieutenant who oversees K-9 units in Colorado Springs put it in a 2013 interview with Bloomberg News, "Once you put an odor on a dog, it's very difficult to get that odor off a dog." Lawrence Myers, a veterinarian and neurophysiologist at Auburn University who is an expert on dogs' olfactory capabilities, says "retraining is possible, but it takes time and scientifically valid testing to show that the dogs no longer alert to marijuana." He adds, "I doubt that many departments would do the testing."

The Tacoma Police Department is sticking with conventionally trained dogs, and so are police in several Colorado cities, including Denver, Aurora, Lakewood, Pueblo, and Colorado Springs. New dogs are expensive (about $15,000 each if fully trained, according to the Colorado Springs Gazette), and these departments say the old ones are still useful in certain situations, such as school searches, or in conjunction with other sources of evidence.

Some cops say they are waiting for guidance from state courts. "There are so many unanswered questions," the officer in charge of K-9 training at the Colorado Springs Police Department told Bloomberg News. "There have not been any test cases to say yes or no, we do not have the right to do this."

Other departments are being more proactive. The Gazette reports that Loveland, a city about 50 miles north of Denver, is phasing out its marijuana-detecting dogs based on advice from the Larimer County District Attorney's Office. "It basically goes back to the Fourth Amendment prohibition on illegal searches," a police spokesman told the paper. "We want to make sure we aren't infringing on people's rights."

This article originally appeared at Forbes.com.