united-states
Asked in court about something you are not allowed to answer
<p>Say you own a company in the USA that offers services via the internet. I read that in some situations, you are required to give personal data of a user to the US government and you are not allowed to tell anyone.</p>
<p>Now what happens if you are witness in a trial and questioned about this?</p>
<p>If you say you never gave user data to the government, you lie. If you say you are not allowed to answer, then it is clear that you did.</p>
<p>Or is such a question inadmissible in the first place?</p>

<p><a href="https://en.wikipedia.org/wiki/National_security_letter" rel="noreferrer">National security letters</a> can compel the production of some kinds of (non-&quot;content&quot;) user data, and (according to Wikipedia) typically contain a nondisclosure requirement forbidding the recipient of the letter from disclosing it. I assume that a witness has received and complied with a national security letter, and a non-government party wants to ask the witness questions which outside the courtroom, the witness would be forbidden to answer by the national security letter.</p>
<p>The witness, or the government if represented in the lawsuit in question, may object to the questions. The purpose which justifies the secrecy requirements of a national security letter is also likely to justify the exercise of <a href="https://en.wikipedia.org/wiki/State_secrets_privilege" rel="noreferrer">state secrets privilege</a>. If the judge thinks a statute might otherwise be violated, they might intervene in the absence of any objection, or consider alternative remedies like an <a href="https://en.wikipedia.org/wiki/In_camera" rel="noreferrer">in camera hearing</a>.</p>
<p>If the court does not intervene to prevent the evidence being given, and the witness is charged with breaching the secrecy law, this would raise complex questions about the interpretation of the law imposing criminal penalties. The common law doctrine of <a href="https://www.jstor.org/stable/43950134" rel="noreferrer">absolute privilege for witnesses</a> giving evidence in judicial proceedings <a href="https://www.jstor.org/stable/1109136" rel="noreferrer">applies in the United States</a>, and could be raised in defence to any criminal charges.</p>
