The undercover police officer whose unmasking led to the collapse of a trial of six environmental protesters on Monday apparently also worked as a corporate spy, according to documents seen by the Guardian.

Details of how Mark Kennedy went from police officer to businessman reveal the extent to which shadowy corporate firms appear to have developed links with the police. It also reveals something about Kennedy himself: with an apparent view to making money out of his access, the undercover officer used cryptic names derived from a science fiction television series, Stargate.

From 2003 until around March last year, Kennedy lived in the midst of the protest movement with the fake identity Mark Stone. Remarkably, he appears to have used that same undercover identity – which according to him cost the taxpayer £1.75m – to venture into private practice.

It is not known why Mark John Kennedy – born in Camberwell, south London on 7 July 1969 – quit his police job. However, he was apparently affected by the controversial police operation to arrest 114 people in Nottingham in April 2009 before protest action at Ratcliffe-on-Soar power station. He later offered to give evidence for the defence in the trial.

Documents seen by the Guardian suggest Kennedy put careful thought into what he would do after leaving the police. In February 2010 – a month before resigning – he set up Tokra Limited, at an address in Leighton Buzzard, Bedfordshire.

The fanciful name could have derived from a science fiction television series, Stargate. Kennedy might well have seen parallels between his company's mission and the plot, which features the Tok'ra as an alien race symbiotically inhabiting human hosts. In their human guise, the Tok'ra fight a powerful, evil race who seek to control and destroy the planet.

Calling himself a logistics officer, Kennedy registered himself as sole director of the company. Intriguingly, the address he used is the work address of Heather Millgate, a solicitor specialising in personal injury, and a former director of Global Open, a private security firm.

Global Open was set up in 2001 by Rod Leeming, a former special branch officer. The company keeps a "discreet watch" on protest groups for clients including E.ON.

It first came to public attention in 2007 when it was implicated in the case of Paul Mercer, a friend of the then Conservative shadow defence minister, Julian Lewis, who was exposed by the Campaign Against the Arms Trade of spying for the arms firm BAE.

Until Leeming left the police in 2001, he admits he regularly infiltrated undercover operatives into protest groups in his role as head of the Animal Rights National index. But he insists Global Open does not infiltrate activist groups. He told the Guardian the company only advises firms on security. However, Global Open appears to have access to well-sourced intelligence.

A confidential document produced by Global Open for another company interested in plans to attack the E.ON-owned power station at Kingsnorth in Kent dismissed the idea there would be violence.

"The aim of the protests is to cause economic damage to ensure that the cost of building more coal-fired power plants becomes prohibitive," it stated. "There is no threat of violence to persons from any of the groups concerned, despite newspaper reports to the contrary."

Leeming told the Guardian the company had never employed Kennedy. He did, however, confirm that Tokra was set up for a "reason" but he could not say what it was – only that it was a confidential matter between Kennedy and Millgate. Today, Millgate declined to comment when asked why Tokra had been set up.

Leeming added that Millgate left Global Open last year on good terms because she wanted to set up her own business. A flurry of official paperwork followed.

In February last year, Millgate went from being a marketing manager to a director of Global Open. On 31 March, Tokra changed its address from Millgate's work address to one in Basingstoke.

Last spring, Kennedy set up a second firm – Black Star High Access Limited – in east London. That company name also appears to have been taken from a television science fiction programme: Black Star is the name of a spaceship in Babylon 5.

On 12 April, Kennedy applied for Tokra to be dissolved. Within a few days of that application, he resigned from the police. Tokra was finally dissolved on the 17 August. On 31 August, Millgate resigned as director of Global Open. Black Star High Access has not yet filed any records to reveal whether it is a viable, financial concern, but it is still active.

Another friend of Kennedy said the implication he went on to work for private security firms "fits perfectly" with his behaviour. Kennedy was becoming agitated and, unusually for someone who earned the nickname "Flash" for his impressive wealth, he started running out of money around the time he resigned.

"He asked to borrow money – and that was after we now know he resigned from the Met," the friend said.

But if Kennedy was seeking to use the fake identity provided by police to continue his life as a spy, there was one crucial obstacle: he would almost certainly have had to hand in his fake driving licence and passport, meaning he would need to travel abroad under his real name.

This explains why, after maintaining his cover for seven years, he made such an amateur error of allowing friends to find his real passport, bearing the name Kennedy. "Mark must have known he had a ticking timebomb in his pocket when he travelled abroad," the friend said.

His curious activities in Italy recently also point clearly to his having obtained a new employer. In September, Kennedy – a meat eater who had never previously shown an interest in animal rights campaigns – confounded friends by attending a gathering of interested activists in Milan.

Alex Long, a former member of the Wombles, an anti-capitalist group, received his last contact from Kennedy around this time, after sending him a text message to raise funds for the legal campaign for a fellow activist.

"The last time I spoke to Mark was in September 2010, a few weeks before he was outed," said Long. "I texted him to try to raise money for the legal costs of a friend who is facing jail. He just replied: 'I'm in Milan at an animal rights gathering – I'll donate €50'."