AUBURN, N.Y. — President Barack Obama is acknowledging he must “do a better job” of giving Americans confidence in the programs the National Security Agency has deployed to guard against terrorism.

Obama says the administration should “continue to improve the safeguards” of these initiatives.

His remarks on CNN’s “New Day” show Friday came in the wake of new revelations that the electronic spying program scooped up as many as 56,000 emails and other communications annually over three years by Americans not connected to terrorism.

The president conceded the NSA had “inadvertently, accidentally, pulled the emails” of some Americans. But he also said the programs are necessary, “these aren’t unique to the NSA” and the United States has to adapt “in the right way” to the confluence of terrorist threats and rapidly advancing technology.