For six years—from 2006 to 2013—I worked inside the intelligence community to enforce laws and policies that protect privacy and civil liberties. My tenure spanned the administrations of George W. Bush and Barack Obama. The surveillance policies of both administrations enlarged the powers of the National Security Agency (NSA) and other intelligence agencies and put considerable strain on privacy.

Edward Snowden’s disclosures of mass surveillance programs, beginning in 2013, led to a course correction in the late Obama years. Changes included a substantial transparency drive, limits on signals intelligence collection that apply to foreigners, and reforms to the Foreign Intelligence Surveillance Act (FISA) that include the end of bulk collection of metadata under that law. I have argued that the Snowden reforms forced the NSA to become “more transparent, more accountable, more protective of privacy—and more effective.”

Still, we delude ourselves if we think they have made the NSA tyrant-proof. In Snowden’s first interview from Hong Kong, warned against “turnkey tyranny.” One day, he said, “a new leader will be elected” and “they’ll find the switch.” With Donald Trump’s election, it is important that this warning not be proved prophetic. While the United States has a robust system of intelligence oversight—the strongest in the world—it still largely depends on the good faith of Executive Branch officials.

Are there ways to prevent Trump from turning that key, or at least to make it a little harder? I believe that there are, but they require immediate action—and continued vigilance after January 20, 2017.

Reaffirming Values

While presidents have abused surveillance powers in the past, we have never before elected a man who openly promises to do so. “I want surveillance of these people,” Trump announced late last year, referring to Muslim Americans. He warned that “certain things will be done that we never thought would happen in this country” including surveillance policies that “were frankly unthinkable a year ago.”

These promises are in direct conflict with core constitutional values, and it is Obama’s duty to stand against them. Before Obama leaves office, he should issue a statement reaffirming these values. It should pointedly remind everyone in the national security agencies that their oath to the Constitution and their duty as Americans transcends any particular president or administration. If they are ever asked to violate that oath or go against those principles, they have a responsibility to say no.

Transparency

Obama has already declassified a substantial amount of information about surveillance programs, using mechanisms like “IC on the Record,” an official site that provides detailed information about NSA and other surveillance. Still, the culture of secrecy persists.

Before Obama leaves office, he should take a hard look at ways in which his administration has contributed to that culture—especially by continuing to insist on dismissing challenges to NSA surveillance on secrecy grounds instead of on the merits. Obama should ask Attorney General Loretta Lynch to review pending cases challenging surveillance, including Jewel v. NSA and Wikimedia v. NSA, and drop “state secrets” defenses where they no longer make sense. The government can still argue that its surveillance programs are constitutional.

Obama could also contribute to transparency by declassifying more information about surveillance that is not reviewed by the Foreign Intelligence Surveillance Court. The Privacy and Civil Liberties Oversight Board has been without a full-time chairman since this summer, delaying the release of its review of NSA surveillance under Executive Order 12333. Obama should work to ensure that this review is released as soon as possible, and can use the opportunity to provide some sunlight into the most important of the NSA’s far-ranging surveillance programs.

Personnel

There has been considerable debate among experienced foreign policy officials about whether it is ethical to serve in a Trump administration. One former official, Eliot Cohen, urged his fellow Republicans to accept jobs, while being prepared to resign if they felt continued service would compromise their principles. He abruptly changed his mind after just a few days, urging people to stay away.

The best way Obama could respond to Trump’s chaotic transition may be to do the opposite of what the conventional wisdom suggests.

The best way Obama could respond to Trump’s chaotic transition may be to do the opposite of what the conventional wisdom suggests. Instead of leaving positions open for Trump to fill, Obama should do the opposite and staff up—especially when it comes to key national security positions that involve oversight, including lawyers, privacy officials, and inspectors general.

Obama can make liberal use of the recess appointment power to ensure that Trump inherits a fully functioning national security establishment on January 20. He could begin by providing the Privacy and Civil Liberties Oversight Board with a new full-time chairman. The Supreme Court’s decision in NLRB v. Canning cut back on the recess appointment power during breaks in congressional sessions, but the president retains an unfettered power to name officials when the Congress permanently adjourns, which will happen at the end of this year.

This approach would go against standard typical protocol. It would certainly infuriate Republicans. But Obama would be doing Trump a favor in the long run, as he will have his hands full.

Pardons and Pending Cases

Obama should pardon Edward Snowden. I have set forth elsewhere my reasons for supporting the Pardon Snowden campaign. They have only been strengthened by Trump’s election. It is only because of Snowden’s disclosures that the American people—and the world—have any idea of the risks posed by Trump’s NSA.

Obama should also at least commute the sentence of Chelsea Manning. Although Manning’s actions, unlike Snowden’s, did not lead to historic reforms, she has still suffered a far harsher punishment than anyone in American history who has leaked classified information to the news media. As a man with autocratic tendencies is poised to take over the presidency, her continued imprisonment sends the wrong message.

Finally, Obama should ask the Attorney General Lynch to review pending leak investigations, with an eye toward dropping them or wrapping them up with minimal punishment. Obama’s Justice Department has employed the Espionage Act in leak cases far more aggressively than any previous administration, as Charlie Savage explains in Power Wars: Inside Obama’s Post-9/11 Presidency. This policy has proven to be a failure. It has done considerable damage to press freedoms without any discernable deterrent effect on damaging leaks.

Policy Continuity

As Obama has reminded us in recent days, changing government policy is much easier in theory than in practice. The President of the United States exercises vast powers under Article II of the Constitution—including power over surveillance—that can in theory be unleashed with the stroke of a pen. In reality, executive orders, presidential directives, and agency guidelines are deeply embedded in the culture of the intelligence community.

Obama should remind the national security agencies that all these policies remain in place after January 20, 2017, unless and until they are formally revoked by his successor. The Justice Department’s Office of Legal Counsel has made clear that both executive orders and presidential directives “remain effective until subsequent presidential action is taken.” If Trump’s White House staff and political appointees argue they need not obey surveillance reform policies put in place by Obama—such as Presidential Policy Directive 28, providing limits on signals intelligence collection—career officials need to tell them, confidently, that they are wrong.

Conclusion: Obama’s Last Obligation

Most of what the NSA does is not directly regulated by Congress. Its activities overseas do not require an order from the Foreign Intelligence Surveillance Court, unless the NSA intentionally targets an American citizen or resident. As the world’s data does not respect territorial boundaries, FISA offers less protection against unchecked spying now than it ever has, with greater impact on the privacy of Americans.

I have proposed that FISA be amended next year to require judicial review of most NSA programs. If Clinton had won big—a possibility that seemed reasonable just weeks ago—she could have swept in Democrats such as Russ Feingold, a civil liberties champion who would have pushed ambitious NSA reforms. That hope and many others swiftly evaporated after the election. In hindsight, Obama’s surveillance reforms not only came too late—they may prove too weak to prevent the “turnkey tyranny” that Snowden predicted. But there is still time to try.

The peaceful transfer of power has been a hallmark of our republic for over two hundred years. Any president’s last obligation is to ensure as smooth a transition as possible. Obama’s duty to turn over the nuclear codes—and the keys to the NSA—stems not from the Presidential Transition Act, but from his obligations under the Constitution.

Obama’s last challenge is to do everything in his power to thwart Trump’s promises to abuse our constitutional liberties.

Obama has twice sworn an oath to “preserve, protect and defend” the Constitution. Normally, this means making it possible for the new president to fulfill his promises, even if you disagree with them. Given Trump’s autocratic tendencies, Obama’s oath entails a countervailing obligation. Obama’s last challenge is to do everything in his power to thwart Trump’s promises to abuse our constitutional liberties.