A poll released Tuesday by the John D. and Catherine T. MacArthur Foundation found widespread public support for rehabilitation efforts in local criminal justice systems — as opposed to an emphasis on prosecution and punishment. It’s just the latest survey to show that Americans are generally in favor of reforms like reducing sentences for nonviolent offenders that have received bipartisan backing from elected officials.

The emerging consensus may, in part, explain why in his State of the Union address last month, President Trump showed interest in rehabilitation, saying that “this year we will embark on reforming our prisons to help former inmates who have served their time get a second chance.” But that line stood in stark contrast to Trump’s past rhetoric and the administration’s tough-on-crime policy efforts.

The Trump administration has reduced support for prisoner halfway houses by cutting contracts with several facilities, which operate as re-entry centers for inmates nearing release to help them transition back into the community. This move raised concerns among some officials that the result would be more time behind bars for some inmates. Attorney General Jeff Sessions last year rescinded an Obama administration order that called for a reduction in the federal government’s use of private prisons, which were found to be less safe than government-run facilities. Sessions also called last year for federal prosecutors to pursue the toughest penalties possible for offenders, even for nonviolent drug offenses.

“There are a lot of disconnects and head-scratching going on,” said Adam Gelb, director of the public safety performance project at the Pew Charitable Trusts. Reducing resources while encouraging prosecutors to seek the harshest penalties in drug cases “is hard to square,” he said.

The survey released by the MacArthur Foundation, a private organization that supports grants in a variety of policy areas, was developed to measure knowledge of local criminal justice systems and perceptions of fairness in them. Respondents were found to mostly support rehabilitation efforts for people in early phases in the justice system, particularly for those with mental illnesses, and backed treatment over prosecution in response to the opioid crisis:

60 percent of respondents to the survey, which was conducted by RTI International and Zogby Analytics, said they believed the most important consideration when sentencing someone for a nonviolent crime was rehabilitation or treatment; only 23 percent said punishment.

35 percent of respondents — a plurality — said they felt that the main role of jails was to prevent crime by providing treatment or services to inmates so that they develop skills that will help them avoid criminal activity. The second-most-popular response (23 percent) was that the purpose of jail was to prevent crime by removing people who had been convicted of crimes from the community.

71 percent of respondents said rehabilitation or treatment is the most important consideration when sentencing someone who has been convicted of a nonviolent crime and has a mental illness.

A large majority — 84 percent — of respondents said local governments should devote resources to providing substance abuse treatment to drug users; 52 percent said more resources should be devoted to prosecuting and jailing users.

Outside of Washington, you can see the public’s preference being enacted in criminal justice reform efforts that have been undertaken by states over the past decade. Since 2007 to 2016, 33 states changed their sentencing and corrections policies through the Justice Reinvestment Initiative, a public-private partnership with the U.S. Justice Department’s Bureau of Justice Assistance, the Pew Charitable Trusts and several other organizations, according to a report from Pew. The policies are focused on improving public safety, reducing costs and promoting alternatives to incarceration for low-level offenders that reduce recidivism.

Sentencing reforms pursued by states include reducing criminal penalties for drug offenses (like simple possession of narcotics) and allowing offenders to shorten their time in prison by participating in substance abuse programs and job training. Also, more than a dozen states have improved their interventions for mental health and substance abuse treatment. A 2017 study by the Bureau of Justice Statistics that surveyed prisoners and jail inmates in 2011 and 2012 found that 26 percent of jail inmates and 14 percent of state and federal prisoners met the threshold for serious psychological distress.

There have been other signs that the Trump administration is interested in a less-hardline approach. Jared Kushner, who is the president’s son-in-law and one of his senior advisers, hosted a listening session on the issue with Trump last month. Leaders reportedly discussed job training and drug addiction treatment for inmates. But reports surfaced that Sessions attempted to block any discussion of sentencing reform.

The mixed messages coming out of the Trump administration reflect the somewhat contradictory political incentives. Pew, for example, found that a majority of both Democrats and Republicans were in favor of getting rid of mandatory-minimum sentences in federal cases. Majorities of Democrats and Republicans said there were too many people in prison for drug-related offenses. But, at the same time, Trump and Sessions may be thinking about their political base: Gallup found in 2016 that 65 percent of Republicans said the U.S. criminal justice system is “not tough enough.” That figure used to be higher, but it still represents the dominant strain in the GOP.

While states are continuing to press forward with criminal justice reforms, experts say the federal government can use its influence to encourage changes to the system that the public supports. “If we see the public is demanding a focus on rehabilitation, then there is a role the federal government can play to continue to incentivize state efforts that are already focused on both rehabilitation on the front end and re-entry side of reform,” said Fred Patrick, director of the center of sentencing and corrections at the Vera Institute of Justice.