America’s opioid epidemic is a grave public health issue, one that experts and a growing national consensus say we need to approach with solutions based in science and treatment. Unfortunately, some lawmakers haven’t gotten the memo and want to continue with the failed and inhumane strategies of the past: harsher penalties, overcriminalization, and the erosion of people’s rights.

The latest example comes from North Carolina. A new proposal ostensibly aimed at combatting the opioid crisis would give local law enforcement sweeping, unprecedented power to look through a person’s entire history of prescription drug use if they are under investigation for any drug crime, even possessing a tiny amount of any controlled substance.

Like in most states, in North Carolina people’s prescription records are stored in two places: at the pharmacy itself and in the state’s Controlled Substance Reporting System, a secure database that tracks controlled substance prescriptions in order to give doctors better information about their patients’ needs. State law currently imposes restrictions on law enforcement access to both of these sources in order to safeguard patients’ private medical information against unjustified search.

Sponsors of the North Carolina bill say unfettered access to the database will help law enforcement “in their efforts to investigate and prosecute individuals who obtain legal prescription medication by illegal means, as well as those who distribute illicit medication and illegal opioids.” But this bill, the first of its kind in the nation, is much broader in scope.

First, it erodes civil liberties by eliminating the requirement for law enforcement to obtain a court order before searching someone’s prescription records in the database, a crucial protection for our constitutional right against unreasonable searches and seizures. In fact, the ACLU has gone to court to argue that the Fourth Amendment requires police to get a search warrant based on probable cause before accessing prescription database records.

Second, it opens up a person’s entire history of prescription records at the pharmacy after a single drug charge. Arrested on suspicion of possessing a little marijuana? Under the North Carolina bill, law enforcement could look at your entire pharmaceutical history, without any warrant or court order. Do you use birth control? Take medication to treat depression or anxiety? Ever taken antibiotics to treat a sexually transmitted disease? North Carolina law enforcement would get to know all that and more.

Giving law enforcement officers the power to snoop around people’s medicine cabinets without any oversight will do little to combat the opioid epidemic. Rather, it would violate the rights of innocent people and further stigmatize people with substance abuse issues, making it harder for them to receive proper treatment. That’s why it’s been opposed by groups like the North Carolina Substance Use Disorder Federation and Addiction Professionals of North Carolina, which called the bill a “backwards culture shift away from treating substance use disorder as a disease and toward criminalizing illness.”

As currently devised, the state’s Controlled Substance Reporting System allows pharmacists and doctors to see what prescriptions a patient has already been given in order to prevent over-prescription. The program was envisioned as a way to identify individuals with substance use disorders and refer them to treatment. And law enforcement can already access that database with a court order.

Expanding law enforcement’s access to pharmacy records while eroding privacy protections, however, could open the entire system to abuse. We know this from experiences in other states.

In 1996, Utah began tracking controlled substance prescriptions in the Utah Controlled Substance Database. Although the program was intended to help prevent drug abuse, it was discovered in 2014 that a Utah detective used the database to access the prescription records of all 480 employees in Utah’s largest fire agency without judicial oversight and improperly charged at least two employees with crimes they did not commit based on misinterpretation of their prescription histories.

In response, Utah’s legislature amended the law in 2015, requiring law enforcement officers to obtain a probable cause warrant from a court before they can gain access to the database. Many other states now require a warrant or court order based on probable cause in order for law enforcement to access prescription drug information.

When devising strategies to address the opioid crisis, lawmakers should focus on public health solutions endorsed by the medical and treatment communities. Giving law enforcement officers more power to violate people’s rights and trample on our cherished civil liberties is never the answer.