In both The Secret of Flirting and The Risk of Rogues I mention that Hart sold his commission. In case you don’t know what that means, during the Georgian, Regency, and partway through the Victorian periods, the British army (but not the British navy, apparently) used a system by which gentleman could buy a commissioned officer rank, beginning at cornet or ensign, and then purchase commissions to rise in rank (up to the rank of colonel). These commissions weren’t cheap, by any means (go to this page about officer’s commissions to see the costs). A commission as a cornet cost 450 pounds in 1837, which is equivalent to 38,000 pounds now ($50,473.88). And you can well imagine how much it cost to become a major. So Hart, a younger son of a rich marquess, could easily go up the ranks to captain. That’s why you always hear about younger sons of rich men going into the military. Once they decided to retire, they could sell their commissions for the total amount of money they spent and have a nice nest egg. That’s what Hart did. It’s more complicated than I’m making it sound (some regiments, like the Royal Artillery, used merit for advancement, and there were other restrictions), but this is the system in a nutshell. Now you know why some of those officers were so young (and incompetent).
The truth about spying in the Regency is we know little about it. I’ve seen raging debates on author websites in which authors both proclaimed it didn’t really exist and proclaimed the opposite (see the debate here). I would imagine that the point of having spies is not to have them be noticed. Ahem. Anyway, aside from the book mentioned in the comments of the debate, there is also The Man Who Broke Napoleon’s Codes about Sir George Scovell, who was knighted for breaking the French codes. Colquhoun Grant very famously sent intelligence to Wellington as he sneaked around Paris, having escaped his captors. There is some possibility that Mary Nesbitt, too, was a spy. As a courtesan and artist’s model who later became a merchant banker’s wife, she was supposedly sent to France during the Revolution to move in diplomatic circles and report back to English prime minister William Pitt. So, yes, there’s some evidence of spies. Enough for me to use in a book, anyway!