From Article I, Section 9 of the U.S. Constitution, 1787:
No bill of attainder or ex post facto Law shall be passed.
From the United States Congress, July 2008:
Companies such as AT&T were granted immunity under the Foreign Intelligence Surveillance Act Amendments Act (FISAAA). The law gave companies immunity from lawsuits if the U.S. government provided proof to a court that the surveillance was authorized by the president, was legal or did not occur. It applied to surveillance that happened between Sept. 11, 2001, and Jan. 17, 2007.
From U.S. District Judge Vaughn Walker, June 2009:
Screw you, citizens! Ex post facto is a great idea!
I’m astounded that the judge could find in this way. Immunizing organizations or people for breaking laws that were in effect at the time the crime was committed sets a horrible precedent. The lawsuits were filed in 2006, and the law was passed two years later to make the cases moot. That’s an amazing piece of legislative interference in judicial matters. Silly separation of powers. Silly constitution.