Is disclosing a trade secret only to a judge in court, as happened in &quot;The Prestige&quot;, something that could happen in reality?
<p>The 2006 film <em><a href="https://en.wikipedia.org/wiki/The_Prestige_(film)" rel="nofollow">The Prestige</a></em> begins with a magician drowning while performing a magic trick, with another man accused of murdering him. During the trial, the magician's engineer is asked to reveal the secrets of the trick where the magician died. He is reluctant to do so.</p>

<blockquote>
  <p><strong>Cutter:</strong> If I reveal my magician's secrets here in open court, I'll be
  unemployable and the secrets will be worthless. The Real Transported Man is the most sought-after illusion in the business and I have the right to
  sell it on.</p>
  
  <p><strong>Judge:</strong> Mr. Cutter, I see your predicament, but we are talking about a capital offence; Alfred Borden's life hangs in the balance.</p>
  
  <p>If you were prepared to disclose the details to me in private, I might be
  able to judge their relevance to the case. Might this be an acceptable compromise?</p>
</blockquote>

<p>Is this something that could happen in a real court session? I don't think there was a jury in this trial, but would that change the answer? If it matters, the movie takes place in 1900s London.</p>

<p>In a trial by judge (bench trial) that could certainly happen.</p>

<p><a href="http://www2.fjc.gov/sites/default/files/2012/Sealing_Guide.pdf" rel="nofollow">Most substantial parts of the judicial process can be sealed</a>, under numerous laws and theories.</p>

<p><a href="https://en.wikipedia.org/wiki/United_States_Foreign_Intelligence_Surveillance_Court#Secrecy" rel="nofollow">The U.S. FISA "Court"</a> is notorious for operating virtually entirely in secret.</p>

<p><a href="https://en.wikipedia.org/wiki/Warrant_canary" rel="nofollow">Various laws</a> allow for secret subpoenas or warrants, with the subjects on which they are served held <em>criminally liable</em> for violating the court's order for secrecy.</p>

<p>In a trial by jury it would probably be impossible for an exonerating fact to be presented to the judge only, since the proper role of the jury is to decide all questions of fact in a case.</p>

<p>Furthermore, a court can compel a witness to testify, with no requirement to mitigate the damages of such testimony.</p>

<p>However, if the accused knew that an exculpatory fact could be provided by a witness, and that the witness might decline to give (honest) testimony to a jury, he would presumably waive his right to a jury trial, at which point the testimony could (in theory) be given only to the judge.</p>

privacy trial judge