Top secret US National Security Agency (NSA) documents disclosed by the Guardian have shocked the world with revelations of a comprehensive US-based surveillance system with direct access to Facebook, Apple, Google, Microsoft and other tech giants. New Zealand court records suggest that data harvested by the NSA's Prism system has been fed into the Five Eyes intelligence alliance whose members also include the UK, Canada, Australia and New Zealand.

But why have Western security agencies developed such an unprecedented capacity to spy on their own domestic populations? Since the 2008 economic crash, security agencies have increasingly spied on political activists, especially environmental groups, on behalf of corporate interests. This activity is linked to the last decade of US defence planning, which has been increasingly concerned by the risk of civil unrest at home triggered by catastrophic events linked to climate change, energy shocks or economic crisis - or all three.

Just last month, unilateral changes to US military laws formally granted the Pentagon extraordinary powers to intervene in a domestic "emergency" or "civil disturbance":

"Federal military commanders have the authority, in extraordinary emergency circumstances where prior authorization by the President is impossible and duly constituted local authorities are unable to control the situation, to engage temporarily in activities that are necessary to quell large-scale, unexpected civil disturbances."

Other documents show that the "extraordinary emergencies" the Pentagon is worried about include a range of environmental and related disasters.

In 2006, the US National Security Strategy warned that:

"Environmental destruction, whether caused by human behavior or cataclysmic mega-disasters such as floods, hurricanes, earthquakes, or tsunamis. Problems of this scope may overwhelm the capacity of local authorities to respond, and may even overtax national militaries, requiring a larger international response."

Two years later, the Department of Defense's (DoD) Army Modernisation Strategy described the arrival of a new "era of persistent conflict" due to competition for "depleting natural resources and overseas markets" fuelling "future resource wars over water, food and energy." The report predicted a resurgence of:

"... anti-government and radical ideologies that potentially threaten government stability."

In the same year, a report by the US Army's Strategic Studies Institute warned that a series of domestic crises could provoke large-scale civil unrest. The path to "disruptive domestic shock" could include traditional threats such as deployment of WMDs, alongside "catastrophic natural and human disasters" or "pervasive public health emergencies" coinciding with "unforeseen economic collapse." Such crises could lead to "loss of functioning political and legal order" leading to "purposeful domestic resistance or insurgency...

"DoD might be forced by circumstances to put its broad resources at the disposal of civil authorities to contain and reverse violent threats to domestic tranquility. Under the most extreme circumstances, this might include use of military force against hostile groups inside the United States. Further, DoD would be, by necessity, an essential enabling hub for the continuity of political authority in a multi-state or nationwide civil conflict or disturbance."

That year, the Pentagon had begun developing a 20,000 strong troop force who would be on-hand to respond to "domestic catastrophes" and civil unrest - the programme was reportedly based on a 2005 homeland security strategy which emphasised "preparing for multiple, simultaneous mass casualty incidents."

The following year, a US Army-funded RAND Corp study called for a US force presence specifically to deal with civil unrest.

Such fears were further solidified in a detailed 2010 study by the US Joint Forces Command - designed to inform "joint concept development and experimentation throughout the Department of Defense" - setting out the US military's definitive vision for future trends and potential global threats. Climate change, the study said, would lead to increased risk of:

"... tsunamis, typhoons, hurricanes, tornadoes, earthquakes and other natural catastrophes... Furthermore, if such a catastrophe occurs within the United States itself - particularly when the nation's economy is in a fragile state or where US military bases or key civilian infrastructure are broadly affected - the damage to US security could be considerable."

The study also warned of a possible shortfall in global oil output by 2015:



"A severe energy crunch is inevitable without a massive expansion of production and refining capacity. While it is difficult to predict precisely what economic, political, and strategic effects such a shortfall might produce, it surely would reduce the prospects for growth in both the developing and developed worlds. Such an economic slowdown would exacerbate other unresolved tensions."

That year the DoD's Quadrennial Defense Review seconded such concerns, while recognising that "climate change, energy security, and economic stability are inextricably linked."

Also in 2010, the Pentagon ran war games to explore the implications of "large scale economic breakdown" in the US impacting on food supplies and other essential services, as well as how to maintain "domestic order amid civil unrest."

Speaking about the group's conclusions at giant US defence contractor Booz Allen Hamilton's conference facility in Virginia, Lt Col. Mark Elfendahl - then chief of the Joint and Army Concepts Division - highlighted homeland operations as a way to legitimise the US military budget:



"An increased focus on domestic activities might be a way of justifying whatever Army force structure the country can still afford."

Two months earlier, Elfendahl explained in a DoD roundtable that future planning was needed:

"Because technology is changing so rapidly, because there's so much uncertainty in the world, both economically and politically, and because the threats are so adaptive and networked, because they live within the populations in many cases."

The 2010 exercises were part of the US Army's annual Unified Quest programme which more recently, based on expert input from across the Pentagon, has explored the prospect that "ecological disasters and a weak economy" (as the "recovery won't take root until 2020") will fuel migration to urban areas, ramping up social tensions in the US homeland as well as within and between "resource-starved nations."

NSA whistleblower Edward Snowden was a computer systems administrator for Booz Allen Hamilton, where he directly handled the NSA's IT systems, including the Prism surveillance system. According to Booz Allen's 2011 Annual Report, the corporation has overseen Unified Quest "for more than a decade" to help "military and civilian leaders envision the future."

The latest war games, the report reveals, focused on "detailed, realistic scenarios with hypothetical 'roads to crisis'", including "homeland operations" resulting from "a high-magnitude natural disaster" among other scenarios, in the context of:

"... converging global trends [which] may change the current security landscape and future operating environment... At the end of the two-day event, senior leaders were better prepared to understand new required capabilities and force design requirements to make homeland operations more effective."

It is therefore not surprising that the increasing privatisation of intelligence has coincided with the proliferation of domestic surveillance operations against political activists, particularly those linked to environmental and social justice protest groups.

Department of Homeland Security documents released in April prove a "systematic effort" by the agency "to surveil and disrupt peaceful demonstrations" linked to Occupy Wall Street, according to the Partnership for Civil Justice Fund (PCJF).

Similarly, FBI documents confirmed "a strategic partnership between the FBI, the Department of Homeland Security and the private sector" designed to produce intelligence on behalf of "the corporate security community." A PCJF spokesperson remarked that the documents show "federal agencies functioning as a de facto intelligence arm of Wall Street and Corporate America."

In particular, domestic surveillance has systematically targeted peaceful environment activists including anti-fracking activists across the US, such as the Gas Drilling Awareness Coalition, Rising Tide North America, the People's Oil & Gas Collaborative, and Greenpeace. Similar trends are at play in the UK, where the case of undercover policeman Mark Kennedy revealed the extent of the state's involvement in monitoring the environmental direct action movement.

A University of Bath study citing the Kennedy case, and based on confidential sources, found that a whole range of corporations - such as McDonald's, Nestle and the oil major Shell, "use covert methods to gather intelligence on activist groups, counter criticism of their strategies and practices, and evade accountability."

Indeed, Kennedy's case was just the tip of the iceberg - internal police documents obtained by the Guardian in 2009 revealed that environment activists had been routinely categorised as "domestic extremists" targeting "national infrastructure" as part of a wider strategy tracking protest groups and protestors.

Superintendent Steve Pearl, then head of the National Extremism Tactical Coordination Unit (Nectu), confirmed at that time how his unit worked with thousands of companies in the private sector. Nectu, according to Pearl, was set up by the Home Office because it was "getting really pressured by big business - pharmaceuticals in particular, and the banks." He added that environmental protestors were being brought "more on the radar." The programme continues today, despite police acknowledgements that environmentalists have not been involved in "violent acts."

The Pentagon knows that environmental, economic and other crises could provoke widespread public anger toward government and corporations in coming years. The revelations on the NSA's global surveillance programmes are just the latest indication that as business as usual creates instability at home and abroad, and as disillusionment with the status quo escalates, Western publics are being increasingly viewed as potential enemies that must be policed by the state.

Dr Nafeez Ahmed is executive director of the Institute for Policy Research & Development and author of A User's Guide to the Crisis of Civilisation: And How to Save It among other books. Follow him on Twitter @nafeezahmed