Arion Kurtaj, who hacked the maker of Grand Theft Auto and other companies, was sentenced to seven years in prison and released on licence on the same day. The judge warned him: “Don't let this happen again.”

Kurtaj, 21, from Oxford, pleaded guilty last Monday at Woolwich Crown Court to hacking Rockstar Games and several other targets. He carried out the attacks at 16 and 17 with the hacking gang Lapsus$.

He was first sentenced to an indefinite stay in a secure hospital because of the severity of his autism. After being deemed fit to stand trial, he was moved to a normal prison in January. The judge later considered his time in hospital and on remand long enough to release him when sentencing him.

Kurtaj has also been given a Serious Crime Prevention Order lasting five years. It restricts his online activity, including by barring him from using Telegram and Discord. City of London Police said the case “highlights the dangers that young people can end up being drawn to online”.

While on bail and under police protection at a Travelodge in Bicester, Kurtaj hacked Rockstar, Revolut and Uber. He was being protected from rival hackers who had threatened to attack him over his stolen stashes of Bitcoin.

With his computer confiscated, he accessed Rockstar's systems using an Amazon Fire Stick connected to the television in his hotel room, along with a Bluetooth keyboard and mouse. He stole internal data, including 90 clips showing nearly 60 minutes of gameplay from the unfinished GTA 6, then broke into the company's internal Slack messaging system.

“If Rockstar does not contact me on Telegram within 24 hours I will start releasing the source code,” he wrote. Rockstar refused to co-operate, so he posted the clips and source code on a forum using the username TeaPotUberHacker.

Rockstar Games said recovering from the hack cost $5m (£3.8m), as well as thousands of hours of staff time. The breach also revealed for the first time that one of the game's playable characters was a woman, a secret the company had closely guarded for marketing purposes.

At sentencing, Kurtaj stood and smiled. He had short hair, an unkempt beard and wore a suit with a buttoned-up white shirt and no tie. He blinked frequently during the hearing.

Judge Mr Justice Turner told him: “you are a very talented young man,” before repeating his warning: “Don't let this happen again.”

Kurtaj's defence team said he found the online world a more comfortable way to interact with other people. “The restricted and repetitive patterns of behaviour and interests that are a core feature of ASD [autism spectrum disorder] led him to become preoccupied with the online world where he felt better able to function and exist,” they said.

They said he was exposed first to people who showed him how to cheat at games and then to “people who were involved in hacking”. During the pandemic, he was “very isolated” and his “connection to Lapsus$ provided him with a sense of community and self-worth that had been absent in his life previously,” they added.

Kurtaj and other Lapsus$ members used social engineering to hack BT/EE, Revolut and Uber, tricking people into clicking malicious links or revealing sensitive information to gain access to internal systems. The court previously heard that during the Uber hack he posted a picture of a penis while trying to force the company to pay a ransom.

The hacks are estimated to have caused about £10m in damage. Using data stolen from the companies, Kurtaj and other gang members targeted cryptocurrency investors. Prosecutors argued the gang stole at least $300,000 (£230,000) from individual victims.

Kurtaj also pleaded guilty to physically assaulting workers while in custody, including multiple biting incidents. In prison, he was caught with a mobile phone after sending police a taunting text message and posting updates on Snapchat.