Updated

Lawmakers outraged over the AIG bonuses have told the people who got the money to watch out -- the government will get it back one way or the other, even if it means taxing the heck out of their paychecks.

But legal scholars say Congress will have a tough time defending itself in court if it goes down that road.

Not only would Congress be retroactively meddling with contractual agreements, they say, but it would be passing laws that would essentially target a specific group of employees.

Jonathan Turley, George Washington University law professor, said targeting those employees through taxes would invite a valid court challenge.

"It could well trigger years of litigation," he said. "Just because a company or individual is unpopular does not mean the government can retroactively impose punitive measures against them. ... There's a host of difficult contractual and constitutional and statutory barriers that would have to be overcome by Congress."

Two of those difficulties, lawyers say, lie in Article I of the U.S. Constitution -- a section stating Congress cannot pass any "Bill of Attainder" or "ex post facto" law.

A Bill of Attainder is an act of the legislature that singles out and punishes a group or individual without trial. An ex post facto law retroactively changes the legal consequences of an act.

"It's a Bill of Attainder. It can't be done," Sen. Judd Gregg, R-N.H., told FOX News when asked about proposals in the Senate to tax AIG.

President Obama even warned Wednesday about the possibility of a costly court battle over the $165 million in bonuses.

"We are exploring every possible avenue, as is Congress, to see what we can do. But what we need are tools that allow us not to find ourselves in a situation where we only have two options," Obama said. "One is to withhold money from AIG that could potentially lead them into a spiral that could affect the entire financial system. Or, on the other hand, having folks get bonuses and at least have the capacity to sue the government and get not only their bonuses but potentially even more out of the legal system."

Treasury Secretary Timothy Geithner wants to require AIG to pay back the money to the government and deduct that amount from the $30 billion bailout commitment, as well as subject future bonuses to tough restrictions.

Click here for a PDF of the AIG bonus plan, from Findlaw.

Democrats on the Hill, though, have discussed a range of options for recovering the money that involve heavy taxes.

Ten House Democrats introduced a bill Tuesday to tax all bonuses above $100,000 at 100 percent to recoup all the "outrageous" AIG bonuses. House Speaker Nancy Pelosi said in a statement that recouping a "substantial portion" through taxation is one of several viable possibilities.

And Rep. Charlie Rangel, the Democratic chairman of the tax-writing House Ways and Means Committee, authored a resolution that would place a 90 percent income tax on bonuses for employees with family incomes above $250,000 for firms, like AIG, that received at least $5 billion in bailout money.

Initially, Rangel said he was uncomfortable with the idea of meddling with the tax code as a solution to the AIG problem, but he told FOX News he "had an obligation to respond to the fears and anger of the people."

Senate Majority Leader Harry Reid also said Tuesday that legislation being crafted by Senate Finance Committee Chairman Max Baucus, D-Mont., would subject the bonuses to a tax of more than 90 percent.

Sen. Chuck Schumer, D-N.Y., said, "If (AIG CEO Edward) Liddy does nothing, we will act and will take this money back and return it to its rightful owners, the American taxpayers. We will take this money back by taxing virtually all of it.

"So let the recipients of these large and unseemly bonuses be warned. If you don't return it on your own, we will do it for you."

Liddy told a House committee Wednesday that some employees have volunteered to give some of their bonus money back.

But he reminded lawmakers that the employees have a legal right to keep the bonuses.

Robert Sedgwick, an executive compensation attorney, told FOX News he doubts the government could successfully tax all that money back.

"There'd be a series of constitutional issues in attempting to do it in that way," he said.

Meanwhile, the Connecticut state legislature is dealing with another legal conundrum, as AIG apparently claims it is legally obligated to pay its bonuses because of provisions in the Connecticut Wage Act.

AIG cites Connecticut law because the company's Financial Products division, the embattled unit that is receiving the bulk of the money, is located in the state. Part of the Wage Act states that employees who are improperly denied their wages can recover twice that amount in court.

Connecticut lawmakers slammed AIG for citing the law -- Gov. M. Jodi Rell called it "contemptible" -- but said they would change the act in response. A draft proposal, pushed by House Republican Leader Larry Cafero and other lawmakers, would add provisions exempting companies that receive bailout money.

Cafero spokeswoman Pat O'Neil said they'll try to take up the bill next week, but it's unclear whether it could have any effect on past contracts. He said lawmakers want at least to prevent AIG from using Connecticut law as an excuse for paying bonuses in the future -- since another $230 million in bonuses is in the pipeline for this year, though Liddy has said he will reduce those.

"We want to remove from their quiver this argument that they have no choice but to use Connecticut law against us as justification for this reprehensible behavior," O'Neil said.

Turley said Connecticut, like Washington, would probably have a tough time trying retroactively to apply the new standards to an old AIG contract.

Turley said the AIG employees who received bonuses have every incentive to keep the money by whatever means possible -- even if that means exposing their identities to public scorn in the courtroom.

"Their prospect of gainful employment is virtually nil, so these people are not going to go quietly into the night," Turley said. "These people are already as popular as Ebola. They have little incentive to return a million dollars or more."

FOX News' Trish Turner and Chad Pergram contributed to this report.