Sophia was a CIA Agent who first appeared in the episode, "Pandora," where it was revealed that she had a romantic history with Castle, and she was Castle's inspiration for the character, Clara Strike, from Castle's "Derrick Storm" novels. Sophia brought in Castle and Beckett to assist in attempting to catch Thomas Gage, who was believed to be a traitorous agent masterminding a plot to kill the young daughter of a close friend of a highly important Chinese finance minister, which, if successful, could start World War III and result in the possible destruction of America.
In the climax of the aforementioned following episode, "Linchpin," Sophia turned heel and revealed herself as the mole behind the "Pandora plot," when she pointed a gun at Castle and Beckett. After her henchman disarmed Beckett, Sophia sent him to kill the young girl. Sophia's villainous plot was all revealed; she killed Nelson Blakely and his contact, Tracy McGrath, who was attempting to stop her plan, and then she killed Gage as well. As for a motive, the evil Sophia claimed that money was involved in setting off a huge war. Sophia laughed evilly and stated--in Russian--that America isn't even her country, meaning that she's a Russian sleeper agent. Sophia was planning to frame Martin Danberg for her own crimes, and taunted Castle by stating that his father was the only reason why he received access to the CIA. Right before she could pull the trigger, Sophia was shot and killed by Danberg.