Even though Hollywood has always been fond of spy thrillers, it didn’t really notice the Central Intelligence Agency until the 1960s, when agent Felix Leiter, played by Jack Lord, appeared in the James Bond flick, “Dr. No.”

But the CIA has been working with Hollywood since the 1950s.

Tricia Jenkins, the author of “The CIA in Hollywood,” says the CIA first started working with Hollywood to influence foreign audiences.

“Their purpose was essentially to shape foreign policy or to win hearts and minds overseas during the cold war,” she said.

The CIA, to fight communist ideology, developed a think tank, which obtained the rights to George Orwell’s “Animal Farm” — getting a talking pig on the screen 20 years before “Charlotte’s Web.” Jenkins says the CIA also wanted to promote a certain view of American life, for instance pressing for line changes in 1950s scripts to make black characters more dignified, and white characters more tolerant. This “politically correct” image was intended to promote an attractive image of America to a world picking sides in the Cold War.

But while the CIA used Hollywood to project an American ideal, they didn’t seem much concerned with their own image.

“In the old days, the CIA, and its predecessor the OSS — they didn’t really spend much time worrying about what the public thought about them,” said Ted Gup, author of “The Book of Honor: Covert Lives and Classified Deaths at the CIA.”

He says with the end of the Cold War, the CIA realized it needed an image overhaul.

“It’s come to recognize that without public support, its budget is in jeopardy. And its very activities are in jeopardy,” Gup said.

In 1996, the CIA hired a Hollywood liaison: Chase Brandon — who happens to be a cousin of Tommy Lee Jones, with lots of Hollywood connections.

Tricia Jenkins says there’s been a noticeable change in the portrayal of the CIA since then. Before the 1990s, in films like “Three Days of the Condor,” the CIA was portrayed as a band of evil, amoral assassins — or sometimes as buffoons, like Max on the TV show “Get Smart.”

“Now it’s a much more favorable presentation,” Jenkins said. “(They are) frequently being depicted as a moral organization that is highly efficient. It rarely makes mistakes, it’s needed more than ever.”

Since the mid-90s, the CIA has worked with a long list of productions, including movie “The Sum of All Fears,” and major TV series “Alias,” “24” and “Homeland.”

There are some uglier portrayals, sometimes produced with unapproved help from former agents — like the movie “Syriana,” which features George Clooney as Bob Barnes, a CIA officer tasked with assassinating a Middle Eastern leader. The Character Bob Barnes was based on a former CIA agent, Bob Baer.

The real Baer is working on a new production of his own: the book “The Perfect Kill: 21 Laws of Assassination.” He helped with Syriana.

“They called me up and said, ‘We want to go on a trip with you to the Middle East,’" Baer recalled. "I went with the director, Stephen Gaghan, I took him to Lebanon, I took him to a meeting with some shady people I knew in London, in Nice, (and) so forth, and he was absolutely fascinated by seeing the real Middle East.”

“Syriana” isn’t exactly an advertisement for the CIA. But these days, that’s the exception — Jenkins says for the most part, the CIA gets their preferred image across. And unless you read the credits at the end of a film, you’d have no idea you just watched a movie produced with help from the CIA.

“It’s important to note that the CIA doesn’t help everyone. It’s only going to help those who portray CIA in a positive light and helps them boost recruitment interest,” Jenkins said.

During her stint on Alias, Jennifer Garner actually made a recruitment ad for the CIA. And if you find Ben Affleck or Jessica Chastain attractive, it’s hard to think of better recruitment ads than “Argo” or “Zero Dark Thirty.”