Dr. Mitchell wrote that he and Dr. Jessen sequestered prisoners in closed boxes, forced them to hold painful positions for hours and prevented them from sleeping for days. He also takes credit for suggesting and implementing waterboarding — covering a detainee’s face with a cloth and pouring water over it to simulate the sensation of drowning — among other now-banned techniques. “Although they were unpleasant, their use protected detainees from being subjected to unproven and perhaps harsher techniques made up on the fly that could have been much worse,” he wrote. C.I.A. officers, he added, “had already decided to get rough.”

Mr. Obama declined to open a broad inquiry into the treatment of terrorism suspects, saying as president-elect that the nation needed to “look forward.” He did not rule out prosecuting those who went beyond techniques authorized by the Justice Department, but no one has been charged with those offenses under his watch. During the George W. Bush administration, a C.I.A. contractor was convicted in the death of an Afghan detainee at an American military base in Afghanistan.

Henry F. Schuelke, a Washington lawyer with the firm Blank Rome, who represents Dr. Mitchell and Dr. Jessen, said that he believed his clients “were left holding the bag” while C.I.A. officials involved in the program have been protected from the lawsuit. “The government and its officers, namely many of the C.I.A. officers, enjoy sovereign immunity,” Mr. Schuelke said in an interview.

Image Gul Rahman, an Afghan captured in November 2002, was found dead in a secret C.I.A. prison. A representative of his estate is a party to the lawsuit against the two C.I.A. contractors. Credit... Habib Rahman, vis Associated Press

Mr. Schuelke and colleagues have argued in court that the senior United States District Court judge, Justin L. Quackenbush, should dismiss the case because, among other reasons, “sovereign immunity” extended to their clients, who were acting on the government’s behalf. But the judge denied the motion and the case has proceeded under the Alien Tort Statute, which allows foreigners to sue in United States court for violations of their human rights.

If the former detainees are successful, it would be the first time a United States civilian court has held individuals accountable for their role in developing counterterrorism policies after the Sept. 11, 2001, attacks. “All of the other cases have been thrown out on procedural grounds,” said Jonathan Hafetz, a professor at Seton Hall Law School. “If this is successful, it could pave the way for other torture victims to seek redress.” Still, some lawyers say it could be difficult for the plaintiffs to prevail.

The case has proceeded in large part because the psychologists’ role in the program has already been documented, particularly in the declassified executive summary of a Senate Intelligence Committee investigation of the interrogation program released in 2014. While the Justice Department has fought to restrict the scope of sensitive information that it has been asked to produce in the case, it has thus far not asserted the state secrets privilege, a broad power to protect national security that could effectively shut down the suit. That could change, analysts say, under the Justice Department in the Trump administration. Representatives for Mr. Trump did not reply to requests for comment on the case, scheduled for trial in June 2017.