The most important choice facing New York voters this fall is whom they will pick as their next state attorney general. The office could be the last line of defense against an antidemocratic president, a federal government indifferent to environmental and consumer protection and a state government in which ethics can seem a mere inconvenience.

Even in the best of times the office plays a critical role, policing fraud on Wall Street and ensuring enforcement of state and federal laws, from regulating the financial system to preventing employment discrimination. Its influence is felt across the nation.

These are not the best of times. With the right leadership, the office could serve as a firewall if President Trump pardons senior aides, dismisses the special counsel, Robert Mueller, or attacks the foundations of state power. Only a handful of American institutions are equipped to resist such assaults on constitutional authority, and the New York attorney general’s office, with 650 lawyers and a history of muscular law enforcement, is one of them.

The next attorney general will have a full docket in New York as well. Albany has long been a chamber of ethical horrors. In March, Gov. Andrew Cuomo’s former senior aide Joseph Percoco was convicted on corruption charges. In May, former Assembly Speaker Sheldon Silver, a Democrat, was also convicted of corruption. In July, the former Republican Senate majority leader, Dean Skelos, was convicted of bribery, extortion and conspiracy. Prosecutors said he used his office to pressure businesses to pay his son $300,000 for no-show jobs. The same month, Alain Kaloyeros, a key figure behind Mr. Cuomo’s “Buffalo Billion” economic initiative, was convicted in a bid-rigging scheme.