IN A Senate hearing Wednesday, Christopher A. Wray, President Trump’s nominee to head the Federal Bureau of Investigation, delivered the pledges the public needed to hear from a man on track to lead the nation’s premier law enforcement agency at a perilous moment. Much may depend on his living up to those pledges.

Mr. Wray’s hearing occurred as the nation continued to process a newly public email conversation involving Donald Trump Jr. showing that the president’s son and possibly other top members of the Trump campaign not only knew about Russian attempts to help his father but also enthusiastically welcomed Kremlin assistance. President Trump had previously questioned whether there was any Russian influence plot at all, denied that his campaign colluded with Moscow and attacked those investigating these matters.

Mr. Wray bore a special responsibility to assure lawmakers and the public that he would support a fair investigation into the administration of the man who appointed him, resisting any bullying or blandishments. He promised he would “never allow the FBI’s work to be driven by anything other than the facts, the law and the impartial pursuit of justice, period, full stop.” He repeatedly asserted that he had not been asked and did not offer any pledge of loyalty to the president, detailing conversations he had with administration officials. He said that special counsel Robert S. Mueller III’s Russia investigation was not a “witch hunt,” contrary to Mr. Trump’s view as expressed in tweets, and he promised to support it, including by protecting it from political interference.

Mr. Wray condemned foreign efforts to influence U.S. elections and indicated that the younger Mr. Trump should have reported any offer of Russian government campaign help to the FBI. He said it was important for law enforcement to work with, not demonize, the Muslim community. He promised to resign rather than carry out illegal or unethical orders.

During the questioning, senator after senator bemoaned the public’s eroding trust in government institutions and expressed hope that Mr. Wray could help the FBI’s reputation. If they are so concerned about restoring public trust in government, they could start with demanding better from their colleagues and leaders. As with so many disturbing events over the past year, the predominant GOP response to the latest email revelations has been to play down their significance, either explicitly — Rep. Marsha Blackburn (R-Tenn.), for one, speculated that the younger Mr. Trump may have been “duped” — or implicitly by failing to publicly acknowledge how disturbing they are. Senate Majority Leader Mitch McConnell (R-Ky.) and House Speaker Paul D. Ryan (R-Wis.) have taken the latter route.

The White House reaction, meanwhile, has been not to condemn any solicitation of or cooperation with a Kremlin influence campaign, or to walk back any of Mr. Trump’s statements undermining the Russia probe, but to praise his son’s supposed transparency, decry “fake” news and attack leakers. The president absolved his son in a Wednesday Reuters interview, saying incorrectly that “many people” would have done what he did.

Mr. Wray’s testimony Wednesday was encouraging, but it will take more than an FBI director of integrity to restore faith in government. Lawmakers, too, must show that they deserve public trust. The Republican majority in Congress is failing that test.