With more than 40 firms now offering gas and electricity deals it warns of the danger of one becoming insolvent.
At present anyone who is in credit with their energy supplier could lose out.
The watchdog wants the cost of a safety net to be paid for by customers, which would have "a small impact on bills", it said.
Ofgem's senior partner for consumers and competition, Rachel Fletcher, said: ""We are proposing a safety net to protect customers' credit balances in the unlikely event of a supplier failure."
Under current rules, if a gas or electricity supplier becomes insolvent Ofgem appoints a replacement to ensure that customers continue to be supplied with energy.
But it warns that "there may be financial implications for the failed supplier's customers".
That is because as direct debit energy payments spread the cost evenly across the year, customers are often in debit during the winter and build up credit in the summer.
Ofgem reckons that a typical customer's credit balance peaks at a little over Â£100 each year.
But it warns that without regulatory intervention, customers are unlikely to receive all - or possibly any - of their money back if their supplier fails.
Some industries already have a financial safety net for consumers.
If a financial services firm goes bust, for instance, the Financial Services Compensation Scheme protects people's savings with authorised firms up to Â£75,000. The scheme is paid for by a levy on all financial services companies.
Meanwhile if a travel company collapses, customers are protected if it was a member of travel trade association ABTA.  The scheme is funded through a bond on members.
Ofgem wants similar protection for energy customers and is proposing to allow, on a case-by-case basis, the costs of reimbursing credit balances to be spread across all energy customers.
"This would better protect customers' money and have a small impact on bills," it said.
The watchdog was keen to stress that it does not expect any suppliers to go out of business. "These proposals are for reassurance and to give customers the confidence to shop around and get the best energy deal," Ms Fletcher said.
But it points out that while competition benefits consumers, it can lead to suppliers to fail in the same way as companies can in other markets.
More than one in six - 17.4% - dual-fuel households are now with an independent provider, according to research from Cornwall Energy.
It says 7.1 million customers have switched to one of the energy market's newest players since 2011.
The energy watchdog Ofgem has proposed adding a small levy to bills to ensure that consumers do not lose out if their supplier goes bust.