In "Pandora" and Linchpin", the investigation of a murder leads Castle and Beckett to reunite with Sophia Turner, a CIA operative on whom he based a major character. Beckett shows some jealousy at how the two are close and Turner tells Beckett that after she and Rick became involved, it was the beginning of the end of their partnership. The trio work together to stop a plot that could escalate into World War III. However, Sophia turns out to not only be part of the plot but is actually a KGB mole who infiltrated the CIA only to be left on her own when the Soviet Union collapsed. Holding Beckett and Castle at gunpoint, she hints that Castle's father was in the CIA and that was why he gained access years ago. She is killed by a true CIA agent as Beckett and Castle help stop the plot. While mourning Sophia, Castle admits to Beckett that she was much truer to the character he created.