As the U.S. government closes in on a $13 billion settlement with JPMorgan Chase & Co. over its mortgage practices, lawyers specializing in bank mergers are looking for ways to protect their clients from big losses in similar cases in the future.

A big chunk of the record settlement is attributed to bad mortgage loans at Washington Mutual and Bear Stearns – two banks that U.S. financial regulators encouraged JPMorgan to buy during the 2008 financial crisis.

That has triggered discussions among bank merger lawyers about how they can get indemnification clauses into future bailout deals, and obtain greater protection from losses from the Federal Deposit Insurance Corp., which seizes and sells troubled banks.

When the FDIC coordinates the sale of such banks, it often agrees to limit the losses that the acquiring bank may face on troubled assets. It did this, for example, in 2008 to help Citigroup Inc. buy parts of Wachovia Corp., which was ultimately bought without government assistance by Wells Fargo & Co.

One idea that lawyers are discussing is expanding the scope of these loss-sharing agreements with the FDIC to cover potential regulatory action.

“People are talking about what kind of increased insurance against liabilities they can put in place,” said Donald Lamson, a partner at Shearman & Sterling LLP in Washington, D.C. “Banks in general are going to be more leery of going into these kinds of deals.”

The reluctance of banks to buy failed institutions could cause headaches for regulators in future crises. While only 22 banks have failed so far this year, that pales compared with the 140 that succumbed in 2009 and 157 in 2010, a failure rate that stretched FDIC resources.

JPMorgan is expected to finalize its settlement with the U.S. Department of Justice in the coming days. It originally paid rock-bottom prices for Bear and Washington Mutual, forking out only around $3.4 billion for both and becoming the largest U.S. bank. But it has since incurred billions of dollars of legal costs and writedowns linked to both companies.

JPMorgan now complains that it is being unfairly punished for doing a good turn for the government and economy during the crisis.

“It is like buying a home at foreclosure: you know you’re buying at a bargain basement price, but there may be risks,” said Jeffrey Manns, an associate professor at George Washington University Law School. “There is no such thing as a free lunch.”

Lawyers said JPMorgan’s experience is spurring them to try to carve out broader protections for bank bailouts.

“The idea would be to make the language as broad as possible to include regulatory issues and past acts of the predecessor banks so clients are assured they are covered,” said Lawrence Kaplan of Paul Hastings LLP in Washington, D.C., and previously a lawyer for the government’s former Office of Thrift Supervision.

He added that most banks will want to extend loss-sharing arrangements with the FDIC beyond the usual five years.

Mann explained: “Lawyers are known for pessimism and being negative, but they now have to be more so in assessing the risks of potential acquisitions.”

Mitchell Raab, a partner at Olshan Frome Wolosky LLP in New York, said acquiring banks could negotiate a potential reduction in the purchase price if a takeover does not work out as planned.

However, it is difficult for acquirers to fully defend against possible regulatory action arising from the past activity of the banks they buy. Lawyers said any protections they structure will have limitations.

“The FDIC can’t say it will forbid the U.S. Securities and Exchange Commission from taking an action against your firm over poor disclosures that were made,” Lamson said.

He said the same holds true for any criminal conduct that the Justice Department or state attorneys general may pursue.

The only way to fully protect clients may be to convince them not to do deals in the first place, some lawyers said.

“If the decision is undertaken to do one of these deals, it should be done in a very careful way,” Lamson said. “But at the end of the day being careful may not be enough.”