Question: Can a soldier be court-martialed for revealing intelligence while in duress? Let's say a soldier is captured and then tortured by Russian agents to reveal critical top-secret intelligence to the Russian government. Can the soldier be then court-martialed in the U.S. for treason or some other crime?

Answer: 
[2019 Manual for Courts-Martial](https://jsc.defense.gov/Portals/99/Documents/2019%20MCM%20(Final)%20(20190108).pdf?ver=2019-01-11-115724-610), Rule 916(h):

> 
> (h) Coercion or duress. It is a defense to any offense
> except killing an innocent person that the accused’s
> participation in the offense was caused by a reasonable
> apprehension that the accused or another innocent
> person would be immediately killed or would
> immediately suffer serious bodily injury if the accused
> did not commit the act. The apprehension must
> reasonably continue throughout the commission of the
> act. If the accused has any reasonable opportunity to
> avoid committing the act without subjecting the
> accused or another innocent person to the harm
> threatened, this defense shall not apply.
> 
> 
> 

So, if your hypothetical soldier asserts they had a reasonable apprehension that they would have immediately suffered serious bodily injury if they didn't reveal the intelligence, then they should not be convicted by a court-martial, unless the prosecution can prove beyond a reasonable doubt that this was not the case (Rule 916 (b)(1)).
While the basic answer has already been given it's worth noting the Constitution [says](https://constitution.congress.gov/browse/essay/artIII_S3_C1_1_2/) the following about treason:

> 
> 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.
> 
> 
> 

It seems pretty clear based on the various [articles](https://www.criminaldefenselawyer.com/resources/treason.htm) I've read that SCOTUS would probably read that provision as not including aid given under duress (wouldn't be surprised if it's even in an opinion somewhere) so not only can you not now but Congress likely couldn't even change the law to make giving info under duress treason.

Of course, someone could always argue that the duress was merely for show or the like.