[Warning: This article contains major spoilers about Sunday's episode of NCIS: Los Angeles. Read at your own risk!]

We finally know who the mole is on NCIS: LA, but the knowledge may come at a huge cost -- particularly for Kensi (Daniela Ruah).

On Sunday's episode, the team discovers that they've been targeted by the CIA, as payback for Kensi's mission in Afghanistan that went awry a couple of years ago. In particular, Agents Vostanik Sabatino (Erik Palladino) -- who worked with Kensi in Afghanistan -- and CIA Officer Randall Sharov (Salvator Xuereb), aka "Balinski" whom we first met last season, when Callen (Chris O'Donnell) went under cover to find Arkady -- are behind the operation, with Sabatino slipping spyware into the NCIS systems via an email a couple of years ago.

And the nastiest twist: Remember Sullivan (Kurt Yaeger), Kensi's "friend" from rehab? Turns out he's a CIA agent too, whose real name is Ferris, and he was part of the con all along in order to get payback for Kensi shooting his leg off in Afghanistan, mistakenly believing him to be a member of the Taliban. And unfortunately for Kensi, even when all the other members of the operation have been killed and/or captured thanks to some heroics by Hetty (Linda Hunt), she's still locked in a room after being kidnapped by Sullivan/Ferris -- who is employing the "eye for an eye" rationale and, as the episode ends, is poised to take a chainsaw to one of her legs. (Wince.)

NCIS: LA's Miguel Ferrer dead at 61

Sadly, the other loose end that needs to be cleared up is that, for purposes of plot, Granger (Miguel Ferrer) is still in the hospital after being stabbed in the previous episode. However, as NCIS: LA fans know, Ferrer lost his battle with throat cancer last week. It remains to be seen whether Granger will succumb to his injuries, or be written out of the show some other way.

In the process of rooting out the mole, Callen, Sam (LL Cool J) and Deeks (Eric Christian Olsen) discover that it was actually Hetty who engineered their arrests and subsequent detainments in last week's episode, so that she could keep them safe while she went rogue to spring informant Karl Brown out of prison, to use as bait so that the CIA agents would track him down. Her plan went off without a hitch, down to her predicting that they would put her in a cage -- the perfect (and only safe) spot to be when she detonated a whole bunch of explosives at the warehouse where she had been holding Karl.

So, to recap, the entire mole operation was the CIA's way of getting payback on NCIS for interfering in the Middle East after the CIA warned the agents to mind their own business. Knowing Hetty, she's going to accept full responsibility for whatever happens to Kensi and Granger. Will she ever be able to forgive herself?

NCIS: LA airs Sundays at 8/7c on CBS.

(Full disclosure: TVGuide.com is owned by CBS.)