The UK's energy regulator has announced plans to better protect customers who pay their bills through direct debit.
Ofgem accused some firms of using customers' accumulated credit like an "interest-free company credit card".
Proposals include tightening the rules on the level of direct debits that suppliers can charge to "ensure credit balances do not become excessive".
Ofgem also wants to protect credit balances when suppliers fail so the costs are not picked up by customers.
It come after a string of high profile closures linked to high wholesale oil and gas costs, made worse by the war in Ukraine.
Around 30 energy companies have stopped trading in the UK since August last year, including Bulb which had 1.7 million customers.
Ofgem said it wanted to "prevent the kind of energy supplier failures we saw last year and to better protect consumers' money if they do fail."
Ofgem added that the closures "put unfair and unnecessary costs and worry onto consumers", as thousands scrambled to find out who would fill the gap left by their supplier.
Improving the financial health of energy suppliers over autumn and winter would help reduce the risk of failures, Ofgem added.
The cost of moving customers to new suppliers since September 2021, including buying extra gas at short notice while prices were at record highs, as well as replacing lost customer credit balances and green levy payments, was £94 per household, according to the regulator.
Under current rules the new supplier does not get customer credit balances from the failed supplier, so the costs of replacing these balances are shared across all customer bills.
The new plans, which still need to be finalised through a consultation, would mean energy companies must protect their customers' money if they go bust and pass on the funds from accounts which are in credit to the replacement supplier.
Ofgem said it hoped the measures stopped "risky behaviour" from energy firms.
Jonathan Brearley, chief executive of Ofgem, said: "Today's proposals will make sure that customers' hard-earned money is properly protected so that a company must foot the bill if it fails, rather than consumers picking up the tab."
He told the BBC that "without a doubt" some companies were using credit balances in ways they should not have last winter.
"We want to tighten those rules to make sure that's not happening," he added.
Millions of domestic gas and electricity customers cover their bills with an identical direct debit payment every month.
When they've paid for more energy than they've actually used, a credit balance builds up.
About 30 companies have gone bust in the last year. Their customers were automatically transferred to new suppliers.
But, while their credit balances were honoured, the cost of doing so was covered by increasing everyone's bill.
Now Ofgem is proposing that companies hold more capital so credit balances are better protected, and the tab isn't picked up by all billpayers if that supplier collapses.
High credit balances have been a source of long-term frustration to customers, many of whom feel they simply provide a free loan to their supplier.
The regulator says these proposals should prevent excessive overpayments from ever building up.
Citizens Advice said it was correct for Ofgem to tighten the rules which, up to now, had left customers picking up the cost of companies' failures.
"Ofgem has previously allowed energy suppliers to run risky business models. We're glad that it has listened to our warnings and is taking necessary steps to tackle some of the root causes of these issues," said Gillian Cooper, the charity's head of energy policy.
Chris O'Shea, chief executive Centrica - the owner of British Gas, said his company had already voluntarily ring-fenced customers' credit balances, and said regulation needed to be faster.
"We welcome this consultation but we are worried at the length of time it is taking to make the changes necessary and we urge Ofgem to work with greater urgency to protect customers fully and to prevent the events of last year ever happening again," he said.
The proposals mark the next step in Ofgem's wider plan to curb energy failures, which already include stricter entry requirements for new suppliers, and carrying out regular "stress tests" - to ensure companies are financially fit to run.
Prices for oil and gas have soared in recent months, fuelled by the lifting of lockdowns and the Ukraine war.
Food and fuel costs are also rising, with consumer prices increasing at their fastest rate in 40 years.
The typical UK energy bill is set to see a further rise of £800 in October, when the energy price cap - the maximum price which suppliers can charge customers in England, Scotland and Wales - increases again.