Departing NSA general counsel Raj De helped manage the agency through its biggest crisis

In this March 17, 2015, photo, former National Security Agency general counsel Raj De poses for a photo in his home in Chevy Chase, Md. The Harvard-trained lawyer departed last week as NSA gneral counsel following stints at the White House, the Justice Department and the 9/11 Commission. (AP Photo/Molly Riley) (The Associated Press)

In this March 17, 2015, photo, former National Security Agency general counsel Raj De poses for a photo in his home in Chevy Chase, Md. The Harvard-trained lawyer departed last week as NSA gneral counsel following stints at the White House, the Justice Department and the 9/11 Commission. (AP Photo/Molly Riley) (The Associated Press)

In this March 17, 2015, photo, former National Security Agency general counsel Raj De poses for a photo in his home in Chevy Chase, Md. The Harvard-trained lawyer departed last week as NSA gneral counsel following stints at the White House, the Justice Department and the 9/11 Commission. (AP Photo/Molly Riley) (The Associated Press)

The National Security Agency's top lawyer, who helped managed the agency's response to leaks of its most secret surveillance programs, has left the government.

Raj De (Day) is returning to his former law firm, Mayer Brown, to run a cybersecurity practice. His replacement has not been named.

De arrived at the spy agency three years ago following stints at the White House, the Justice Department and the 9/11 Commission.

President Barack Obama has made modest changes but has left most of the controversial NSA surveillance programs in place, rejecting some of the reforms suggested by his own task force. De played a role in preserving the status quo.

In an interview, De says he wishes the agency had done a better job publicly explaining its role in intelligence collection.