In popular perception (or at least in popular media), the Federal Bureau of Investigation chases serial killers, busts countrywide fraud rings, checks out paranormal weirdness, and is generally portrayed as good and law-abiding.
The Central Intelligence Agency, on the other hand, is often perceived and portrayed as an organization of sociopathic American imperialists who like to lie, cheat, steal from foreigners, overthrow governments (including America's, if it gets too squeamish — read "weak" — about the Company's plans), and perform unethical psychological experiments and interrogations in offshore Black Site locations.
The FBI is very much aware of the perceived moral contrast between themselves and the CIA. FBI agents are taught to be courteous and professional specifically for the purpose of contrasting with the negative CIA stereotype. As a result, there have been cases where CIA informants have requested FBI handlers because of the bureau's reputation.
This has historically been Truth in Television, at least to a degree. J. Edgar Hoover long resented the CIA's existence, as he felt that the FBI should be in charge of the nation's intelligence operations. It didn't help that his long-time rival, William Donovan, headed its precursor, the wartime Office of Strategic Services (OSS). For years under Hoover, the FBI would refuse to share information or cooperate with the CIA in their investigations. Attempts were made over the years (notably by Richard Nixon prior to the Watergate scandal) to ensure smoother relations between the two agencies as their impasse was considered detrimental to national security. Although overt hostility lessened after Hoover's death, interagency tension continued off-and-on for decades. Part of the impetus for the creation of the Department of Homeland Security after the 9/11 terror attacks was that the "intelligence wall" between FBI and CIA was blamed, in large part, for the failure to stop the attacks.
There is some overlap, however, with the abuses of the longtime FBI head J. Edgar Hoover being exposed. The reports of him blackmailing politicians, persecuting political dissidents like Martin Luther King Jr., falsely claiming Ma Barker was a crime boss to excuse killing her in the crossfire of a shootout with the Barker Gang, ruining the lives of competent agents like Melvin Purvis so he could claim all the credit of their work for himself, as well as allegations such as being blackmailed by the mob for being a transvestite, have done much to blacken the name of the FBI under his tenure. Now, the image of the FBI is about stressing how much they have moved beyond Hoover's controversial legacy, something not helped by the fact that their headquarters still bears Hoover's name.
It's worth noting that this kind of public perception is almost completely an American phenomenon, without equivalents in other countries, due to the FBI's unusual role as both a day-to-day police force and a semi-covert counter-espionage and state security organisation. For example, both the FSB (successor to the infamous KGB), the internal intelligence agency and the SVR, the external intelligence agency of Russia both suffer a poor reputation amongst Russian citizens due to corruption and political suppression. The FBI's day-to-day law enforcement role is doubly useful for the FBI's reputation because Americans have long tended toward reverence for police. It's also worth noting that people from Latin American countries will often see the CIA as evil due to slightly different reasons: rather than kidnapping, torturing and violating the rights of the citizens of these countries, the CIA has a history of toppling democracies and propping up regimes that did the same, especially during the Cold War.
This is not to say that there haven't been cases where the FBI has been portrayed as just as bad as—or worse than—the CIA, whether by being involved in corruption, or at least ignoring it to further its own agenda.
Compare Sinister Spy Agency, especially as it applies to the National Security Agency (NSA) being increasingly portrayed in fiction (especially as of the 21st century) as engaging in the same kind of dirty operations as the CIA, or even being a full-fledged State Sec of the United States, staffed exclusively by Obstructive Bureaucrats. This is likely a result of the agency's notorious secrecy. As the agency responsible for signals intelligence (SIGINT), i.e., intercepting and decrypting the communications of rival and hostile groups, they would not engage in CIA-style fieldwork. (Although they could and have engage in other naughty business.)
Subtrope of Good Policing, Evil Policing, which is about moral contrasts between law enforcement agencies and officials in general.
Due to the frequency of reveals regarding this trope, this page is Spoilers Off. You Have Been Warned.
CIA Evil, FBI Good:
- Fall of Liberty: The FIB are briefly mentioned to be fighting alongside the LCPD against the zombies. The CIA on the other hand are partaking in clandestine operations, which include killing LCPD officers, civilians, causing tons of collateral damage. All in the name of national security.
- All the President's Men: The movie highlights that Howard Hunt and the Watergate burglars were veterans of the CIA, while the FBI agents are shown cooperating with Woodward and Bernstein's investigation despite interference from above (not to mention the fact that Deep Throat turned out to be the FBI Deputy Director, W. Mark Felt). The movie ignores that Nixon's FBI Director, L. Patrick Gray, played a major role in the cover-up and that Gordon Liddy, who orchestrated the burglary, was a former FBI agent.
- The Report: The FBI is portrayed as being more concerned with legality and prisoner care, in contrast with the CIA who are looking for excuses to torture prisoners.
- The Siege: Denzel Washington plays an FBI Agent trying to catch the terrorists the right way, while Annette Bening plays the CIA Agent who trained the terrorists, and is willing to cut any corner to stop them, feeling remorse for what she's done. (Both are still on the side of the angels, compared to Bruce Willis's army general, and even he's somewhat sympathetic.)
- Transformers: Age of Extinction: Whereas heroic (if weird) Agent Simmons was initially distrusting of the Autobots but eventually warms up to them and was a member of Sector Seven, a subdivision of the FBI, Harold Attinger is a CIA agent, and utterly ruthless in his pursuit of getting rid of any and all aliens.
- Downplayed in Big Trouble by Dave Barry (more like "CIA Dumb, FBI Smart"): two FBI agents are tracking a suitcase nuclear bomb in Miami, and explain to a local police detective that they were following the terrorist who was supposed to collect it at La Guardia Airport in New York, except "some dickwad secret agents from a certain federal agency that I will not identify here except by the initials C, I, and A" had also been watching him, mistakenly thought he was attempting to flee the country, and grabbed him before he got to the airport, spooking the courier and sending the bomb to a random location.
- The General's President: The CIA is not portrayed in a particular positive light in the book, with guards outside its headquarters gassing and attacking non-violent protesters. It's Director, Carlton Blackburn, is later revealed to be a member of the Holist Council and carrying out illegal psychotropic drug experiments on people. In contrast, the FBI is shown to be valiant, loyal and friendly, with President Haugen relying on FBI Director Peter Dirksma to gather intel on the treacherous Blackburn and later arrest him.
- In the Ryanverse the CIA was initially a rather shady bunch while the FBI has always been made up entirely of straight-shooting angels who recite the constitution to their kids before going to bed. However, by the time Ryan himself takes the helm of the CIA the agency has gotten a lift in both ethics and image. Most prominent example would be Clear and Present Danger where the FBI is enlisted by the heroes to thwart the unlawful scheme involving the CIA and the President's National Security Adviser that's going downhill fast.
- The Sisterhood Series: Played as straight as an arrow! The Vigilantes have to fight Henry "Hank" Jellicoe, a CIA agent gone rogue. At one point between a conversation between a former FBI director and a former CIA director, the ex-CIA director says that he has no redeeming qualities at all, while the ex-FBI director can say that he's been kind to children and puppies.
- The Swedish cop show Arne Dahl had an extreme example, with a CIA agent who was also a serial murderer torturing and killing members of a human rights group investigating American torture in Iraq, and trying to frame them as terrorists. A heroic FBI agent helped the Swedish regular characters hunt him down and rescue the human rights group and innocent Iraqis from a back-up CIA death squad.
- Castle: Both the CIA & FBI have appeared throughout the series. For the most part, while the FBI and NYPD have Jurisdiction Friction and Obstructive Bureaucrats, they're decent folk. Meanwhile, except for a few occasions, whenever the CIA gets involved, things are much shadier and sometimes outright antagonistic. The biggest example is in Season 8, when we find out that Senator Bracken had a partner in the CIA who was covering up his dirty money dealings and now appears to be the show's new Big Bad.
- Throughout NCIS, Team Gibbs has crossed paths with both agencies. The FBI has typically been represented by Tobias Fornell, who comes across as a Jerk with a Heart of Gold; despite sometimes arguing with the team, he's usually amenable to working with them and seems to be Vitriolic Best Friends with Gibbs. The CIA, on the other hand, hasbeen represented by Trent Kort, a Smug Snake who turns out to be a traitor.
- The spinoffs don't fare any better. NCIS: Los Angeles tends to treat the CIA with a very distant case of paranoia at best, and gets the fallout of an antagonistic CIA squad gone rogue, trying to murder the crew because they interfered with their operations in Afghanistan. NCIS: New Orleans tends to have foolish CIA handlers and rogue agents aplenty, with one trying to work an arms dealer and giving him access to deadly weapons that risks major collateral. She gets killed when she fails to reign him in, and NCIS have to clean up her mess. In both cases, the FBI tend to generally just cause Jurisdiction Friction and be after the same bad guys by comparison.
- In Person of Interest, the CIA look like a bunch of cold-blooded killers that the FBI wants to take down, while the FBI is trying to prevent their machinations. Agent Snow in particular loves to use the You Have Outlived Your Usefulness trope on anyone that works for him. In several instances, the CIA is actually behind the criminal rings the protagonists are fighting. There's also Northern Lights, a related organization focused on anti-terrorism with similar scope and authority; they may mean well but they're very "ends justify the means" and have no objection to killing anyone who gets in their way. And MI-6 shows up at one point and is, surprise, also corrupt. The three agencies each contribute to the Rogue Agent pile-up that is the show, as agents keep figuring out it isn't healthy to stay with their respective teams.
- WandaVision:Over the course of the series, S.W.O.R.D. director Tyler Hayward and his personnel take on the role of the CIA becoming more and more antagonistic towards Wanda and anyone who might show sympathy towards her, culminating in him activating White Vision to destroy her. This is a sharp contrast to FBI agent Jimmy Woo, who wants to understand the whole situation before assigning wholesale blame and eventually works with Monica and Darcy to assist Wanda and thwart Hayward's actions. By the series finale, Jimmy ends up bringing in the rest of the FBI to arrest Hayward for his crimes and take control of the clean up.
FBI Evil, CIA Good:
- In most of Dale Brown's work, the CIA either doesn't appear or is portrayed relatively neutrally. The FBI, however, spend most of their time interfering with our perpetually-right heroes, going to absolutely absurd lengths in A Time For Patriots, where they blackmail and injure McLanahan's son Bradley so as to force some sort of confession out of him. This turns into something of a subtle Author Tract when you hear about Brown getting caught in a tax dodge by the FBI back in 2004 - when the negative portrayals of the FBI started.
- In Alias, the good guys all work for the CIA, while the FBI is involved in the Ancient Conspiracy. Virtually all FBI agents depicted are either misguided or actively malevolent, and a significant storyline in season two is the FBI putting Sydney through a tribunal for being a suspected terrorist.
- The Sandbaggers: The CIA are generally portrayed as helpful, and in particular Burnside has a very close working relationship with the CIA's London section chief, Jeff Ross. The show has a Conspiracy Theorist view of American domestic politics that looks peculiar to American eyes, and the FBI is part of it. According to Ross (and apparently, this was really according to Mackintosh), the FBI was behind the Kennedy and King assassinations.
- Hitman: Smith is an upstanding (if incompetent) CIA agent who has the best interests of his country at heart. The terror ringleader of Blood Money on the other hand, is a former Director of the FBI. This further complicated by Cayne's vast network of friends in the other agencies—including one Agent Martinez, a bag man for the CIA.
- Perfect Dark: The CIA agents are treated the same as other civilians and cannot be killed, while the FBI agents are armed and can be. In fact, it's the NSA that are depicted as villains, since they're part of The Conspiracy against the President.
Other Moral Contrasts:
- A People's History of the American Empire: Both CIA and FBI are portrayed as sinister organizations with unchecked power, as opposed to having one organization be benevolent by comparison.
- The "Mitch Rapp" series by Vince Flynn plays with the CIA/FBI moral contrast concept quite interestingly. The CIA protagonists are all patriotic, skilled and dedicated people who do terrible and completely illegal things to the enemies of the West (mostly but not exclusively Islamic terrorists). The FBI are equally patriotic, skilled and dedicated people who interfere, obstruct and generally try to prevent the actions of the CIA people because they believe in the rule of law over expediency. Both are portrayed as correct in their view, though the author clearly and frequently makes the point that by the time the FBI follows all of their rules, the bad guys will have escaped and done other bad things. The actions of the CIA people are evil, but they both share the good motivations of protecting America from truly evil people, though their methods are diametrically opposed to each other.
- The television side of the Marvel Cinematic Universe tended to take a more nuanced view of this (especially with other fictional agencies [such as the ubiquitous S.H.I.E.L.D.] and their competitors tending to provide the cloak-and-dagger drama and corruption expected). Nevertheless, both the CIA and FBI do exist, and both have their 'good cop' representatives in the person of Everett Ross and Jimmy Woo. These two have served as Inspector Javert to the main-cast superheroes as well as Friend on the Force, rounding out both of them as Reasonable Authority Figure. Their respective head offices, however, have 'red' on their ledger, so to say:
- The Punisher (2017): Frank Castle's entire family was killed by a CIA black ops group that was trying to kill Frank so he couldn't blow the whistle on war crimes they engaged in over in Afghanistan.
- Daredevil (2015): In its third (and final season), the New York field office of the FBI, despite presenting themselves as actively involved in handling and curtailing the liberty of Wilson Fisk / The Kingpin, he slowly but surely corrupts them all to his influence.
- Grand Theft Auto series:
- Grand Theft Auto IV: While their rivalry with the FIB (the in-universe stand-in for the FBI) is only indirectly alluded to, the United Liberty Paper, a front for the IAA (the in-universe stand-in for the CIA) is shown to be just about the most trustworthy faction in the game, in spite of the ULP's head agent's slightly abrupt nature; for Niko, they reward his service with the information (and the person) he requires without issue.
- Grand Theft Auto V: Following on from GTA IV, the FIB and IAA are both portrayed as corrupt organizations engaged in perhaps the most irresponsible inter-service rivalry in the history of fiction. The FIB forces the protagonists to commit various crimes that result in untold mayhem and destruction to thwart a plot by the IAA to allow a terrorist attack on US soil so they can get more funding to prevent terrorist attacks, though it should be noted that aside from their willingness to use the Jack Bauer Interrogation Technique, which the FIB tops with Cold-Blooded Torture, the only evidence we really have for IAA wrongdoing comes from the mouths of the very corrupt FIB agents that are working against them. Agent 14, an IAA agent who appears in Grand Theft Auto Online, is shown to be a much more reliable contact than FIB goon Steve Haines in the main game. The situation ends up escalating into a massive Mexican Standoff turned Blast Out between the IAA, two different FIB factions, two of the protagonists, and Merryweather's private army (who got involved because one of said protagonists kept wrecking their operations in multiple failed attempts to steal valuable items).