We know from the Bob Woodward and Robert Costa book “Peril” that the country came closer to a stolen presidential election than was previously reported. President Donald Trump’s lawyer John Eastman advised Vice President Mike Pence that he would be justified in single-handedly accepting some fake alternative slates of electors for states that Joe Biden won — on the grounds of supposed fraud in various states — and simply declare Trump the winner of the election. Pence would have done so on Jan. 6, when he sat in his ceremonial role as president of the Senate. Pence supposedly seriously considered the possibility, only to reject it upon getting sounder legal advice.

These machinations involving Pence came on top of at least 30 direct Trump contacts with election officials, elected officials and others to cajole Republican state legislatures to send in those alternative slates of electors. (None did, but Eastman’s plan pretended that they had.)

We dodged a bullet last time, and things are much worse now. Election officials have been leaving their jobs as they face threats of violence and harassment, and some of the people who will replace them have bought into the “big lie” that the 2020 election was stolen. Those are the people who will be in charge of counting the votes in some places next election. Simply put, we face a serious risk that election results will not reflect the will of the people in 2024 or some other future American presidential election.

Congress has the power to put up barriers to election theft, but the window is quickly closing. That’s because Democrats may soon lose control of one or both Houses of Congress, and Republicans, fearful of Trump or complicit in his plans, cannot be expected to take the lead on deterring election subversion.

Election integrity should be a nonpartisan issue, but like everything else it’s been polarized, and reforms seem unlikely to pass the current Senate despite a razor-thin Democratic majority, given Republican intransigence — unless Democrats blow up the filibuster so a simple majority can decide the issue.

So what should Democrats do? Setting aside the filibuster for this one issue ultimately is the right way to go, because election subversion poses the gravest threat imaginable to American democracy. But we should recognize that there are dangers in this route. Voting reform passed with only Democratic support may persuade Republicans that efforts to avoid subverting election results are themselves meant to rig the outcome. So it’s important for Democrats to reach out to Republicans, and for responsible Republicans to join Democrats in this cause, which is sensible and nonpartisan.

Any bill aimed at election subversion should include a few crucial components. One would be the mandated use, in every state, of voting machines that produce paper ballots — ballots that can be examined by a court or other neutral body in the event of a dispute over the integrity of the vote count. (About 12 percent of Americans still voted on fully electronic machines in 2020, according to a Brennan Center analysis.)

Paper balloting requirements ought to be coupled with rules governing the chain of custody of ballots (and of voting machines), to insure they aren’t tampered with; meanwhile, mandatory post-election audits — conducted by independent officials — can help make sure no one inside or outside government messed with the voting technology used to cast or count ballots. (A National Conference of State Legislatures survey found that only a handful of states already incorporate into law requirements for state and local officials to do “risk-limiting” audits — the gold standard — to confirm official accounts, although more states have begun pilot programs.)

The Electoral Count Act, an arcane set of rules dating back to 1887 that governs how Congress counts electoral college votes, is in desperate need of a rewrite. New legislation aimed at preventing stolen elections could incorporate such a revision. Congress could clarify that only extreme circumstances impeding voting — such as a natural disaster — would justify a state legislature’s sending in a competing slate of electors. It should also be harder for members of Congress to raise frivolous objections to a state’s slate of electors; right now it takes only one senator and one House member, from any state, to bring the counting process to a halt for separate debates on the validity of that state’s counts.

We also learned in 2020 about potential choke points within some states in the process of certifying presidential election results. Procedures need to be streamlined so that political hacks charged with ceremonial roles in certifying results don’t insert themselves into the process, as almost happened in Michigan in 2020. (Republicans later replaced the courageous Republican canvassing board member in that state who voted to affirm Biden’s victory.) The rules that worked in the 1880s no longer make sense for our deeply divided modern democracy.

Congress could provide for meaningful federal court oversight when there is reason to believe election officials have tampered with vote counts. At present, federal courts play only a limited role in assuring fair vote counts, and state court processes might not be sufficient everywhere to assure such fairness.

And the new legislation should prevent state takeovers of local election bodies — the replacement of election officials with naked partisans. (Some think Georgia is poised for such a takeover in the Democratic bastion Fulton County, which contains Atlanta: The Georgia State Election Board has approved a majority-Republican panel to “review the performance” of the Fulton County Board of Elections. State oversight of local election bodies should truly be limited to assuring competence — and should not involve messing with the rules for conducting fair elections.)

Congress could also increase the criminal penalties that apply to election tampering, whether done by election officials or others. These activities are already illegal, but the threat of serious jail time should hang over those who would not report a fair vote count. In 2020, election officials like Georgia Secretary of State Brad Raffensperger stood up to Trump’s demand that he “find” over 11,000 votes to flip the state’s results from Biden. Someone with less integrity next time might still be deterred by a sufficiently severe criminal penalty.

Republicans have so far blocked all election reform that Democrats have proposed: Witness Senate Republicans’ filibustering a few months ago of the For the People Act, designed to counter a wave of ballot restrictions in Republican-led states. But much of Democrats’ efforts have been focused not on election subversion per se, but with issues related to voting rights or campaign financing. Legislation like the John Lewis Voting Rights Advancement Act, which would restore some aspects of the Voting Rights Act struck down by the conservative Supreme Court, raise important and serious issues and deserve to be passed. But considering voting rights issues separately from anti-subversion issues increases the chance for bipartisan compromise on the latter.

Some Republicans might well be enlisted in the cause — including the few Republican House members and Senators who voted either to impeach Trump or to convict him after the insurrection in Washington on Jan 6. The importance of election integrity knows no party, so a bipartisan bill would be the ideal.

But if Republicans won’t act, that shouldn’t stop Democrats from moving ahead on this issue. If protecting elections isn’t worth setting the filibuster aside for — if only temporarily — it’s hard to know what would be.