Witness who is granted anonymity by the juridical authority
A secret witness (or anonymous witness) is a witness which is granted anonymity in a trial by the juridical authority. The identity of the witness is not disclosed to the defendant and the general public except if the secret witness agrees to it. It is a juridical procedure currently often used in Turkish law. Prominent examples are the case against Andrew Brunson and the Ergenekon trials. In several trials against politicians of the Peoples' Democratic Party (HDP) secret witnesses are also used. Following the attempted coup d'état in 2016, secret witnesses were used in many trials.
Poland.
An incognito witness ("świadek incognito"), also an anonymous witness ("świadek anonimowy"), is a witness who has been questioned in the course of criminal proceedings and whose circumstances allowing disclosure of his or her identity are not known to other participants in the proceedings, other than the prosecutor and the court, due to a well-founded fear of danger to the life, health, freedom or property of the witness or a person close to him or her.
Proceedings on the complaint are held without the participation of the parties and are classified as 'secret' or 'top secret'.
Turkey.
Evidence provided by the secret witness dubbed "Garson" was used in trials against 4000 Turkish police officers accused of being members of the Gülen movement. In the Kobani trial, the former Mayor of Diyarbakır Gültan Kişanak is accused by secret witnesses of organizing the Kobanî protests supporting the Kurds during the Siege of Kobanî by the Islamic State (IS). 
Eren Erdem of the Republican People's Party (CHP) was prosecuted for revealing the identity of a secret witness but found not guilty of the crime and his release was ordered in January 2019. However, the prosecution issued a new arrest warrant the day after the verdict alleging a flight risk and Erdem was sentenced to over 4 years imprisonment due to a testimony of a secret witness on 1 March 2019. 
The American pastor Andrew Brunson was prosecuted also on grounds of testimony of a secret witness accusing him of supporting the creation of a Kurdish Christian state. Brunson was later released in 2018, following an alteration of the testimonies provided by three secret witnesses during the final day of the trial. During the Ergenekon trials against members of the so-called deep state of Turkey, Şemdin Sakık of the Kurdistan Workers' Party (PKK) acted as one of over 40 secret witnesses, but during the trial he decided to reveal his identity. In Turkey the use of secret witnesses has been a target for criticism by the Peoples' Democratic Party (HDP) but also of Nationalist Movement Party (MHP) Emma Sinclair-Webb of the Human Rights Watch, also condemned the use of secret witnesses in trials against mayors dismissed from public office in Turkey.
United Kingdom.
In the United Kingdom secret witnesses were used during the trial concerning the Murder of Charlene Ellis and Letisha Shakespeare. Other trials which potentially would have involved secret witnesses were suspended on grounds that the rights of the defendant were not guaranteed. Nevertheless, the use of secret witnesses is allowed according to British law, but if their use in trial is granted by a court, the prosecution is obliged to provide as much information as possible to the defense.