When state lawmakers changed municipal and school finance laws in 2003 to allow the use of risky, complicated devices known as "swaps," many cities, counties and school districts dove right in to the practice. Unfortunately, many dove head-first into an empty pool.

Theoretically, the contracts between the governments and investment banks allow local governments to take advantage of low interest rates while hedging against higher interest rates on their conventional financing. Between the passage of the law and the collapse of the financial markets in 2008, local governments in Pennsylvania entered about $14.9 billion worth of "swap" contracts, according to the state auditor general's office.

The experiment has not been successful. Many governments initially made money on the contracts but ended up losing money. Auditor General Jack Wagner issued an audit of the Bethlehem School District in 2009 showing that its swaps had cost district taxpayers at least $10.2 million. An independent report early this year warned that Philadelphia and its school district have lost $331 million due to swaps and could be on the hook for $244 million more. And in Harrisburg, failed swaps are part of the financing for the city's failed $300 million waste incinerator project that, in turn, is a fundamental cause of the city government's financial collapse.

Mr. Wagner urged the Legislature to outlaw swaps in municipal financing in 2009, saying: "These toxic products are being peddled to well-meaning but relatively unsophisticated local officials every day throughout the commonwealth. The risk of huge losses is compounded by a lack of transparency in the deals and the failure of federal regulators to impose accountability on firms who created and marketed these products in the first place. These dangerous deals work in favor of the gambling houses and not the gamblers, and they must stop now."

Due largely to the capital city's demise since then, the Legislature finally might act. Sen. Mike Folmer, a Lebanon County Republican, plans to introduce a bill to ban them. And Sen. John Eichelberger, a Blair County Republican who chairs the Senate Local Government Committee, is working with Sen. John Blake of Lackawanna County, the ranking Democrat on the committee, to restrict what Mr. Blake calls "irresponsible debt."

The state government itself cannot say exactly how much bad local government debt, due to swaps, remains on the books. But it would be a good idea to stop digging this particular hole.