Treason against the United States, shall consist only in levying War against them, or in adhering to their Enemies, giving them Aid and Comfort. No Person shall be convicted of Treason unless on the Testimony of two Witnesses to the same overt Act, or on Confession in open Court.
This is generally taken to mean that one can't be convicted of treason for doing something that indirectly aids an enemy, which is what leaking secrets would probably fall under. Instead it's limited to cases where someone actively fights the U.S. (e.g. joined the Taliban, or during WW2 joined an Axis army), or where they give direct material assistance to an enemy of the U.S. ("adhering" is a bit vague, but is typically taken to require some kind of direct allegiance, not only helping them indirectly).
Some cases of espionage could be treason, but it's only been charged in the past where there is a very direct kind of espionage for someone else, e.g. an American being paid by the KGB.