U.S. securities laws have their limits and do not justify making UBS AG liable to shareholders for touting its ability to control risk even as it harbored a rogue trader who caused $2.3 billion of losses, a federal judge ruled on Friday.

U.S. District Judge Katherine Forrest in Manhattan threw out a lawsuit seeking to hold the Swiss bank responsible for shareholder losses stemming from revelations about unauthorized and fictitious trades made by former UBS trader Kweku Adoboli.

Adoboli, a British trader born in Ghana, was convicted in November 2012 of fraud and sentenced to seven years in prison. He admitted at trial to making his trades to hide his risk exposures, but said he was trying to make money for the bank.

Plaintiffs led by two pension funds in Elmsford, New York, claimed that before Adoboli’s trades were revealed on Sept. 15, 2011, UBS officials including then-Chief Executive Oswald Gruebel had misled investors by frequently touting the bank’s internal controls and “disciplined” risk culture.

They said UBS “incentivized” traders to take high risks and didn’t properly monitor activity, and should be responsible to shareholders for the more than 10 percent decline in its stock price after Adoboli’s trades became known.

In a sharply worded decision, Forrest said securities laws do not require banks to be “prescient or omniscient,” such that UBS should be liable for what “at most” reflected “internal management issues” and “competing incentives.”

The judge, who presided this summer at the civil fraud trial of former Goldman Sachs Group Inc. vice president Fabrice Tourre, said banks’ close ties to recent financial events does not mean they should always be liable when things go wrong.

“Over the past several years, it has been ever so easy to make banks the target of lawsuits alleging securities fraud: what banks said, how those statements failed to match up to what happened, and who did or should have known,” she wrote. “One might think of the tired but appropriate phrase ‘shooting fish in a barrel.’

“But the securities laws have limits; and it is the responsibility of the courts to ensure that those limits are enforced, and that lawsuits which cannot withstand the most basic scrutiny find their way into whatever great beyond awaits suits dismissed for failure to state a claim,” she wrote.

The lead plaintiffs are the Westchester Teamsters Pension Fund and Teamsters Local 456 Annuity Fund in Elmsford, New York. Tor Gronborg, a partner at Robbins Geller Rudman & Dowd who represents them, declined to comment.

UBS spokeswoman Megan Stinson said the bank is pleased with the decision.

The case, which names a different plaintiff, is C.D.T.S. No. 1 & A.T.U. Local 132 Pension Plan v. UBS AG et al, U.S. District Court, Southern District of New York, No. 12-4924.