On Friday, the Bloomberg administration urged a panel of state appellate court judges to allow it to remove homeless single adults from the shelter system if they do not comply with shelter rules.

Advocates for the homeless argue that this plan would harm homeless people with mental and physical illnesses, who are guaranteed shelter under state law. But the city says it has thought about that — now its staff psychiatrist is creating a system to make sure the mentally ill stay safe.

Since October, when the city appealed a three-year-old state court decision prohibiting the city from implementing sanctions, officials at the Department of Homeless Services have stressed the need to ban from the shelters for at least 30 days any client who endangers other shelter residents, whether for throwing punches or for smoking in a nonsmoking area.

“We want to ensure there is safe shelter for people who need it,” said DHS Commissioner Linda Gibbs after the court hearing, in which the city’s attorney Alan Krams argued that shelter is “not an entitlement” and is not a “perpetual right.”

The Bloomberg administration is looking to bring New York City into line with state regulations that require shelter residents to cooperate with a complete evaluation of their housing and public assistance needs; to work with social workers on a plan for moving to more permanent housing; to actively seek housing and not “unreasonably refuse” appropriate housing; and to refrain from endangering the safety and health of themselves and others.

If a client violates any of these requirements, says the regulation, the city can remove him or her from the shelter system until he or she corrects the violation, or for 30 days, whichever is longer.

Opponents of the city’s proposal claim it violates a consent decree that the Coalition for the Homeless and state and city officials agreed to in 1981 as part of Callahan v. Carey. The decree requires the city to provide shelter to any homeless person who applies for it as long as he or she is poor or suffers from physical, social or mental dysfunction.

“Taking away life-preserving shelter is too extreme,” Steve Banks, attorney for the Coalition, argued on Friday.

In 2000, State Supreme Court Judge Stanley Sklar agreed, ruling that sanctions proposed by the Giuliani administration would interfere with the right to shelter established in the consent decree. “The simple bureaucratic error which might send an individual out into the street because he or she was unable to understand or to cooperate with these requirements might be the error which results in that individual’s death by exposure, or death by sheer neglect,” he ruled. “The risk is simply too great to take.”

While Krams admitted on Friday that bureaucratic error is possible, he argued that the sanctions do not violate the consent decree, and assured the judges that the city will have a system in place to help prevent such mistakes.

For starters, Dr. Dova Marder, DHS’ medical director, will oversee the development of protocols to determine whether psychiatric or medical conditions should preclude a client from sanctions. Shelter workers, said Gibbs, will be “our first line of defense.”

And if the city decides to sanction a client, said a DHS spokesperson, he or she will first be seen by a trained medical professional, and will go through a state fair hearing while still living in the shelter.

Still, says Banks, all this is no guarantee that people who need shelter and are not in control of their actions will not be put out on the street. Figuring out whether a client has post-traumatic stress disorder, or is schizophrenic, or is simply unwilling to obey the rules — “that is hard to determine,” he said.

The panel of appellate judges is expected to rule on the case in about a month, but at least a couple of them seemed skeptical of Banks’ arguments. “There is a finite amount of resources,” Judge Alfred Lerner said to Banks. “Isn’t it irrational not to have a certain standard, subject to review, to reserve these resources for someone who needs them?”