Tactical or battlefield intelligence became very vital to both armies in the field during the American Civil War. Units of spies and scouts reported directly to the commanders of armies in the field. They provided details on troop movements and strengths. The distinction between spies and scouts was one that had life or death consequences. If a suspect was seized while in disguise and not in his army's uniform, the sentence was often to be hanged. A spy named Will Talbot, a member of the 35th Battalion, Virginia Cavalry, was left behind in Gettysburg after his battalion had passed through the borough on June 26–27, 1863. He was captured, taken to Emmitsburg, Maryland, and executed on orders of Brig. Gen. John Buford.
American Civil War spies Wikipedia
Intelligence gathering for the Confederates was focused on Alexandria, Virginia, and the surrounding area.
Thomas Jordan created a network of agents that included Rose O'Neal Greenhow. Greenhow delivered reports to Jordan via the “Secret Line,” the name for the system used to get letters, intelligence reports, and other documents across the Potomac and Rappahannock rivers to Confederate officials.
The Confederacy’s Signal Corps was devoted primarily to communications and intercepts, but it also included a covert agency called the Confederate Secret Service Bureau, which ran espionage and counter-espionage operations in the North including two networks in Washington.
The Union's intelligence gathering initiatives were decentralized. Allan Pinkerton worked for Maj. Gen. George B. McClellan and created the United States Secret Service. Lafayette C. Baker conducted intelligence and security work for Lieutenant General Winfield Scott, commander-in-chief of the U.S. Army. President Abraham Lincoln hired William Alvin Lloyd to spy in the South and report to Lincoln directly.
As a brigadier general in Missouri, Ulysses S. Grant was ordered by Maj. Gen. John C. Frémont to start an intelligence organization. Grant came to understand the power of intelligence and later put Brig. Gen. Grenville M. Dodge as the head of his intelligence operations that covered an area from Mississippi to Georgia with as many as one hundred secret agents.
Maj. Gen. Joseph Hooker, who became commander of the Army of the Potomac in January 1863, ordered his deputy provost marshal, Col. George H. Sharpe, to create a unit to gather intelligence. Sharpe set up what he called the Bureau of Military Information and was aided by John C. Babcock, who had worked for Allan Pinkerton and had made maps for George B. McClellan. Sharpe’s bureau produced reports based on information collected from agents, prisoners of war, refugees, Southern newspapers, documents retrieved from battlefield corpses, and other sources. When Grant began his siege of Petersburg in June 1864, Sharpe had become Grant’s intelligence chief.
The most useful military intelligence of the American Civil War was probably provided to Union officers by slaves and smugglers. Intelligence provided by slaves and blacks were called black dispatches.