WASHINGTON (AP) — The supersecret agency with the power and legal authority to gather electronic communications worldwide to hunt U.S. adversaries says it has the technical know-how to ensure it’s not illegally spying on Americans.

But mistakes do happen in data-sifting conducted mostly by machines, not humans. Sometimes, former intelligence officials say, that means intelligence agencies destroy material they should not have seen, passed to them by the Fort Meade, Md.-based National Security Agency.