The Trump administration has invoked executive powers in a bid to block the testimony of several top C.I.A. officials in a federal lawsuit against two psychologists who helped run the agency’s harsh interrogation program, along with portions of 172 internal agency documents.

Hoping to prevent the officials, including Gina Haspel, the agency’s new deputy director, from being forced to testify, the administration is using the state secrets privilege, which means the executive branch is asking the judge in the case to keep information out of court by asserting that its disclosure would damage national security.

The government rarely tries to use the extraordinary power, and this is among the first assertions of it by the Trump administration. At an earlier phase of the case in Federal District Court in Spokane, Wash., the Obama administration did not invoke the privilege — although in court filings last year, it did leave the door open to doing so at a later stage.

The lawsuit was filed in 2015 by two former detainees at C.I.A. secret prisons overseas and the representative of a third man who died in custody. If they prevail in the suit against the former military psychologists, James E. Mitchell and Bruce Jessen, who helped devise and run the interrogation program, it would be the first time an American civilian court has held anyone accountable for a role in developing counterterrorism policies after the Sept. 11, 2001, attacks.