Erik Jensen was doing time at Clinton Correctional Facility, a high-security prison in upstate New York, for a parole violation on an armed robbery conviction in 2011 when a riot popped off in the yard. Jensen’s time was almost up and he didn’t want any problems, but the guards couldn’t care less. Anybody on the yard was fair game. The hacks beat up inmates randomly, in Jensen’s telling, and he got it bad. He recalls the officers stomped out his front teeth, zip-tied his hands together and spit chewing tobacco on him.

The dehumanizing moment — Jensen remembers feeling like he was going to die — led to a realization: He could go nowhere but up. The Astoria, Queens, native was at the end of a 30-year downward spiral.

But now he’s hobnobbing with the Hollywood elite, acting and advising a new Showtime series backed by Ben Stiller, with more doors opening for him. And it’s all because of his vivid storytelling ability, as Jensen lets the world know what life is really like on the inside. He recognizes that his prison knowledge got him in the door, but Jensen, after a lifetime of searching, has much more to offer.

It’s not just doing time; you have to survive. It’s brutal and rough.

As a kid, Jensen ran away from home often, growing up with an abusive, alcoholic single mother. He became an emancipated minor at 16. “Erik’s battled a lot of demons in his life and has overcome them all,” says William Zuluaga, who’s known Jensen for more than 20 years. Zuluaga, who comes from a similarly rough background, taught a teenage Erik to cut hair at Razorsharp, a barbershop in Poughkeepsie.

At 17, Erik ended up in the juvenile justice system, and after spending a total of 12 years inside the belly of the beast, he was ready to break the cycle of crime and drugs. He’d dabbled as a rapper and cut hair in and out of prison, but Jensen wanted more. In truth, he wasn’t really sure what direction his life would go, but after being released in March 2013, he discovered that one of his good friends, Samuel Harrell, was beaten to death at Fishkill Correctional Facility by 20 correctional officers.

The killing — for which the officers were not charged, as federal prosecutors cited insufficient evidence — along with the violence he’d suffered himself motivated Jensen to start advocating for prisoners. He organized protests, started reaching out to different journalists and even did some writing of his own. But it wasn’t until two convicts escaped from Clinton in 2015 and became national news that Erik took center stage.

“When the escape happened, everybody was wondering how this could happen,” Jensen says. “But this level of corruption had been there since Day One.” Jensen knew all the players involved, from the staff to the guards to the two escaped prisoners, Richard Matt and David Sweat. Frustrated with watching ill-informed speculation on TV, Jensen reached out to a CBS News reporter. The next day, the New York Post called. Soon it was CNN with Anderson Cooper, Wolf Blitzer and Brooke Baldwin; 20/20, Nightline and Dateline on ABC — more than 100 interviews in all.

Impressed with Jensen’s knowledgeable perspective on CNN, writer Brett Johnson, whose TV credits include Mad Men and Ray Donovan, contacted him on Twitter. “I knew this prison was unlike any other and I hoped Erik would be willing to talk to me to help understand the inner workings of the place,” Johnson says. “But after spending a few minutes on the phone, I realized Erik would be so much more valuable than as simply a resource for research.”

That was the beginning of what became Escape at Dannemora, the Stiller-directed series starring Benicio Del Toro and Paul Dano as the Clinton convicts. It debuts November 18 on Showtime. Jensen is an actor in the series, as well as a consultant and technical adviser, working on everything from props to wardrobe to tattoos to hair and makeup. While films like The Shawshank Redemption and shows like Oz were fiction, Escape at Dannemora is based on actual events — requiring Jensen’s touch for realism. Jensen cast ex-cons and wrote scenes based off memories of real things that happened in Clinton.

Jensen says he worked with Johnson and co-creator Michael Tolkin (Deep Impact, The Player) on the script for 15 months before Stiller came aboard. Now comes the question of whether it’s one break after a lifetime of the wrong kind of luck, or the start of something sustainable. “Going forward, it’s a question of luck — as it always is in Hollywood, for better or worse — and of Erik’s ability to put himself out there in as many environments and projects as he can,” says Nicky Weinstock, head of film at Red Hour, Stiller’s production company. “The ability to come through incarceration and emerge with ambition instead of resentment, with humble hard work instead of rage, is pretty miraculous and genuinely powerful in the world of entertainment.”

After spending his twenties committing crimes, doing drugs and living behind bars — when he wasn’t cutting hair — Jensen “effortlessly slid into a role where he was helping and advising a major Hollywood production,” Johnson says. Jensen says he wasn’t intimidated, even when helping someone like the Oscar-winning Del Toro with character development. “It’s kind of like you see a piece of yourself in their talent,” he says.

The biggest change for Jensen was that from Stiller on down: “They trusted me.” He had not been entrusted with much of anything, going back to childhood. Now it’s coming in waves. NBC’s The Blacklist recently hired him as a technical adviser, and Jensen has more projects in the works.

Jensen, who has three children but never married, feels everything in his life has led up to this point. “I’m not saying I want to go do it again,” he clarifies. “Because one day in prison for anybody is too much. It’s not just doing time; you have to survive. It’s brutal and rough.” But now that the trials are done, he can hold up a window to his former world — and make sure TV gets it right on his watch.