Information and activity that helps to expose or eliminate spying or terrorist threats is counterintelligence. One of the things the CIA is responsible for is counterintelligence.
Governments spy on each other, and the action of spying is called intelligence or espionage. When a country works to oppose or uncover spying, it's counterintelligence, or counterespionage. In the United States, both the CIA and the FBI have counterintelligence units. The word has been used since 1940, from counter, "against," and intelligence, from the Latin intelligentia, "power of discerning." The sense of intelligence as "secret information from spies" dates from the 16th century.