The US government uses software to eavesdrop on Americans and has targeted its allies with cyber-attacks to spy for foreign intelligence agencies.
The software, known as “incidental collection,” is widely used by the US government to monitor the activities of foreigners overseas.
The use of the software is not authorized by law, and it has been used by government agencies around the world, including the US.
The Guardian has reported that the FBI has used software from another contractor, Gamma Group, to spy in the United States for years.
Gamma Group is a US government contractor that was purchased by private companies.
In 2013, the Guardian reported that Gamma Group was being used to spy and hack into computers, smartphones and mobile devices in China.
Gamma has denied wrongdoing and said that the US uses the software “only for lawful domestic intelligence purposes”.
But US authorities have acknowledged using the software in recent years.
Last year, a court found that the National Security Agency was unlawfully collecting information about millions of Americans’ phone calls and emails.
The US intelligence community said that “collection” included data that could not be directly linked to a specific individual.
The NSA’s director, Gen Keith Alexander, said in 2014 that “incidents involving our intelligence agencies have been far fewer” than the agency had previously acknowledged.
In his annual report to Congress in 2013, Alexander said that there were fewer than 200 incidents involving the NSA targeting US citizens.
But last month, a leaked document from the NSA showed that the agency was also tracking foreign intelligence targets using software that was not authorised by law.
The Washington Post, which first reported the use of Gamma, said the government was “pushing the envelope” in its use of this software.
The leaked document said that a number of Gamma Group contractors, including Microsoft, had been paid between $20 million and $30 million by the NSA.
In its 2015 report to the Congress, the NSA said that while the software had not been used for any purpose other than intelligence, “the use of it by the government to spy was a significant and unacceptable violation of our national security.”
In an internal report to its contractors, Gamma also acknowledged that it was “encouraging and supporting” government operations with the software.
Gamma also disclosed that it had been used to collect intelligence on US persons and corporations.
In a 2013 letter, the US intelligence agency General Counsel’s office wrote that it “has been able to determine the existence of a program that the government contracted with Gamma to use to monitor communications of US persons.”
The letter said that although the software was not used for surveillance, it had “been used for targeting the communications of a number (of US persons) and corporations.”
The Washington Free Beacon, a news website that has reported extensively on the NSA, reported last year that the NSA had used Gamma Group software to collect and store vast amounts of data.
The surveillance, the report said, was conducted by “using the software to gather intelligence that included information on the locations, activities, communications and locations of persons, and the content of their communications.”
The NSA has declined to comment on the report.
A spokesman for the agency did not immediately respond to a request for comment.
US lawmakers have been concerned about the use and misuse of software for decades.
A report by the Government Accountability Office in 2011 said that software that had been approved by the Foreign Intelligence Surveillance Court (FISC) was often misused.
The report said that FISC approval was not necessary for “incident-based analysis, data mining, or other use of software that is neither necessary for legal surveillance nor authorized by FISC.”
The GAO found that Gamma, a US company, had “a long history of improper use of FISC software.”
It found that in 2011, after the company was caught spying on the offices of the US Congress, Gamma had already been using the FISC’s software for more than five years.
The GAo also said that in 2006, it reviewed documents from the National Archives showing that the software used by Gamma Group had been installed on hundreds of computers.
The FBI declined to respond to questions about the Fisa court approval for Gamma.
The inspector general of the Department of Justice has also said he believes that the use was illegal.
“I believe the NSA has a long history, a very long history,” Inspector General John Roth told the House Intelligence Committee in April.
“The use of any software is illegal and there’s no way to get around it.”
A federal judge last month ordered the NSA to stop using the code.