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)).
Convictions are automatic if intelligence is shared, but courts-martial tend to take a dim view of soldiers who succumb to duress. The case of [Bowe Bergdahl](https://en.wikipedia.org/wiki/Bowe_Bergdahl), a U.S. soldiers captured and tortured by the Taliban, and then convicted in a court martial after he was returned to U.S. forces, is a case in point.