MCLEAN, Va. — A day after revealing an intelligence failure that cost the lives of two al-Qaida hostages, President Obama on Friday praised the nation’s spying operations as the most capable in the world while promising a review aimed at preventing future mistakes.

“We all bleed when we lose an American life,” Obama said in a speech at the Office of the Director of National Intelligence to mark its 10th anniversary. “We all grieve when any innocent life is taken. We don’t take this work lightly. And I know that each and every one of you understand the magnitude of what we do and the stakes involved and these aren’t abstractions and we’re not cavalier about what we do.”

Obama said he knows the U.S. intelligence community has faced criticism but it can take great pride that its work has made America more secure.

“The world doesn’t always see your successes, the threats that you prevent or the terrorist attacks you thwart, or the lives that you save,” Obama told a couple hundred intelligence officials gathered in an auditorium. He said their intelligence helped take out Osama bin Laden and other al-Qaida leaders, showed that Syria had chemical weapons, revealed Russian aggression in Ukraine and supported nuclear negotiations with Iran.

Obama’s praise came one day after the announcement that a counterterrorism operation in January against an al-Qaida compound accidentally killed two aid workers being held hostage – American Warren Weinstein and Italian Giovanni Lo Porto. Obama said the U.S. was unaware the hostages were in the targeted position, despite hundreds of hours of surveillance of the compound.