As sexual assault cases proliferate, judges must weigh accusers’ requests for anonymity against the tradition of open courts and fairness toward defendants.The man said he was 14 years old when he was sexually assaulted by the actor Kevin Spacey in the early 1980s. Last year he filed a lawsuit against Mr. Spacey in which he sought to maintain anonymity, identifying himself in court papers only as “C.D.”Earlier this year the judge in the case, which is being heard in the Southern District in New York, ordered the man’s lawyers to identify him privately to Mr. Spacey’s lawyers. And this month the judge, Lewis A. Kaplan, went further: he ruled that C.D. would have to identify himself publicly if he wanted to continue on to trial.The man’s lawyers responded Thursday that he would not, writing that the “sudden unwanted attention that revelation of his identity will cause is simply too much for him to bear.” They said in a letter to the court that they expect him to be removed from the case — which involves another plaintiff, who is using his real name — but suggested that they plan to pursue an appeal.In the #MeToo era, as more people have been turning to civil courts with accounts of sexual assault, judges are increasingly being asked to weigh the strong desire of many accusers to maintain their anonymity against the presumption of openness in the court system and the ability of the accused to defend themselves.“It’s the idea of balancing an open court system with the idea of protecting someone’s right to seek relief,” said Jayne S. Ressler, an associate professor of law at Brooklyn Law School.While anonymity has long been allowed under certain limited circumstances if it protects an accuser from harassment or other harm, courts tend to weigh it against the general principle that complaints must name both the defendant and accuser.The issue tends to come down to whether the benefits of anonymity, and of allowing a victim to come forward freely, outweigh the public’s interest in being able to scrutinize what is happening in the courts and the defendant’s ability to mount an effective defense.People who work to combat sexual violence warn that requiring people to use their own names could discourage some victims from seeking justice.“The risk of being publicly identified is a huge deterrent to coming forward for many survivors of sexual violence,” said Erinn Robinson, a spokeswoman for RAINN, the Rape, Abuse and Incest National Network. “Decisions in these cases should always be made with a trauma-informed and victim-centered understanding of the impact this can have on survivors’ healing.”Harvey Weinstein arrives at State Supreme Court in Manhattan in February 2020.Desiree Rios for The New York TimesBut lawyers for the accused said that it is difficult to mount a defense against people who file cases anonymously, or using pseudonyms. “An increasing amount of lawsuits will attempt to be filed under a pseudonym, and that’s concerning because the justice system in our country has as its fabric an open court system and a level playing field,” said Imran H. Ansari, a lawyer who represents Harvey Weinstein.It is not uncommon these days for accusers to bring sexual assault cases anonymously and then, if they fail to negotiate settlements out of court, to be ordered by judges to come forward in their own name before taking their claims to trial, legal experts said.Last month, state court judges in Texas said that most of the 22 women who had sued Deshaun Watson, the Houston Texans star quarterback, had to identify themselves, even after they said they feared intimidation efforts.A judge in New York federal court last September denied a woman’s request to sue Mr. Weinstein anonymously. (The case has since been voluntarily withdrawn.)Professor Ressler said that though the principle of the open court still dominated many decisions, she had detected an uptick in sympathy from courts toward sexual assault plaintiffs suing anonymously.“It appears that some courts are less reluctant to allow anonymity, let’s put it like that,” she said. “Most judges do tend to rule against anonymity, but not all.”She pointed to a 2018 case in New York Supreme Court where a trial judge allowed a number of plaintiffs to proceed anonymously against a doctor, and a Massachusetts Superior Court case in 2019 when a court imposed anonymity on a plaintiff, who was a student.One of Mr. Spacey’s other accusers, a massage therapist who had accused Mr. Spacey of groping and trying to kiss him before offering him oral sex during a massage, was permitted by a federal judge in California to file a lawsuit under a pseudonym, although that case was dismissed after the plaintiff died unexpectedly ahead of the trial.Experts say that in the #MeToo era, some courts are becoming more understanding of the high costs sexual assault victims pay personally when they come forward publicly.There is also more acknowledgment that in the modern hyper-connected society, when information spreads widely and quickly online and remains easily searchable for years, there is less chance of privacy once a name becomes public.“There is a sense that your name can live on in perpetuity connected with something terrible, so you have to have a chance without your name being associated with it,” said Andrew Miltenberg, a lawyer who has represented men accused of sexual assault.Even so, Mr. Miltenberg said, eventually, “A judge tends to say, ‘Yes, you can proceed like that but know that if we end up in front of a jury, think very hard, because I am going to open the court.’”Mr. Spacey, 61, has faced a series of sexual misconduct allegations in recent years.In 2018, he was charged with sexual assault in Nantucket, Mass., after an 18-year-old man accused him of fondling him in a restaurant two years earlier. But prosecutors there dropped the case after the accuser invoked the Fifth Amendment and refused to continue testifying after Mr. Spacey’s lawyer warned that he could be charged with a felony if he had deleted evidence from his cellphone.In the most recent case, the plaintiff, identified as “C.D.,” claimed that he met Mr. Spacey as a teenager in an acting class in Westchester County in the early 1980s.According to the lawsuit, Mr. Spacey invited the student to his apartment when they met again a few years later and he was still a minor, and “engaged in sexual acts” with him on multiple different occasions. In their final encounter, Mr. Spacey assaulted the teenager despite his resisting and saying “no,” the lawsuit said.In an interview with BuzzFeed News in 2017, the actor Anthony Rapp accused Mr. Spacey of making an inappropriate sexual advance toward Mr. Rapp when he was 14.Evan Agostini/Invision, via Associated PressC.D. filed the lawsuit with another accuser, Anthony Rapp, who first made accusations against Mr. Spacey in 2017. Mr. Spacey has denied C.D.’s and Mr. Rapp’s sexual misconduct accusations.In court papers, lawyers for C.D. argued that he would suffer psychological trauma if his name became public.“The thought of my name being circulated in the media and on the internet and of people contacting me as a victim of Kevin Spacey terrifies me,” C.D. wrote in court papers.But the case raised questions about the difficulty of defending a sexual assault case when the accuser insists on remaining anonymous.Even after the court had ruled that Mr. Spacey’s lawyers should privately be told C.D.’s real name, they argued that their ability to conduct discovery and investigate C.D.’s claims would be hampered if he could maintain his anonymity toward the public. They would be unable to disclose his name to witnesses, they noted, while potential witnesses who could have relevant information might not come forward if his real name was not publicized.Mr. Spacey’s “ability to investigate and conduct discovery of CD’s claims and prepare for trial would be severely inhibited,” his lawyers wrote in legal documents.Judge Kaplan agreed.He conceded that privacy was diminished by the internet and that the case involved sensitive and personal issues, both points arguing for anonymity.However, in ruling for shedding anonymity, the judge emphasized that C.D. himself had spoken to people about Mr. Spacey as far back at the 1990s, and had given an anonymous interview about Mr. Spacey to Vulture in 2017. He also noted that C.D. is no longer a child.“Though CD brings allegations relating to alleged sexual abuse as a minor, he now is an adult in his 50s who has chosen to level serious charges against a defendant in the public eye,” Judge Kaplan wrote. “Fairness requires that he be prepared to stand behind his charges publicly.”Both a lawyer for C.D., Peter J. Saghir, and for Spacey, Chase A. Scolnick, declined to comment.Experts said criminal cases offer greater anonymity protection to sexual assault victims than civil cases. In civil claims, the two parties often try to negotiate a settlement, and in practice few cases in fact proceed to trial. A judge’s ruling to lift anonymity sometimes acts as a catalyst to force a settlement, legal experts said.Lawyers for plaintiffs say they urge their clients to be realistic when it comes to seeking anonymity.“When you represent these survivors you have to tell them, there is no guarantee you are going to be able to proceed anonymously,” said John C. Clune, a lawyer who represented a plaintiff who had to refile a case against Kobe Bryant under her real name in a 2004 civil case. “They know they have a fighting chance, but they are also prepared mentally in case they lose.” More