Walter Shaub Jr. announced his resignation as director of the Office of Government Ethics on Thursday, plunging the federal government’s top ethics watchdog agency into limbo. President Trump now has the chance to appoint an accommodating loyalist who’d give him far less trouble than Mr. Shaub has. Or he could surprise us, and name another independent director committed to the ethical rules of public service. The president’s past behavior doesn’t offer much hope, but it would be in his long-term interest to choose a director with integrity.

The 70-person O.G.E. works with some 4,500 executive branch ethics officials whose goal is preventing conflicts of interest among 2.5 million civilian federal employees. The energy, commitment and character of the person at the top is crucial to the office’s success, not least because it has no real enforcement power. Its influence derives from a mix of financial disclosure rules, public pressure and, ideally, White House support for its mission of ensuring that civil servants act on the behalf of Americans, not themselves.

The office has had no such backing in its grinding battles with the Trump administration, whose appointees, some of the wealthiest nominees in history, resisted demands that they sell off businesses and assets that presented potential conflicts of interest. After a long confrontation, Mr. Shaub won one battle, forcing the administration to disclose the names of officials in Mr. Trump’s inner circle who had been granted waivers from the White House’s pledge to avoid conflicts of interest. It was a hollow victory, since all those officials were allowed to go about their business as usual.