Attorney General Martha Coakley finds herself on both sides of a sensitive legal dispute over the state’s competitive auto insurance system.

As the state’s top lawyer, Coakley is defending the Patrick administration against a lawsuit that alleges some of the state’s auto insurance rules unfairly favor national companies new to the market, such as Geico and Progressive Insurance.

But as a representative of consumers on auto insurance issues, she has been critical of those same regulations. In a scathing report her office released just before Christmas, Coakley said the state’s so-called “managed competition” auto insurance system has not saved drivers money. She also accused the Patrick administration of “playing favorites” when it comes to setting insurance rules.

“Several new rules advantage certain carriers and disadvantage others,” Coakley said in her report, citing the same Patrick administration regulations she is defending in court. The lawsuit against the administration was filed by Arbella Mutual Insurance Co., a Quincy carrier that claims the rules put it at a disadvantage. Oral arguments in the case have already been heard, and a decision by the state Supreme Judicial Court is expected by the end of the month.

Coakley, who is in the final week of her campaign for US Senate, was not available for comment. A spokeswoman, Amie Breton, said the attorney general is required to assume several roles, including representing state agencies in court while also advocating for consumers. “Here, for example, we defended the Division of Insurance’s legal right to take certain policy actions, but that doesn’t necessarily mean that we agree with DOI’s policy choices. It just means that we recognized [the division’s] authority to make those choices,” Breton said in an emailed statement.

Doug Bailey, a spokesman for Arbella, said the insurance carrier welcomed the attorney general’s support. “On public policy, she appears to agree with our point of view,” Bailey said. “The legal issue, however, will be decided by the SJC.”

Peter Robertson, an attorney representing many of the insurance companies that favored the 2008 move from a highly regulated system to one where insurers are allowed to set rates, said Coakley shouldn’t have included issues in her report that are pending in court. He said Coakley argued in court that state officials acted reasonably in imposing the rules, but in her report accuses them of playing favorites. “Doesn’t that imply it’s not reasonable?” Robertson said. “I don’t think it’s appropriate.”

A Patrick administration spokesman declined comment on Coakley’s legal and public policy positions. “We respectfully disagree with the findings in the report in general,” said the spokesman, Jason Lefferts.  Nonnie S. Burnes, the former state insurance commissioner who championed the new auto insurance system, could not be reached for comment.

Coakley and her staff have long raised questions about the administration’s nearly two-year effort to give insurers more control over the rates they charge, but the objections have been fairly muted. Last month’s report, called Automobile Insurance: The Road Ahead, was much more pointed. It said auto insurance reform has been a disappointment for consumers, with average rates dropping 6 percent to 8 percent — well below the 10 percent to 11 percent reduction that would have occurred if the insurance commissioner had continued to set rates.

Coakley also said one-fifth of Massachusetts drivers, mostly minority and low-income residents, are paying more now than they were before deregulation.

Managed competition has attracted new companies to the state, including Geico and Progressive. To encourage them to do business here, Burnes approved regulations allowing them to avoid having to insure high-risk drivers for two years. She also gave other insurers some leeway on what they charge high-risk drivers. Both rules are being challenged by Arbella as unfair and beyond the commissioner’s authority.

Coakley, in her report, sided with Arbella, but included a footnote indicating she was defending the commissioner’s right to impose the rules. She said she plans to issue regulations to address many of the problems she identified, but it’s unclear whether that will happen if she wins a seat in the Senate.

Bruce Mohl oversees the production of content and edits reports, along with carrying out his own reporting with a particular focus on transportation, energy, and climate issues. He previously worked...