WASHINGTON (Reuters) - CIA Director John Brennan said on Wednesday that legislation to allow lawsuits against the government of Saudi Arabia over the Sept. 11 attacks has "grave implications" for U.S. national security.

Brennan's comments in a formal statement came as the Senate prepared to hold a vote on overriding President Barack Obama's veto of the legislation.

"The most damaging consequence would be for those U.S. Government officials who dutifully work overseas on behalf of our country. The principle of sovereign immunity protects U.S. officials every day, and is rooted in reciprocity," Brennan said. "If we fail to uphold this standard for other countries, we place our own nation’s officials in danger."

(Reporting by Timothy Ahmann and Jonathan Landay)