Congress and the American public had agreed that incarcerating tens of thousands of Americans for nonviolent drug offenses is cruel and ineffective, and does nothing to stop drug use. Then fentanyl arrived.

Just like the crack cocaine epidemic that resulted in overly harsh penalties targeted at African Americans in the 1980s, fentanyl and other synthetic drugs are poised to be the next drugs that politicians use to justify long prison sentences for drug users.

This year, Sen. Lindsey Graham, R-S.C., introduced a bill that would expand mandatory minimum penalties for fentanyl. President Trump has proposed using the death penalty for those who sell fentanyl. And our very own Sen. Dianne Feinstein, D-Calif., is pushing a bill that would expand penalties on synthetic drugs similar to fentanyl and give U.S. Attorney General Jeff Sessions more power to prosecute people for drug offenses.

This is a clear reversal of Congress’ recent views on how drugs should be treated.

Just this year, Feinstein co-sponsored and voted for bipartisan legislation to reduce overly harsh federal sentences for drug offenses. In 2016, she also co-sponsored and voted for legislation that would treat drug use as a public health issue, reversing a long trend in Congress to deal with drugs through the lens of law enforcement and incarceration.

Feinstein’s votes acknowledged not only that draconian sentences are ineffective at reducing drug use — as has been shown through four decades of tough-on-crime laws — but also that these laws disproportionately targeted minority communities and directly contributed to mass incarceration, wasting billions of taxpayer dollars in the process.

But now she appears to have reversed course, spearheading a bill — Stop the Importation and Trafficking of Synthetic Analogues, or SITSA — that creates tough new penalties for people caught with synthetic drugs. Even more worrisome, Feinstein’s legislation would give Sessions the power to classify any drug as a synthetic opioid, circumventing any scientific or public health process almost entirely. This will only serve to support Sessions’ escalation of the drug war and reverse the gains made on drug policy under President Barack Obama.

Indeed, Feinstein’s position on drugs now seems more in line with President Trump, who has talked about getting “tough on the drug dealers” — neglecting to mention that this concept has been tried, resulting in mass incarceration and no discernible reduction in drug use.

To be clear, our country is in the midst of an overdose epidemic, and synthetic drugs are driving up the death count.

But only public health solutions — safe consumption spaces, expanded access to evidence-based treatment and drug checking (a service where members of the public submit drug samples to find out the actual content and purity of the substances) — will get us out of this crisis. I was a police officer in California on the front lines during previous drug epidemics — such as crack in the late 1980s and methamphetamine in the 1990s. I saw firsthand that harsh sentences did nothing to stop the flow of drugs and only decimated communities of color by ramping up our prison population.

We must learn the lessons of the war on drugs. Feinstein and others must not make the same mistakes of the 1980s and ’90s. They must embrace a forward-thinking approach on drug policy, one in which public health — not prison — has the central role.

Retired Lt. Diane Goldstein is a 21-year veteran of the Redondo Beach (Los Angeles County) Police Department and board chair of the Law Enforcement Action Partnership, a group of police, prosecutors, judges, and other criminal justice professionals who advance sensible criminal justice policy solutions. To comment, submit your letter to the editor at SFChronicle.com/letters.