A CIA agent claims that his bosses torpedoed his career because he wrote a fictional portrayal of the agency that they didn’t take kindly to.

Using the alias Jim Markson, the man filed a federal lawsuit against the CIA and a host of unnamed officers that accuses them of retaliating against him because of the manuscript.

Bristling at his tale of dysfunction within the ranks, CIA brass also objected to his use of “classified” code words and phrases — including “conch fritters” and “tropical breeze.”

“A secondary theme of the above draft manuscript involves the fictional intelligence officer’s struggle with dysfunctional supervisors and managers that the agency employed/tolerated,” according to the Virginia federal lawsuit.

“The draft manuscript paints a fictional portrait of the CIA and the Intelligence Community, spinning yarns of bureaucratic intrigue, abuse, and frustration. Despite this very credible bureaucratic employment setting, all material aspects of the plot were drawn strictly from Markson’s imagination,” the suit states.

But the plaintiff claimed that agency’s reaction was far from fictional — and that they even yanked him from a coveted foreign mission after reading his problematic prose.

Markson is seeking punitive and compensatory damages and claims that the hassles prevented him from releasing the book during a timely period after the Boston Marathon bombings.

“It concludes with the arrest of fictional terrorists who were conspiring to conduct massive biological attacks against opening day professional football games in close proximity to the 10-year anniversary of the real terrorist attacks of September 11, 2001,” the complaint states of the book.