For those alarmed by President Trump’s assaults on the rule of law, there have been two versions of Deputy Attorney General Rod Rosenstein. The good one appointed the special counsel, Robert Mueller; defended him; and has allowed the investigation to take its course. The bad one gave Mr. Trump cover to fire the F.B.I. director, James Comey; released private text messages of F.B.I. employees; and complimented the president in public.

But Mr. Rosenstein deserves praise because of — not despite — his occasional willingness to appease Mr. Trump. Without making compromises, he would have been long gone. Many people fear that if Mr. Trump were to fire Mr. Rosenstein, it would imperil the Mueller investigation. The same has been true for almost a year; the earlier Mr. Rosenstein had been forced out of office, the worse the possible damage. A successor to Mr. Rosenstein could fire Mr. Mueller, limit the scope of his investigation, decline to approve investigative steps or eliminate public reporting requirements — not to mention interfere with the separate investigation into Mr. Trump’s longtime lawyer, Michael Cohen.

Last May, Mr. Rosenstein wrote a memo to Attorney General Jeff Sessions, “Restoring Public Confidence in the F.B.I.,” that excoriated Mr. Comey for his handling of the investigation into Hillary Clinton’s emails: in particular, his July 5, 2016, news conference, in which he criticized Mrs. Clinton harshly while announcing she would not be charged, and his Oct. 28, 2016, letter in which he said the investigation would be reopened because of newly discovered emails. Mr. Sessions forwarded that memo to the president with a recommendation that Mr. Trump fire Mr. Comey, which the president did the same day.

Mr. Rosenstein immediately came under attack for writing a memo that he knew would be used to disguise Mr. Trump’s true motivation for removing Mr. Comey.