If you are going to leak very classified information, its probably best to be the head of the CIA and not a low-level analyst, as the results of the Petraeus scandal show:
David Petraeus, the retired US army general and former CIA director responsible for the development of the hugely influential “counter-insurgency” strategy used in Iraq and Afghanistan, was sentenced on Thursday to two years’ probation and ordered to pay a fine of $100,000 for sharing highly classified information with his lover and biographer, Paula Broadwell.
Patraeus not only leaked, he later lied:
But the saga wasn’t over. After Petraeus resigned, it emerged that Broadwell had been given a set of eight notebooks which contained classified information – including codewords and military strategy – by the general.
Initially Petraeus lied to investigators, saying that following his resignation from the CIA he had no classified documents in his possession. However, an FBI search of the general’s house in April 2013 found the notebooks in an unlocked drawer in his study.
But... its all ok, because he is the 'mastermind' behind "The Surge" that after ISIS, etc... is for some reason being touted as a success.
The Guardian helpfully points out that not all leaks are treated equal:
Other leaks of classified information have led to heavy sentences. Chelsea Manning, who leaked a trove of classified documents to Wikileaks, was sentenced to 35 years by a military court in August 2013. Stephen Kim, a former state department official, was sentenced to 13 months in prison the same year after pleading guilty to discussing a classified report with a Fox News reporter in 2009.
Manning, Kim, and Petraeus were all prosecuted under the same act - Title 18 of the US code, known as the Espionage Act.