By definition and disposition, the spy presents a daunting challenge to the historian. Expected to be elusive and deceptive, secret agents prefer to swallow written evidence, not preserve it. Then, if they survive to write memoirs, they often aggrandize their achievements at the expense of truth.

Douglas Waller has confronted such obstacles before. His previous books include a biography of William J. “Wild Bill” Donovan, head of the World War II OSS, and a study of future CIA directors who launched their intelligence careers with the same agency.

Donovan served capably as Franklin D. Roosevelt’s “Coordinator of Information.” Unfortunately, Abraham Lincoln had no “Wild Bill” at his disposal to direct Union intelligence operations during the Civil War. In fact, as Mr. Waller repeatedly demonstrates in this fast-paced, fact-rich account, Union espionage operations remained essentially uncoordinated, however plucky. That makes Mr. Waller’s achievement in unearthing these complex stories—and assembling them in riveting fashion—all the more laudable.

Mr. Waller focuses principally on a quartet of Eastern operatives—three men and a woman—revealing some to be as proficient as press agents as they were as secret agents: Allan Pinkerton, George Sharpe, Lafayette C. Baker and Elizabeth Van Lew. A well-meshed team of information gatherers they did not make, requiring Mr. Waller to balance and assess their stories to build an ultimately definitive history of state-run Civil War spycraft.

The best-known of the four is the Scottish-born detective Pinkerton (alias “E.J. Allen”). Before the war, Pinkerton had served primarily as a railroad investigator, focusing on mundane targets like train robbers and track saboteurs. Then he got a tip in February 1861 that President-elect Lincoln was at risk of violence when he reached Baltimore en route to his inauguration later that month. Hastening to Philadelphia, where Lincoln was to speak on Washington’s Birthday, the detective talked Lincoln into passing secretly through Maryland’s secessionist hotbed (“like a thief in the night,” he later admitted) to evade the would-be assassins.