When I tell people I lead a grantmaking initiative at the Hewlett Foundation that seeks to shore up the values, norms, and institutions of democracy in the United States – in particular Congress – eyebrows rise as they say something like, good luck with that! When I tell them I am cautiously optimistic, jaws drop and heads shake.

I understand why pessimism is pervasive. Freedom House, whose work we help fund, recently reported the world is mired in a democratic recession that has lasted for more than a decade. Dictatorships, not democracies, seem to be flourishing. In just the last month, we’ve seen China’s Xi Jinping push through a constitutional amendment that makes him president indefinitely– 2,958 members of parliament voted for it, while two brave souls voted against it. Meanwhile, Russia’s President Vladimir Putin, having assassinated, jailed, or banned various opposition leaders, was “re-elected” with 76 percent of the vote.

Here in the United States, President Trump – ostensibly the leader of the Free World – praised  Xi’s strongman maneuver, saying “maybe we’ll have to give that a shot someday,” then ignored his National Security staff’s “DO NOT CONGRATULATE” warning in his call with Putin. The president also has begun attacking Special Counsel Robert Mueller by name. And all this takes place against the backdrop of rolling revelations of Trump’s earlier trysts and hush money payments, plus the ongoing firings, leaking, and backbiting in the president’s inner circle. Democracy in America seems to be twisting in these Trumpian gusts. Love or hate the president, he has us glued to the cliffhanger episode of a trashy reality TV show.

So what explains my cautious optimism? In part it’s because I see our democracy’s immune system kicking in. The surge in grassroots citizen action after the 2016 election shows no signs of receding. State governments (from California to Mississippi), independent judges (appointed by Democrats and Republicans alike), and national newspapers (not only The New York Times and The Washington Post, but also The Wall Street Journal and USA Today) are all rising to the moment. And our co-funders and grantees have taken a number of bold and inspiring strokes, e.g., the Democracy Fund investing $24 million in special projects to bolster democracy, or the bipartisan Alliance for Securing Democracy launching the Hamilton 68 website to track Russian influence operations on Twitter within weeks of starting up.

At a fundamental level, my optimism rests on the structural safeguards of the Constitution’s separation of powers, and the underappreciated and essential role that Congress, reinforced by the electorate, plays in checking and balancing the president. I readily admit the current Congress has often been feckless and hyperpartisan. But there is also countervailing data we need to reckon with. In the Senate, for example, the Intelligence Committee’s bipartisan investigation into Russian meddling in the 2016 campaign continues apace. President Trump might view the various investigations on this topic as a “witch hunt,” but the members of this committee do not.

Last month’s bipartisan omnibus appropriations bill is another example of an overlooked but critical constitutional power that Congress wields: the ability to grant – and withhold – federal spending. Congress pretty much stiffed President Trump. The president wanted $25 billion for his wall; Congress gave him $1.6 billion for “border security.” He wanted to cut the Environmental Protection Agency and State Department budgets by 30 percent; Congress essentially held their budgets flat. He wanted steep cuts at the Department of Education, the National Institutes of Health, and in public housing programs; Congress actually increased their funding. President Trump might aspire to rule like a strongman, but unlike Xi and Putin, he confronts an independent legislature that can and does check and balance him.

These checks and balances will be buttressed later this year by another bedrock feature of our democracy. Every two years –based on the clockwork of our Constitution, not the political whims of a leader or a party – American voters go to the polls to elect all 435 members of the House and one-third of the Senate. All the early signs point to a midterm election that will stiffen the spine of Congress in its built-in constitutional rivalry with the executive branch.

But what if the president fires Robert Mueller in the meantime? He may well do that. But this would only increase the likelihood of an election result that would more tightly constrain, if not impeach and convict, the president. Ultimately, and appropriately, it is not a special counsel but rather the voters and their representatives in the legislature that must check and balance a rogue president. This may strike some as an unsatisfactory conclusion, insofar as it suggests we must engage, form coalitions with, and depend on our fellow citizens and elected officials – many of whom see the world very differently than we do – to secure our liberties. Welcome to citizenship in a representative democracy.

What we might see as a fraught undertaking, others see as a privilege. I recently joined a number of democracy reformers to hear Russian opposition leader Vladimir Kara-Murza reflect on the challenges facing supporters of democracy around the world. He knows of what he speaks: he survived two poisonings by the Putin regime and continues his work in Russia, undaunted. At one point, Kara-Murza sensed a vibe of despondency in his American audience. He reminded us that we have access to institutions that he and his colleagues can only dream about. “I speak with envy about your elections and opposition and press!” If Kara-Murza can retain the optimism and courage of his democratic convictions in his circumstances, surely we can do no less in ours.