But George Bush, the US president, has threatened to veto any bill that limits CIA interrogation techniques.
Tony Fratto, a White House spokesman, said: "For a number of reasons, the president's advisers would recommend a veto of this bill. Parts of this bill are inconsistent with the effective conduct of intelligence gathering."
John McCain, the leading Republican presidential candidate and an author of previous anti-torture legislation, voted against the overall bill.
"I made it very clear that I think that waterboarding is torture and illegal, but I will not restrict the CIA to only the army field manual," McCain said on Wednesday.
Last week, Hayden admitted waterboarding had been used on three al-Qaeda suspects, including Khalid Sheikh Mohammed, who was charged this week in relation to the September 11, 2001 attacks in New York.
Hayden told congress last week that waterboarding may no longer be legal, but the White House has refused to rule out using it again.
Michael Mukasey, the US attorney-general, has refused to rule on whether waterboarding is legal, saying he will do so only if US intelligence services ask to use it again.
Waterboarding has been widely condemned by human rights groups and other countries as a form of torture.