The Peregrine Spy by Edmund P. Murray
Frank Sullivan's assignment is to work for the CIA while officially serving as an adviser to the Iranian military. Once in Iran, his past relationship with the Shah places him at odds with the agency and the members of the revolution. Trying to survive a chaotic civil war is the least of his problems as he becomes involved in efforts to recruit a KGB agent and learn the identity of a mole back at Langley. But the closer he gets to his goals, the more likely he won't make it out alive..