John André was a famous player in espionage during the U.S. Revolutionary War. He was frequently a target of U.S. agents. Specifically the Cupler Ring, run by General Washington himself. But André was also doing everything in his power to collect information for the British. In 1779, André took charge of the British Secret Service. By 1780 he established communications with the disillusioned American General Benedict Arnold (Arnold’s wife, Peggy Shippen, was a close friend of André’s (and by close friend we mean, wink wink, close, close friend). Shippen became a go-between between André and Arnold.
André frequently found himself behind enemy lines, and was caught and captured. The details around this are clear, André could have avoided capture and after capture could have avoided suspicion if he kept his wits about him. But instead he opened his big mouth and assumed the people arresting him were British and told them he was a spy. Bad move in hindsight.
He was hung as a spy on 2 Oct 1780. This is after the British failed to agree to a prisoner exchange. They really could have saved him.