"Obama was angry at the revelations, privately excoriating Mr. Snowden as a self-important narcissist"

Feeling little pressure to curb the security agencies, Mr. Obama largely left them alone until Mr. Snowden began disclosing secret programs last year. Mr. Obama was angry at the revelations, privately excoriating Mr. Snowden as a self-important narcissist who had not thought through the consequences of his actions.

He was surprised at the uproar that ensued, advisers said, particularly that so many Americans did not trust him, much less trust the oversight provided by the intelligence court and Congress. As more secrets spilled out, though, aides said even Mr. Obama was chagrined. They said he was exercised to learn that the mobile phone of Chancellor Angela Merkel of Germany was being tapped.

Mr. Obama appointed a panel to review the programs. “The point we made to him was, ‘We’re not really concerned about you, Barack, but God forbid some other guy’s in the office five years from now and there’s another 9/11,’ ” said Richard A. Clarke, a former White House counterterrorism adviser who served on the panel. He had to “lay down some roadblocks in addition to what we have now so that once you’re gone it’ll be harder” to abuse spying abilities.