A Fairfax Media investigation this week uncovered the fact Groves was part of an extraordinary undercover operation against the activists who are known as the Leard Forest Alliance or Front Line Action Against Coal. For five months, former military and intelligence personnel took on assumed identities with elaborate backstories and rotated through the camp, taking notes, reporting back on any planned actions, profiling the leadership and trying to uncover whether the protesters themselves had spies inside the mines. It failed. Several agents were identified, and at least one directly confronted. Groves was a senior figure. His company - the Centre of Intelligence and Risk Management (CIRM) - wrangled the spies for the clandestine operation. He reported to Tyrone Clark, a former Australian Federal Police officer, whose company C5 Management Solutions received the intelligence, distilling it and passed it on to the mining companies via their security arms. Following Fairfax's first report on the espionage on Monday, Idemitsu admitted it had contracted C5 Management Solutions and another firm understood to be involved, the mysterious Strongs Security Services. After years of suspicions among activists, it is the first time that such an operation has been verified.

These kinds of ''black ops'' may seem like something from a modern spy novel or a Hollywood blockbuster but have been long documented overseas and speculated about here. And the exposure of the clandestine project raises important and uncomfortable questions about corporate power, privacy and the right to protest. Such outright deception is widespread among a plethora of private security firms, intelligence firms and detective agencies. It is almost certain there have been attempts to infiltrate protest groups and NGOs, but the practice of deception and false identities extends to other private investigation work, including spying on workplaces, people in legal disputes and even divorce. Using a false identity to obtain information on a ''target'' is known as ''pretexting'', says Wayne Edwards, a 31-year surveillance veteran who runs Harjan Investigations.

''It's something that's commonly used within the industry,'' he said. Mr Edwards describes an industry where regulation is weak and often flouted, and where ''manipulation, intimidation and bullying are rife''. It is a sector where big companies dominate and subcontract work to smaller firms. ''You're only as good as your last job and subcontractors are put under pressure by some companies to step outside the boundaries of the code of practice - including things like pretexting - to get results.'' New entrants to the industry are coming from the ranks of former soldiers, police and spies who took up lucrative private contracting work in Iraq and Afghanistan. People like Tony Groves, who worked for the international security giant Garda Global. With the wars in Afghanistan and Iraq winding down, work is more scarce and techniques used in the conflict zones are being deployed in Australia. Companies like C5, CIRM and Strongs Security Services operate in the shadows. All refused to respond to calls from Fairfax Media and only C5 publicly lists its contact information.

Their corporate paymasters adopt a ''don't ask, don't tell'' policy that borders on laughable. Asked about the security operation, Idemitsu's chief operating officer, Rod Bridges, said: ''How they found out all this information [about the protesters' activities] … Well we didn't ask questions.'' Mr Bridges said he had little knowledge about Strongs Security despite the lucrative contract it was awarded about six months ago, although he believed it was headed by an ''ex-French foreign legionnaire''. Whitehaven Coal - already facing a public relations disaster as its former owner Nathan Tinkler is accused of illegal political donations during Independent Commission against Corruption hearings - insists it had no knowledge or involvement in the exercise. But multiple sources indicate that its security staff, at least, were aware of the infiltration project and benefited from the information it uncovered. ''The protest at Maules Creek has been non-violent and open,'' wrote Phil Laird, a local farmer whose family has been in the district for 160 years. ''If the coal industry wants to know our plans, then perhaps they could engage with the protectors rather than send in undercover security agents to ingratiate themselves around the campfires.''

The activists' aim is to draw attention to the impact of Australia's $60 billion-a-year coal industry on climate change, build popular support to halt its expansion and eventually end it. ''It is an industry with rapidly diminishing social license and, in fact, only last week AMP Capital banned coal from its responsible range of investments, joining the likes of armaments, gambling and pornography,'' Solity says. The companies retort that coal underpins economic prosperity and drastic security measures are required. It's a workplace safety issue, they say, as the protesters trespass on the mining site, threaten to sabotage equipment and thwart building works. But there's something bigger at stake. It's no coincidence that the spying campaign at Maules Creek began as both Idemitsu and Whitehaven began construction of their new mines. The exposure of the black ops at Maules Creek and Boggabri inevitably raises questions about any role of government intelligence and law enforcement agencies.

ASIO, the AFP and NSW police all denied they had engaged private firms to infiltrate activist networks, although they do use them to monitor ''open source'' material such as internet sites and social media. As for deploying their own undercover officers to observe protesters, the situation becomes murkier. ASIO director general David Irvine said the domestic spy organisation ''does not limit, or seek to limit, the right of persons to engage in lawful advocacy, protest or dissent''. But in campaigns of civil disobedience, laws are often broken. Hundreds of protesters at Maules Creek have been arrested for offences such as trespass. Does that mean protests like this qualify as ''unlawful'' and therefore a legitimate target of scrutiny for ASIO or the AFP?

It seems it very well might, especially if it involves ''energy security'', according to a letter written by then attorney-general Robert McClelland to his colleague, resources minister Martin Ferguson, in 2009. ''While I recognise the right to protest, when actions jeopardise energy security and the delivery of essential services, it is important that measures are taken to prevent and deter unlawful activity,'' McClelland says. ASIO, he tells Ferguson, does monitor protest activity and provides intelligence reporting when there is ''actual, or potential, for violence''. The AFP, he writes, ''continually monitors the activities of issues-motivated groups and individuals who may target establishments through direct action.'' Whether commercially funded or government endorsed, few doubt that the level of surveillance of activists, NGOs and whistleblowers has been as high, or more intrusive.