By the time you read this, Ana Belen Montes will have left the Admin Unit at Carswell Federal Medical Center in Fort Worth, Texas, her release scheduled for Jan. 8.

The prison has been home to some of the nation's most dangerous women, including Lynette "Squeaky" Fromme, a Charles Manson follower who attempted to assassinate President Gerald Ford in 1975, and Emma Coronel Aispuro, the wife of Mexican drug kingpin Joaquin "El Chapo" Guzman.

So how did this former federal government employee end up serving a 25-year sentence in "the world's worst sorority house"? She was caught spying for Cuba while working as a senior analyst for the Defense Intelligence Agency in Washington, D.C.

Montes is "sometimes called the most important spy you've never heard of," Jim Popkin writes in "Code Name Blue Wren," his account of how the "Queen of Cuba" was exposed. Even though her double-dealing ranks with "the two worst traitors in modern American history — Aldrich 'Rick' Ames at the CIA and Robert Hanssen at the FBI," her arrest in the immediate aftermath of 9/11 went virtually unnoticed.

"Code Name Blue Wren" corrects that. Even though Popkin was unable to interview Montes — she was barred from speaking to reporters and authors as a requirement of her plea bargain — a portrait emerges of a complicated, narcissistic, tightly wound woman who excelled at her day job, earning accolades as she became one of the top experts on Cuba, and was equally successful at her side hustle, giving the Castro regime information that "poisoned nearly every secret plan that American intelligence officials hatched in Cuba."

Although Montes' voice is missed, details from hundreds of interviews, court records, a classified CIA behavioral analysis and exclusive access to her letters and her parents' unpublished autobiographies flesh out Montes' days leading up to and including the 17 years she spent as a secret agent. The actual work of spying is a grind, as it turns out.

Montes spent long hours memorizing documents — early on she eschewed handing over paper records — and she had no one to talk to. Her handlers often "would go completely dark when they sensed danger"; co-workers were off-limits, for obvious reasons; and most of her siblings worked for the FBI. Her days were mainly work, working out and spying.

Such a buttoned-down subject could have proved boring, but the ins and outs of spycraft — amateur radio operators still search for numeric broadcasts that give spies their orders, a relic from the Cold War still in use — and the interagency fighting that surrounded the Montes espionage case are fascinating and sometimes humorous reading.

"The world of counterintelligence is very weird, and nobody trusts anybody," a National Security Agency employee notes, an understatement if there ever was one as counterintelligence officials refer to one another as "morons" and "dweebs" and an element of farce prolongs the rooting out of Montes.

It's a miracle she was ever caught. But she was, and Popkin keeps the reader hooked until the handcuffs are slapped on, and beyond.

Maren Longbella is a Star Tribune copy editor.

Code Name Blue Wren

By: Jim Popkin.

Publisher: Hanover Square Press, 351 pages, $27.99.