PHOENIX — Judges cannot rely on caseworkers to make their own determinations when children are ready to be returned to their parents, the Arizona Supreme Court ruled Monday.

The justices rejected arguments by attorneys for the Department of Economic Security that the agency alone can determine the “best interests” of a child for reunification.

Justice Robert Brutinel, writing for the unanimous court, said that is the responsibility of the juvenile court and cannot be delegated to DES.

Monday’s ruling sets strict limits on the power of DES. The case involves four Pima County children who were taken into DES custody in 2012.

The agency determined the parents had abused methamphetamine, the family lived in a one-bedroom apartment with little food, the children did not have adequate clothing, two children were not enrolled in school, and two others had decaying teeth and were behind on their immunizations.

DES alleged abuse or neglect and a juvenile court ordered the children dependent. The following year, DES sought discretion to reunify the children with their parents when secure housing and in-home services were in place. But an attorney appointed for the children objected, arguing the court had to first conduct a hearing to determine whether reunification would create a substantial risk of harm.

The juvenile judge found that even though the parents had not remedied the problems, DES had the “discretion for transition and placement of the children with the parents.”

The judge said she had “confidence that the case manager who so diligently filed this case and ensured that the parents are completing their plans and monitoring all of the services that have been in place will continue to do that monitoring.”

And the judge found, prospectively, if the case continues and the parents continue to use the services provided “there will be no substantial risk of harm to the children.”

Attorneys for DES argued Arizona law does give it the power, on its own, to place a dependent child with a parent. Brutinel said that’s true. But he also said that’s reading only half the law.

The other half says placement cannot be done with a parent who is abusive or neglectful. He said the law cited by DES is applicable only when just one parent resulted in the dependency determination and the agency wants to place the child with the other parent.

In this case, Brutinel pointed out, both parents were the problem. Brutinel said Arizona law is very specific when it comes to the question of reuniting a child with a parent.

He said it requires a court, at a hearing, to “consider the health and safety of the child at its paramount concern.” And Brutinel said a court must also determine “the return of the child would not create a substantial risk of harm.”

“Clearly, a court cannot determine that return to the parents is in the child’s best interests if it has not, under the circumstances actually presented to it, considered the child’s health and safety and whether the child would be subject to a substantial risk of harm if returned,” Brutinel wrote.

He said that means the juvenile judge was required to independently consider the recommendations and proposed actions of DES to determine if reunification was in the children’s best interests.

Here, Brutinel wrote, the judge actually determined at the hearing that reunification, at least at that point, was not in the best interests of the children.

But what the judge did, he said, is make assumptions that housing would be secured and the parents would complete the necessary services. And that, he said, amounted to the juvenile judge impermissibly delegating her duties to DES.