On April 21, 2011, Mark Boal called the CIA to tell them he was going to Afghanistan.

The previous year, the screenwriter had been at a dinner when CIA director Leon Panetta asked Boal to alert the agency if he ever traveled to the country. At the time, Boal was working on a movie called Tora Bora, aboutthe CIA's failure to capture Osama bin Laden in the immediate aftermath of the 9/11 attacks. The title referred to the region in eastern Afghanistan where the US felt it had let bin Laden slip through its fingers during a battle in December 2001.

But less than two weeks after Boal made the call, a team of Navy SEALs raided the al Qaeda leader's compound in Pakistan and killed him. Boal would not be going to Afghanistan after all.

Instead, he stopped writing the script for Tora Bora and began writing a different screenplay about what one lawmaker called "the most classified mission in history" — the killing of bin Laden. That movie, which Boal would work on with director Kathryn Bigelow, would become the 2012 Oscar-winning film Zero Dark Thirty. And the CIA would play a huge role in the creation of the script.

* * *

The previously undisclosed detail about Boal's phone call to the CIA was included in more than 100 pages of internal CIA documents obtained exclusively by VICE News in response to a Freedom of Information Act (FOIA) lawsuit. The documents contain the most detailed information to date about the controversial role the CIA played in the production of Zero Dark Thirty (ZDT).

Included in the trove of redacted agency records is a March 2014 CIA Office of Inspector General report titled "Alleged Disclosure of Classified Information by Former D/CIA" — D/CIA refers to the director of the Central Intelligence Agency, Leon Panetta — and a separate September 2013 report from the inspector general's office titled "Potential Ethics Violations Involving Film Producers."

The ethics report contains remarkable details about how Bigelow and Boal gave CIA officers gifts and bought them meals at hotels and restaurants in Los Angeles and Washington, DC — much of which initially went unreported by the CIA officers — how they won unprecedented access to secret details about the bin Laden operation, and how they got agency officers and officials to review and critique the ZDT script.

Representative Peter King, the Republican congressman from New York and the former chairman of the House Committee on Homeland Security, had pressed the inspectors general at CIA and Department of Defense in August 2011, a month after Panetta left the CIA to serve as secretary of defense, to investigate the alleged disclosures to Boal and Bigelow. This came after news reports claimed that high-ranking Obama administration officials granted the filmmakers extraordinary access to classified details about the bin Laden operation, and that the disclosures led to the arrests of Pakistanis who assisted the CIA in the operation. King's objections were centered around the fact that the movie was originally slated for release a month before the 2012 presidential election — it ended up premiering in December — and that it would have been used by Obama's reelection campaign.

The CIA worked with Bigelow and Boal at a time when the agency's so-called enhanced interrogation program was under scrutiny by Democrats on the Senate Intelligence Committee. They were working on what came to be known as the Senate torture report, about the efficacy of the techniques to which CIA captives were subjected. The report concluding that those techniques did not yield unique or actionable intelligence and had nothing to do with tracking down bin Laden. ZDT, however, strongly suggested that the use of torture led the agency to bin Laden, a narrative that current and former CIA officials promoted in numerous op-eds and interviews after bin Laden was killed. That the narrative was so prominently featured in _ZDT _angered Senator Dianne Feinstein, the Democratic chairwoman of the Senate Intelligence Committee, who fired off a letter to the president of Sony Pictures objecting to what she called a "false narrative."

To this day, the CIA vigorously defends its use of so-called "enhanced interrogation." This week, several former agency officials, including one who met with Bigelow and Boal, are releasing a book titled Rebuttal that defends the agency's enhanced interrogation program and harshly criticizes the Senate Intelligence Committee's report.

* * *

The inspector general's reports said the CIA's working relationship with the filmmakers began in 2010, a year before bin Laden was killed.

"Based on a review of documentation and interviews, the inspector general's office determined the CIA's cooperation with filmmakers Mark Boal and Kathryn Bigelow began in 2010 when Panetta and Bigelow met at an event where Bigelow discussed her film project 'Tora Bora,' a film project involving the CIA's failure to capture [bin Laden], and Panetta offered the Agency's assistance."

Within days of bin Laden's death, Boal secured meetings with CIA officials and counterterrorism officers. According to the inspector general's report about potential ethics violations by CIA officers, Boal also sent a letter to George Little, then the director of the CIA's Office of Public Affairs (OPA), shortly after news broke about bin Laden's death.

Boal wished to discuss his new plan: Scrapping the script for Tora Bora and instead telling the story of how the CIA managed to find and kill bin Laden. Less than three weeks after bin Laden's death, Boal and Michael Feldman, a public relations representative for Tora Bora, met with CIA officials to discuss the new project.

The CIA inspector general said its investigators obtained 'conflicting information as to whether Panetta had knowledge Boal was in the audience at the time of the speech.'

Boal found out from the counterterrorism officers with whom he met that the CIA was going to hold a classified awards ceremony on June 24, 2011 to honor the individuals who were part of the team that hunted down bin Laden.

"Boal expressed interest in attending the ceremony and passed his request on to [a woman at the agency] for action," the CIA inspector general's report said.

The report added that the CIA gave Boal access to CIA personnel and facilities less than a month after bin Laden was killed in order to "further his research" for the _ZDT _screenplay.

In order to assist him in his research and in "capturing the atmospherics," a "continuation of his earlier meetings that were all 'blessed' by CIA officials" saw Boal invited to attend the CIA's classified bin Laden awards ceremony "held inside a large tent" outside of the main entrance of CIA headquarters in Langley, Virginia. It was attended by about 1,300 people.

"The audience was a mixture of both overt and covert personnel from across the Intelligence Community, as well as personnel from DOD and Congress. [Navy SEALs] who conducted the [bin Laden] raid were also in attendance," the CIA inspector general's report said.

It's unknown exactly who at the CIA extended the formal invitation to Boal. The inspector general's report says the CIA's Office of Public Affairs, which acts as the agency's liaison to the entertainment industry, arranged to have Boal present at the awards ceremony and told him it was off the record. But the report also notes that the office of the Director of Central Intelligence "approved the invitation to Boal."

"While the [CIA Office of Inspector General] determined several senior CIA officers were aware Boal would be attending the [bin Laden] Operation Awards Ceremony, [the Office of Inspector General] was unable to ascertain who specifically authorized Boal's invitation," the report said.

When confronted by the CIA inspector general, Panetta said he had no idea that Boal was present at the awards ceremony. But the CIA inspector general said its investigators obtained "conflicting information as to whether Panetta had knowledge Boal was in the audience at the time of the speech." At least one CIA employee told the inspector general that Panetta "had foreknowledge of Boal attending the ceremony."

Panetta told investigators at the CIA's Office of Inspector General that he would have been unable to identify Boal at the awards ceremony because he had never met the screenwriter. But the inspector general discovered Panetta's story didn't check out. Along with the email Boal had sent Panetta in April 2011, the inspector general determined that Panetta previously met Boal at the May 2010 White House Correspondents' Association Dinner. In fact, Panetta was seated at the same table as Boal and Bigelow and, as the separate CIA inspector general report into potential ethics violations makes clear, instructed Boal and Bigelow to contact him when they were ready to begin working on their original bin Laden movie, Tora Bora.

Also seated with Boal, Bigelow, and Panetta was former US Senator Evan Bayh, a onetime member of the Senate Intelligence Committee, who four years later would lead a CIA "accountability review board" over claims that the CIA spied on Senate staffers and breached their computers while they were researching and compiling the torture report. The agency's inspector general had found CIA officers culpable; Bayh's accountability board review completely exonerated them.

Additionally, the CIA inspector general said, "Panetta first met Kathryn Bigelow, Boal's co-producer, around April 2010, at a dinner in Washington…. According to [redacted], Bigelow informed Panetta she was working on a movie project about the battle at Tora Bora."

A detailed timeline about the CIA's interaction with Bigelow and Boal identified the last communication as taking place on May 3, 2012, when a public affairs officer received "a call from the film's producers indicating the need to delay filming at [CIA] headquarters until late summer or early fall."

Panetta did not respond to VICE News' requests for comment.

A timeline detailing the CIA's interaction with Bigelow and Boal included in the inspector general's report.

The report said some CIA personnel feared Boal's presence at the bin Laden awards ceremony was not a good idea because he would be exposed to classified information contained in Panetta's speech, and asked for "assistance in warning Panetta." But another CIA employee told the inspector general it "never occurred to him that Boal's presence at the awards ceremony would pose a security problem."

(Some details about Panetta's disclosures to Boal were previously reported after the DoD's own inspector general report into the matter leaked two years ago. Moreover, the DoD has released documents that reveal that top military officials involved in the bin Laden operation also disclosed classified information to Bigelow and Boal.)

Panetta's prepared speech was classified "SECRET/NOFORN," which means "not releasable to any foreign nationals," and coordinated with the CIA's Office of Public Affairs "with the exception of several handwritten remarks made by" Panetta in the margins of the document. But the inspector general determined that Panetta's speech should have been classified "TOP SECRET" at the "sensitive compartmented level" because it contained classified information derived from the NSA and DoD.

The inspector general found that the "discrepancy in the classification of the speech was due to the fact that [redacted] did not coordinate the information in the speech with outside agencies beforehand."

"In his interview with the [Office of the Inspector General, the CIA employee who wrote portions of Panetta's speech] stated that he classified the speech SECRET based on information he received from the agency's Counterterrorism Center (CTC)," the inspector general's report said. "[Redacted] told [the Office of the Inspector General] that CTC notified him of the need to coordinate the information with NSA and DoD. However, [redacted] said that he elected not to coordinate the information due to the press of business at the time and that there was no requirement by [Office of Public Affairs] that speeches be coordinated ahead of time with outside agencies."

Panetta told the inspector general that he was unaware his speech contained classified information, though he later acknowledged that it contained information classified at the "secret" level. Still, he played down the seriousness of the misclassification and the fact that classified details were revealed to Boal, who does not hold a security clearance, by stating that portions of his remarks had already been revealed by President Barack Obama and other government officials after bin Laden was killed.

"Panetta stated that the presence of information in such a manner contributed to a confusing situation with respect to what information was officially released and what was not," the inspector general's report said.

After the ceremony, Boal, who was not interviewed by the inspector general as part of its investigation, was introduced to Navy Admiral William McRaven, who led the SEAL team mission that killed bin Laden. CIA employees interviewed by the inspector general's investigators could not recall if Boal spoke with Panetta after the ceremony.

* * *

That was the start of the CIA's yearlong working relationship with Boal and Bigelow. According to the ethics report, at least 10 CIA National Clandestine Service (NCS) officers "identified as involved in the hunt" for bin Laden and other CIA officials would go on to meet with Bigelow and Boal, and work on the ZDT script.

"The [bin Laden] operation team provided the filmmakers background on the intelligence portions of the [bin Laden] raid," the CIA ethics report said. One CIA officer said that she "provided an overview to Boal of the intelligence case [redacted] for the public roll out plan about the Bin Laden raid…. [Redacted] advised that Boal and Bigelow visited CTC offices to get the working condition atmospherics and the personal interactions the team experienced working the [bin Laden] operation. [Redacted] commented that Boal and Bigelow were interested in the human element for the Zero Dark Thirty movie."

At one point, an officer told the inspector general's investigators that she "covered up classified [sic] on her desk when Boal and Bigelow visited."

Soon after the filmmakers told the agency that their project would focus on the CIA's finding and killing of bin Laden in 2011, they met and spoke regularly with agency officials at CIA headquarters in Langley, as well as in Washington, DC and Los Angeles. One officer said Boal "needed to talk to Agency officers as part of the project to get a feeling of what it was like to hunt [bin Laden]."

Bigelow and Boal frequently treated CIA personnel to drinks and meals valued at a total of more than $1,000. It was this revelation by a CIA officer who was interviewed by a member of the inspector general's staff on May 16, 2012 that prompted a larger probe involving interviews with six CIA officers to find out if those who worked on ZDT "committed any statutory or regulatory violations by accepting means and gifts" from the filmmakers.

According to the ethics report, one CIA officer who met with Boal at the Jefferson Hotel in Washington, DC had decided to relocate the meetings from CIA headquarters to Boal's hotel suite in late June 2011 to "minimize the talk and avoid jealousy" in the counterterrorism center. The meetings lasted two to four hours, and the officer recalled that she ordered grilled cheese, French fries, and a soda while they worked.

"Jealousy in CTC over who was getting 'face time' with the filmmakers led the [Office of Public Affairs] to move some meetings off campus," the report said.

The officer said the "off campus" meetings were quieter, and that the purpose was to "obtain unclassified information to develop the female actor's character, and talk through issues." She told the inspector general "that the conversation topics she shared with Boal and Bigelow during meetings included how the [bin Laden] operation team got from point A to point B."

When the pair broke for dinner, they dined either at the hotel restaurant or at the now-closed French restaurant Citronelle. Boal always paid, she told the inspector general.

While shopping, the officer 'saw something designed by Prada and commented that she liked the designer. Boal said he knew the designer personally and offered her tickets to a Prada fashion show.'

The officer's first introduction to Bigelow was over the phone in Boal's hotel suite at the Jefferson. At the time, Bigelow was in Tahiti shooting a commercial for Chanel. Later, in July 2011, that officer met Boal and Bigelow at the Ritz-Carlton in Georgetown, and Bigelow gave the officer a pair of "black Tahitian pearl earrings" as a thank-you for helping with the film project.

During the inspector general's investigation, the officer voluntarily turned over the earrings to the CIA watchdog so that they could be appraised.

"The jeweler offered his professional opinion that the earrings were not worth a formal appraisal, citing the pearls were painted, not genuine black pearls, and that the posts were not platinum," the inspector general's report said. "The jeweler said the appraisal would cost more than the earrings. The jeweler also said that he estimated the value of the earrings to be 'no more than $200' but 'would ask between $60 and $70 if he were selling the earrings on eBay.'"

After the non-appraisal, the earrings were returned to the officer.

That woman, according to a CIA officer in the agency's counterterrorism division who reviewed the documents obtained by VICE News, is one of the people on whom Maya, the main character in ZDT, is based. In the movie, it is Maya's tireless work, along with intelligence obtained from detainees after they've been tortured, that is responsible for revealing the identity of bin Laden's courier, which in turn leads the CIA to bin Laden.

The officer on whom Maya was reportedly partly based would go on to tell investigators that she had three further in-person "social contacts" with Boal and/or Bigelow without members of the Office of Public Affairs present, having "developed a friendship with [the filmmakers] over time." This included a dinner at the members-only social club Soho House in Los Angeles while the officer was on vacation in August 2011. At the dinner, the officer gave Bigelow a "mini Burka and a publicly available FBI wanted poster of Bin laden that had 'Deceased' written across it." Bigelow offered to arrange a private screening of ZDT at the Soho House for the officer and her family when the movie came out.

When the officer checked with CIA public affairs, however, she was told not to accept the offer.

In November 2011, the officer "spent about eight hours shopping and dining" with Boal the day after reviewing the script. While shopping, "she saw something designed by Prada and commented that she liked the designer. Boal said he knew the designer personally and offered her tickets to a Prada fashion show." The officer declined, believing she wouldn't be allowed to accept.

She was then advised by CIA to cut off contact with Boal. Her last conversation with him was in May 2012, "when she told him she could no longer maintain contact with him."

"Boal said he understood, but e-mailed her another three clips from the movie set and said that she could send the clips to spam or delete them," the inspector general's ethics report said.

The CIA officer told the inspector general's staff that Boal tried to get her to sign a release form at one of their meetings. He explained, "that a person who did not like how they were portrayed in the Hurt Locker sued him." (Boal and Bigelow had previously written and directed The Hurt Locker.) The CIA officer, however, did not sign it.

* * *

The "Maya" officer wasn't the only CIA employee who met with Bigelow and Boal while on vacation in Los Angeles during production of the movie. One officer who had several meals with the filmmakers in Washington, DC met Boal in Hollywood for a meal, then drove to a beach house in nearby Malibu where he met with Bigelow and "relaxed and conversed." The officer told investigators that he paid for all of his travel costs, and that others at the CIA were aware of his travel plans. He said he stayed in contact with Boal via personal email, but that the correspondence ended in February 2012.

The officer also told investigators that "in meetings with BoaI, he provided some background on history of the lead, described time periods, field experiences of a typical case officer, impact of the Khost [Afghanistan] attack on [CIA] personnel in terms of morale and following efforts, the strategic view of the hunt for [bin Laden] and ongoing efforts to dismantle AI Q'aida, and the relationship with the US military in general on operations. In regard to meetings where Bigelow was present, [the officer] stated that she seemed most interested in 'what's it like in the field.'"

The "Khost attack" refers to a 2009 suicide bombing at Camp Chapman in Afghanistan dramatized in ZDT. The attack killed nine people, including a CIA officer named Jennifer Matthews who had worked on the CIA's bin Laden team since the 1990s. Matthews was another one of the CIA officers on whom Maya was based.

'I was able to find the tequila we discussed online,' the CIA employee wrote. 'It prices at $169.99 (that's the highest I saw for it).'

The officer admitted he had not reported to the CIA a gift he received from Boal — a bottle of tequila that Boal said "was worth several hundred dollars." According to an email included in the documents obtained by VICE News, someone at CIA attempted to find out how much the tequila was worth.

"I was able to find the tequila we discussed online," the CIA employee, whose name is redacted, wrote. "It prices at $169.99 (that's the highest I saw for it)."

Whether or not the officer knew if he was required to report the gift is unclear. He told the inspector general that "neither OPA or Office of General Counsel provided any guidance on what could or could not be discussed, nor guidance of reporting meetings with the filmmakers." Instead, he said, he and other members of the CIA's Counterterrorism Center "developed their own 'red line' topics which they would not discuss or elaborate upon."

Boal had met with another CIA officer just once for 30 minutes at the Ritz-Carlton hotel in Georgetown. The officer said he gave Boal a copy of the book "Kill Bin Laden that he signed with apologies, since Boal wrote the screenplay based on the book that became invalid once [bin Laden] was killed."

The book, subtitled "A Delta Force Commander's Account of the Hunt for the World's Most Wanted Man," is described as "the first eyewitness account of the Battle of Tora Bora" and was written by Dalton Fury.

Boal then offered the CIA officer tickets to the premiere of ZDT, but the officer "did not find the offer genuine."

A person who appears to be an OPA official told investigators that "the authorization to support the [bin Laden] movie project came from the Director of Central Intelligence suite…. OPA's role in the movie project was to be present at meetings between the film producers and Agency officers…. Boal needed to talk to Agency officers as part of the project, and those officers were not to interact with the film producers without OPA being present."

Boal had vetted his script with CIA officers and public affairs officials numerous times, both in person and telephonically. The timeline included in the cache of documents said Boal also "reads his script over the telephone" to public affairs officers on October 26, November 1, November 18, and December 5 "so that [public affairs] could determine If the script inadvertently exposed any sensitivities."

One CIA official told investigators that Boal walked him through the ZDT script "during four or five telephone conversations in September or October 2011." The official, whose name is redacted, "offered that he checked the names in the script to ensure they were not close to true names."

The official said he and another person whose name is redacted reviewed the script for "egregious errors like having dogs in the interrogation scenes." The officer said that he told Boal this was inaccurate because "CIA would never have dogs in an interrogation room." Boal was also told that a scene that showed "Agency officers partying and shooting guns" was inaccurate because "Agency officers would not do that." Other concerns were raised about detainee debriefing scenes that depicted captives being "punched and kicked."

At some point, a CIA official "put a stop to CTC officers having further media contact."

The Office of the Inspector General concluded that all of the CIA officers it interviewed "accepted gifts, to include meals, from Boal and/or Bigelow." However, the inspector general "did not discover any evidence" that the officers "were given any guidance regarding the acceptance of meals and gifts from the filmmakers." One of the CIA officers mailed Boal and Bigelow's production company a $500 check for the meals she was treated to after the inspector general's probe.

Moreover, the inspector general "did not discover any evidence" that the CIA's Office of Public Affairs "or any other office in the CIA provided clear guidance to any" of the National Clandestine Service officers "who met with the filmmakers about what could or could not be discussed or any rules of conduct regarding those interactions with the exception that [one CIA officer] was eventually told to submit a [statement of compliance form] to report her social contact with the filmmakers, and subsequently, to cease her interactions with the filmmakers."

The inspector general "also did not discover any evidence that the NCS officers who met with the filmmakers disclosed any classified information" to the filmmakers.

Still, Bigelow and Boal's interactions with the CIA resulted in a movie whose narrative was disputed by lawmakers, journalists, and intelligence officials who had worked on the film, which earned more than $130 million worldwide. (Zero Dark Thirty lost the 2013 Academy Award for Best Picture to another CIA movie, Argo.)

Though the movie makes clear as it opens that it is "based on first-hand accounts of actual events," Senator Dianne Feinstein, the chairwoman of the Senate Intelligence Committee, who spearheaded the Senate's investigation into the CIA's torture program while ZDT was in production, wrote an unprecedented letter sent to the head of Sony Pictures, which distributed the film.

That letter, dated December 19, 2012, the day ZDT was released, said that the movie "is factually inaccurate, and we believe that you have an obligation to state that the role of torture in the hunt for Usama Bin Laden is not based on the facts, but rather part of the film's fictional narrative."

Michael Morrell, the former acting director of the CIA, who is identified in the inspector general report as having met with Bigelow and Boal to discuss their film, said in a statement disseminated to CIA employees a week after the movie was released that it is "not a realistic portrayal of the facts," but a "dramatization."

At one time, the Senate Intelligence Committee investigated the CIA's contacts with Bigelow and Boal and whether the CIA was responsible for the film's depiction of torture and its efficacy in getting a courier to give up information that lead to bin Laden's location, but little came of the probe. Peter King, however, has continued to demand a full public accounting from the Obama administration about the disclosures.

Neither Bigelow nor a spokesperson for Boal responded to VICE News' requests for comment. Both filmmakers have been guarded about their working relationship with the CIA and have chalked up criticism of their film to "politics." In an interview with Empire magazine, Boal said he did not want to discuss his research for fear that it "will come back to haunt me in a Senate hearing, which is a real possibility."

Bigelow, in an account published in the Los Angeles Times on January 15, 2013, responded to criticisms about the movie's depiction of torture and the role ZDT suggested it played in leading the CIA to bin Laden.

"Confusing depiction with endorsement is the first step toward chilling any American artist's ability and right to shine a light on dark deeds, especially when those deeds are cloaked in layers of government secrecy and obfuscation," Bigelow wrote. "On a practical and political level, it does seem illogical to me to make a case against torture by ignoring or denying the role it played in US counter-terrorism policy and practices."

* * *

The inspector general identified several potential criminal violations of federal law — Panetta's unauthorized disclosure of classified information to Boal, and a separate federal violation of transmitting or losing of defense information.

Additionally, the inspector general identified as a potential violation of federal criminal law the bribery of public officials and witnesses by Bigelow and Boal. The cases were referred to the Justice Department for criminal prosecution, but Justice declined to prosecute in favor of "administrative action" by the CIA.

In a statement provided to VICE News, CIA spokesman Ryan Trapani said the agency did, in fact, take action. In response to the report on potential ethics violations, the CIA's Office of Public Affairs "implemented mandatory annual ethics training for all OPA employees that is tailored to circumstances they may encounter and took administrative actions designed to reinforce ethical duties and reporting requirements.

"In the wake of 'Zero Dark Thirty,' CIA has completely overhauled its procedures for interaction with the entertainment industry. Among other things, the Agency created a centralized record-keeping system for entertainment industry requests and, in 2012, issued comprehensive, new management guidance on contacts with and support to the entertainment industry."

The Office of Public Affairs' formal written policy, "Management Guidance on Contact with the Entertainment Industry and Support to Entertainment Industry Projects," was issued in December 2012. VICE News has requested a copy of it under the Freedom of Information Act.

Trapani continued:

"OPA also strengthened policies and procedures to ensure the protection of classified information and to safeguard against unauthorized disclosures. In connection with the March 2014 [inspector general's] report [about Panetta], OPA expanded its staff to include an Information Management Officer responsible for classification review of speeches and other material released to the public. OPA also created new procedures and policies for vetting speeches and for ensuring that all OPA-related visitors to the CIA compound are appropriately coordinated with security personnel."

Mark Zaid, a Washington, DC-based attorney who has represented intelligence community employees in cases involving the leaking of classified information, told VICE News that the circumstances surrounding Panetta's "apparent inadvertent disclosure of classified information to a Hollywood film producer was a comedy of errors and failure of coordination within CIA."

"At worst, perhaps administrative discipline should be meted out to several officials and notations placed within their security files, but frankly, any harm that occurred appears to be virtually non-existent," Zaid said. "The real lesson to be learned from this episode is that CIA does what it wants with classified information if it serves its interests and punishes only those who run afoul of its policies or management."

Follow Jason Leopold (@JasonLeopold) and Ky Henderson (@kyhenderson) on Twitter.