In the 21st century, the US National Security Agency (and other espionage agencies) face a storm of system-wide problems that I haven't seen anybody talking about. The problems are sociological, and they threaten to undermine the way the Western security state operates.

The big government/civil service agencies are old. The NSA's roots stretch back to the State Department's "Black Chamber" (officially dissolved by Secretary of State Henry Stimson in 1929 with the immortal words "Gentlemen do not read each other's mail"). The CIA is a creation of the late 1940s. J. Edgar Hoover's FBI was established as the Bureau of Investigation in 1908. These organisations are products of the 20th-century industrial state, and they are used to running their human resources and internal security processes as if they're still living in the days of the "job for life" culture. Potential spooks-to-be were tapped early (often while at school or university), vetted, and then given a safe sinecure along with regular monitoring to ensure they stayed on the straight-and-narrow all the way to the gold watch and pension. Because that's how we all used to work, at least if we were civil servants or white-collar paper-pushers back in the 1950s.

But outside the walled garden of the civil service, things don't work that way anymore. A major consequence of the 1970s resurgence of neoliberal economics was the deregulation of labour markets and the deliberate destruction of the job-for-life culture (partly because together they were a powerful lever for dislodging unionism and the taproots of left-wing power in the West, and partly because a liquid labour market made entrepreneurial innovation and corporate restructuring easier).

Government departments may be structured on old-fashioned lines, but their managers aren't immune to outside influences and they frequently attempt reforms, in the name of greater efficiency, that shadow the popular private-sector fads of the day. One side effect of making corporate restructuring easier was the rush toward outsourcing, and today around 70 per cent of the US intelligence budget is spent on outside contractors. And it's a big budget - well over $50 billion ($A 55.7 billion) a year. Some chunks go to heavy metal (the National Reconnaissance Office is probably the biggest high-spending agency you've never heard of: it builds spy satellites), but a lot goes to people. People to oil the machines. People who work for large contracting organisations. Organisations that increasingly rely on contractors rather than permanent labour to retain "flexibility."

Here's the problem: The organisations are now running into outside contractors who grew up in the globalised, liquid labour world of Generation X and Generation Y, with Generation Z fast approaching.

We experience cultural continuity with our parents' and our children's generations. Even when we don't see eye to eye with our parents on political questions or we sigh in despair about our kids' fashion sense or taste in music, we generally have a handle on what makes them tick. But a human lifetime seldom spans more than three generations, and the sliding window of one's generation screens out that which came before and that which comes after; they lie outside our personal experience. We fool ourselves into thinking that our national culture is static and slow-moving, that we are the inheritors of a rich tradition. But if we could go back three or four generations, we would find ourselves surrounded by aliens - people for whom a North Atlantic crossing by sail was as slow and risky as a mission to Mars, people who took it for granted that some races were naturally inferior and that women were too emotionally unstable to be allowed to vote. The bedrock of our cultural tradition is actually quicksand. We reject many of our ancestors' cherished beliefs and conveniently forget others, not realizing that, in turn, our grandchildren may do the same to ours.

Let's focus on the next three generations and try to discern some patterns.

Generation X's parents, the baby boomers, grew up in the 1950s. It was not unusual to expect to work in the same job for life. They seldom travelled internationally because it was expensive and slow, and their cultural environment was predominantly defined by their nationality - an extraordinary international incursion such as the arrival of Beatlemania in the 1960s was shocking precisely because it was so unusual.

With few exceptions, Generation X never had the job for life. Members of the generation are used to nomadic employment, hire-and-fire, right-to-work laws, the whole nine yards of organised-labour deracination. But they also grew up in the age of cheap jet travel, on a globe shrunk so small that 48 hours and two weeks' average wages could take you to the antipodes. (In 1813, you could pay two weeks' average wages and take 48 hours to travel 100 to 200 miles by stagecoach. In 2013, that can take you from Maryland to Hong Kong - and then on to Moscow.)

Generation Y's parents are Generation X. Generation Y comprises the folks who serve your coffee in Starbucks and build software at Google. Generation Y has never thought of jobs as permanent things. Most Generation Y folks will stare at you blankly if you talk about loyalty to one's employer; the old feudal arrangement ("we'll give you a job for life and look after you as long as you look out for the Organisation") is something their grandparents ranted about, but it's about as real to them as the divine right of kings. Employers like Google or Facebook that provide good working conditions are the exception, not the rule. Employers are alien hive-mind colony intelligences that will fuck you over for the bottom line on the quarterly balance sheet. They'll give you a laptop and tell you to hot-desk or work at home so that they can save money on office floor space and furniture. They'll dangle the offer of a permanent job over your head but keep you on a zero-hours contract for as long as is convenient.

On the other hand: Generation Y has grown up in a world where travel is cheap and communication is nearly free. Their cultural zeitgeist is less parochial than that of their grandparents, more global, infused with Japanese anime and Swedish heavy metal, as well as local media produce. This is the world they grew up in: This is the world that defines their expectations.

The problem is, you can't run a national security organisation if you can't rely on the loyalty of the majority of your workers - both to the organisation and to the state it serves. At one time, continuity of employment meant that the agencies at least knew their people, but there is now an emerging need to security-clear vast numbers of temporary and transient workers with no intrinsic sense of loyalty to the organisation.

The NSA and its fellow swimmers in the acronym soup of the intelligence-industrial complex are increasingly dependent on nomadic contractor employees and increasingly subject to staff churn. Security clearance is carried out wholesale by other contractor organisations that specialize in human resource management, but even they are subject to the same problem: Quis custodiet ipsos custodes?

We human beings are primates. We have a deeply ingrained set of cultural and interpersonal behavioral rules that we violate only at social cost. One of these rules, essential for a tribal organism, is bilaterality: Loyalty is a two-way street. (Another is hierarchy: Yield to the boss.) Such rules are not iron-bound or immutable - we're not robots - but our new hive superorganism employers don't obey them instinctively, and apes and monkeys and hominids tend to revert to tit-for-tat strategies readily when they're unsure of their relative status. Perceived slights result in retaliation, and blundering, human-blind organisations can bruise an employee's ego without even noticing. And slighted or bruised employees who lack instinctive loyalty, because the culture they come from has spent generations systematically destroying social hierarchies and undermining their sense of belonging, are much more likely to start thinking the unthinkable.

Nationalism might seem to provide a bulwark here, buttressing loyalty to the institutions of state with loyalty to the ideals of the state itself. But if the actions of the state deviate too far from the ideals embodied in the foundational myths its citizens believe, cognitive dissonance ensues. The public perception of America as being a democratic republic that values freedom and fairness under the rule of law is diametrically opposed to the secretive practices of the surveillance state. Nationalist loyalty is highly elastic, but can be strained to breaking point. And when that happens, we see public servants who remain loyal to the abstract ideals conclude that the institution itself is committing treason. And an organisation that provides no outlet for the concerns of loyal whistle-blowers like Thomas Drake is creating a rod for its own back by convincing the likes of leaker Edward Snowden that it is incapable of reform from within and disloyal to the national ideals it purports to serve.

Snowden is 30; he was born in 1983. Chelsea Manning is 25. Generation Y started around 1980 to 1982. But the signs of disobedience among Generation Y are merely a harbinger of things to come. Next up is Generation Z - the cohort born since the millennium.

Members of Generation Z are going to come of age in the 2020s, in a world racked by extreme climate events. Many of them will be sibling-less only children, for the demographic transition to a low birthrate/low death rate equilibrium lies generations in their past. They may not be able to travel internationally - energy costs combined with relative income decline is slowly stripping the middle classes of that capability - but they'll be products of a third-generation Internet culture.

To the Z cohort, the Internet isn't a separate thing; it has been an integrated part of their lives since infancy. They do not remember a time before the Internet or a life without smartphones. All of them will have had Facebook pages, even though they had to lie about their age to sign up (and even though having a social network presence is officially a no-no for spooks). All of them have acquired long histories visible on the Internet, even if only through the tagged photographs of their schoolmates. Mostly they photograph everything (even though taking photographs or being photographed is officially a no-no for spooks). Many of them even use lifeloggers (which has got to be a career-killer if your career lies in the shadows). They grew up in a surveillance state; they might want privacy, but they are under no illusions that the centres of authority will permit them to have it. Steeply climbing university fees and student-debt loading have turned a traditional degree into their version of Generation X's unattainable job for life; their education will be vocational or acquired piecemeal from MOOCs (massive open online courses), and their careers will be haphazard, casual, and dominated by multiple part-time contracts.

They saw their grandparents' and parents' generations screwed by the great intergenerational transfer of wealth to the baby boomers - their great-grandparents, many of whom are lingering on into their twilight 80s. To Generation Z's eyes, the boomers and their institutions look like parasitic aliens with incomprehensible values who make irrational demands for absolute loyalty without reciprocity. Worse, the foundational mythology and ideals of the United States will look like a bitter joke, a fun house mirror's distorted reflection of the reality they live with from day to day.

Generation Z will arrive brutalised and atomised by three generations of diminished expectations and dog-eat-dog economic liberalism. Most of them will be so deracinated that they identify with their peers and the global Internet culture more than their great-grandparents' post-Westphalian nation-state. The machineries of the security state may well find them unemployable, their values too alien to assimilate into a model still rooted in the early 20th century. But if you turn the Internet into a panopticon prison and put everyone inside it, where else are you going to be able to recruit the jailers? And how do you ensure their loyalty?

If I were in charge of long-term planning for human resources in any government department, I'd be panicking. Even though it's already too late.

© 2013, Foreign Policy