The National Security Agency attempted a public relations makeover in 1998 via the Jerry Bruckheimer–produced spy thriller Enemy of the State, but the agency was disappointed it was portrayed as the "bad guys" in the film, internal emails between agency officials obtained by BuzzFeed News through the Freedom of Information Act show.

One employee wrote in 1998, "Unfortunately, the truth isn't always as riveting as fiction and creative license may mean that 'the NSA,' as portrayed in a given production, bears little resemblance to the place where we all work."

In the 1998 blockbuster film starring Will Smith, Congress, pressed by the NSA, attempts to pass a bill expanding the agency's surveillance powers. At the start of the film, several NSA agents kill a congressman opposing their efforts. However, they do not realize they were secretly recorded by a bird watcher. The bird watcher, chased by the NSA, passes the information along to Will Smith's character, who subsequently finds his phones tapped, clothing bugged, and house burglarized.

Though the NSA hated the movie, officials within the agency met with producers of the film prior to its release. Director Tony Scott, producer Jerry Bruckheimer, and executive producer Andy Davis visited the NSA headquarters to learn more about the agency. An office-wide email sent before the film's release showed that employees were eagerly awaiting the film's release.

Still, during production, there were some complaints from rank-and-file employees, though more for perceived annoyances than the film's content.

"I was standing in the parking lot staring like an idiot, wondering why this helicopter with some strange object underneath it was hovering over me," one employee complained after a production helicopter flew above the agency to get establishing shots. "Will Touchstone be getting in touch with me so I can get paid for my appearance in this movie? Because I have no intention of allowing my image to be used for free," the employee concluded, unaware of public access laws.

The helicopter filming led to other complaints. One employee fretted that their car would now be seen in the film, while another complained that his window blinds were up during filming.

In an interview in 2001, then–NSA chief Michael Hayden invited CNN to profile the agency for a piece that would air later that year.

"I made the judgment that we couldn't survive with the popular impression of this agency being formed by the last Will Smith movie," Hayden had said at the time to CNN.

"When Gen. Michael Hayden saw the movie, he saw a problem — an image problem," CNN’s David Ensor narrated in the segment. "That is in part why the NSA decided to let CNN inside the NSA to see where code breakers gather, and code makers protect the nation's secrets," Ensor said. "Above all, Hayden knows NSA cannot afford to be seen as trampling on the privacy rights of U.S. citizens."

Read the emails below:

Andrew Kaczynski is a political reporter for BuzzFeed News and is based in New York.