Former CIA director Leon Panetta revealed secret information to Zero Dark Thirty scriptwriter Mark Boal when he gave a speech at the agency's headquarters marking the raid that killed Osama bin Laden in Pakistan, according to newly declassified documents.
Mr Panetta said through a spokesman that he did not know Mr Boal was in the room.
Judicial Watch, a conservative group, filed a request for the more than 200 pages of documents, which the CIA has now released. The files concerned the internal investigation of its role in the acclaimed film about the capture of bin Laden.
"I had no idea that individual was in the audience," Mr Panetta said in a statement. "To this day, I wouldn't know him if he walked into the room."
Mr Panetta's spokesman Jeremy Bash said the ex-CIA chief had assumed everyone in the audience had the proper clearance to hear the speech.
The documents refer to Mr Panetta revealing the name of the ground commander of the unit that carried out the raid.
Parts of the speech transcript released in the documents are still blacked out.
CIA spokesman Dean Boyd said the CIA has since "overhauled its procedures for interaction with the entertainment industry after an extensive internal review".
He said the agency now has "a centralised record-keeping system for entertainment industry requests and, earlier this year, issued detailed guidance on contact with the industry and support for entertainment-related projects", to make sure classified material is protected.
Mr Boal declined to comment.