Emails between national security officials about the interpretation of the Patriot Act show several of President Obama's top advisers had misgivings about the law that authorized controversial National Security Agency surveillance of phone and Internet activity.

The emails, written shortly after former NSA contractor Edward Snowden's leak of NSA documents, discuss worries advisers had about how broadly certain sections of the law could be interpreted.

The emails were obtained by the nonprofit government watchdog Judicial Watch in response to a Freedom of Information Act request.

The email chain from July 2013 is between Privacy and Civil Liberties Oversight Board Chairman David Medine and an individual Judicial Watch believes to be Peter Swire, a member of the Review Group on Intelligence and Communications Technologies, which was created in August.

Judicial Watch noted that although Swire isn't named, the information in his email signature — including a new position to begin in August — identify him as Swire with "little doubt."

Medine emailed Swire in July, asking him about a 2004 paper he wrote in which he concluded, "Similarly, by permitting the order to cover records of all persons, the literal terms of Section 215 would permit an entire database to be the subject of a (Foreign Intelligence Surveillance Act) order."

Swire responded that he assumed the administration would take an "aggressive" position on the wording, which would lead to the broad interpretation he warned about, and that his view was influenced by testimony and conversations with people "who were worried about Section 215 from the day it started."

He said he may have also had several conversations by then with DOJ officials about how they were interpreting the law.

Swire also had a hand in narrowing the scope of several parts of the law, he said.

"Two or three of the provisions that I criticized actually got pared back during the legislative process. I think one was giving CIA access to essentially any records held elsewhere in the government. Another was a criminal provision that could have put low-level IT managers in jail for ten years if a terrorist used their system or something like that," he wrote to Medine.

His next email added, "As written, the article makes it harder to say we are shocked today that 215 would be read so broadly. The 2004 view of that law professor seems broadly consistent with the reading they used later to justify the phone records program."

Swire helped draft the Patriot Act, according to Judicial Watch, and before that, during the Clinton administration, chaired a cross-agency White House working group tasked with updating wiretap laws for the Internet era.

“These emails suggest that those with concerns about NSA surveillance now include advisers to President Obama,” said Judicial Watch President Tom Fitton.

“And the emails seem to confirm that the Patriot Act specifically authorized the very type of ‘data mining’ that is now causing so much controversy,” Fitton said.