Over the years, he said, he has asked so many friends to represent civil servants in politically charged inquiries that “when these are going on, they don’t want to take my call.”

So far, nearly a dozen witnesses have cooperated with the inquiry, most of whom are still in the government.

Their pool of potential lawyers is restricted because ethics rules bar federal officials from accepting free or discounted legal services from lawyers that have business before their agencies, according to Virginia Canter, the chief ethics counsel for Citizens for Responsibility and Ethics in Washington, a nonprofit watchdog group. Exceptions are made if the lawyer is a friend.

And while senior government officials are sometimes encouraged to buy inexpensive legal liability insurance, the policies typically cover only the cost of a bargain-basement lawyer skilled in handling routine employment battles over issues like dismissals and discipline, according to one senior diplomat who is knowledgeable about such policies.

The witnesses in the impeachment inquiry need a higher caliber of legal advice because testifying is fraught with pitfalls. Witnesses still in government service could be risking their jobs by cooperating in defiance of a White House directive declaring the inquiry illegitimate.

None of them can fact-check their testimony against official records of meetings and phone calls because the administration is withholding such documents. But they must be mindful of what they say, because lying to Congress is a crime that carries a punishment of up to five years in prison.

Typically, Mr. Luskin said, he would have spent days going through officials records to prepare a witness like Mr. Sondland, the American ambassador to the European Union who testified for nearly nine hours this month. But the State Department has refused to turn over those documents, so Mr. Sondland testified based largely on memory.