Counterintelligence (CI) refers to information gathered and activities conducted to protect against espionage, other intelligence activities, sabotage, or assassinations conducted for or on behalf of foreign powers, organizations or persons or international terrorist activities, but not including personnel, physical, document or communications security programs.
Modern tactics of espionage and dedicated government intelligence agencies were developed over the course of the late 19th century. A key background to this development was the Great Game, a period denoting the strategic rivalry and conflict that existed between the British Empire and the Russian Empire throughout Central Asia. To counter Russian ambitions in the region and the potential threat it posed to the British position in India, a system of surveillance, intelligence and counterintelligence was built up in the Indian Civil Service. The existence of this shadowy conflict was popularised in Rudyard Kipling's famous spy book, Kim, where he portrayed the Great Game (a phrase he popularised) as an espionage and intelligence conflict that 'never ceases, day or night'.
The establishment of dedicated intelligence and counterintelligence organizations was directly linked to the colonial rivalries between the major European powers and the accelerating development of military technology. As espionage became more widely used, it became imperative to expand the role of existing police and internal security forces into a role of detecting and countering foreign spies. The Austro-Hungarian Evidenzbureau was entrusted with the role from the late 19th century to counter the actions of the Pan-Slavist movement operating out of Serbia.
As mentioned above, after the fallout from the Dreyfus Affair in France, responsibility for military counter-espionage was passed in 1899 to the Sûreté générale—an agency originally responsible for order enforcement and public safety—and overseen by the Ministry of the Interior.