The Trump administration is allowing Wisconsin to become the first state to compel certain poor residents to disclose behavior such as drinking and exercise to qualify for Medicaid — and to charge more to people whose behavior the state judges as risky.

Federal health officials, however, rebuffed an unprecedented effort by Wisconsin to impose drug tests on Medicaid applicants. The rejection placed a limit on the flexibility the administration has been urging states to embrace for the vast safety-net health insurance system, though illicit drug use can be an item in a health-risks questionnaire.

The decisions were part of an announcement Wednesday that the Department of Health and Human Services’ Centers for Medicare and Medicaid Services has approved a plan that will make the Badger State the most recent with federal permission to compel people to work or prepare for jobs to receive Medicaid.

Four other states have won such permission this year, including Arkansas, which has cut off several thousand people from benefits for failing to meet its “community engagement” requirement. A federal judge has blocked the work requirement in Kentucky, the first state to attain permission last winter; Wisconsin becomes the administration’s first new approval since the court ruling early this summer.

“I recognize that there are people who disagree with this approach,” CMS Administrator Seema Verma wrote Wednesday in a lengthy statement accompanying the Wisconsin approval. “We will not retreat from this position,” she added, saying that compelling work can “help lift individuals out of the shadows of opportunity and into its light.”

Her agency’s decision in January to let states impose work requirements represented a profound shift in the public insurance program that began in the 1960s as part of the War on Poverty. The Obama administration had rejected several states’ requests to create such requirements.

Of the states that have been trying to use Medicaid as a laboratory for a conservative strain of individual responsibility, perhaps none has been as ambitious in its vision as Wisconsin. Its governor, Scott Walker, a Republican firebrand, has been pressing for changes in welfare cash assistance and food stamps, as well as BadgerCare, as Medicaid is known there.

Walker’s efforts to make drug screening part of BadgerCare’s eligibility requirements attracted national attention, and it has been an open question until now whether the Trump administration would allow any state to go that far.

In a letter Wednesday formally approving Wisconsin’s Medicaid “waiver,” CMS’s deputy Medicaid director indicated that even the Trump administration thought the Walker administration was overstepping. The letter noted that Wisconsin originally had asked for permission to require Medicaid applicants and current recipients to fill out a drug-screening assessment and, if warranted, a drug test.

“In response to concerns identified by CMS and [public] commenters” on the proposal, “Wisconsin revised its approach to include completion” of a health-risk assessment to be eligible for coverage, the letter said.

Walker’s office announced the federal approval of its revised plan Wednesday, less than a week before state residents vote in an election in which he is seeking a third term. Walker and his Democratic challenger, Wisconsin’s state schools superintendent, Tony Evers, appear tied in a Marquette Law School poll released Wednesday. The poll shows each with 47 percent support among likely voters.

Andy Slavitt, who ran CMS during the Obama administration’s final years and has become a vociferous critic of his successors’ health-care policies, said: “The idea of putting any hoops in front of people that discourages them from getting treatment is pretty much the opposite of every sound public health prescription I’ve seen . . . We should be removing barriers, not forcing an hourly worker to prove they got to work a certain number of hours or fill out a survey designed to be judgmental.”

Under the approved plan, Wisconsin’s health-risk assessment will be required of Medicaid applicants — and, within a year, current recipients — who are adults and do not have dependent children. According to the approval letter, the behaviors included on a risk questionnaire “include, but are not limited to, excessive alcohol consumption, failure to engage in dietary, exercise, and other lifestyle . . . behaviors in attempt to attain or maintain a healthy body weight, illicit drug use, failure to use a seat belt, and tobacco use.”

As an incentive to promote healthy living, those who give approved answers about their behavior will be charged less than an $8 monthly insurance premium that childless adults will have to pay if their income is more than half the federal poverty line. Those with more worrisome behavior will be charged the full amount.

Wisconsin’s work requirement will be somewhat less stringent than a few of the other states in who it affects and how long people can violate it before losing coverage. It will apply to childless adults ages 18 to 49, who will be required to spend at least 80 hours a month at a job, in school, in job training or doing volunteer work. They will become ineligible if they do not meet the requirement for 48 months.