The “shining city on a hill” mantra of the Reagan years takes a beating in “White Boy Rick,” set in crumbling, mid-eighties Detroit. The fact-based movie by Yann Demange (“’71”) portrays a perversion of the system of law and justice connected with the so-called war on drugs in which a teenager was intimidated into becoming an informant and wound up being sentenced to life imprisonment. That’s not to say that the kid was an innocent victim (though the script minimizes his criminality); but the argument of Demange’s film is that his manipulation by the local police and the FBI was as responsible for what he became as his admittedly unpromising domestic situation—and that in the end the authorities washed their hands of him when it suited their purposes.

Newcomer Richie Merritt plays, quite convincingly, Rick Wershe, who’s introduced at age fourteen acting pretty much at a shill for his father, Rick Sr. (Matthew McConaughey, typically intense and totally invested in the role) at a gun show. The old man deals in out-of-the-trunk sales of guns, and he and the boy con a testy seller into giving them a couple of AK-47s at a bargain-basement price. He then outfits them with home-made silencers and sends his son out to sell them at a hefty profit to Johnny Curry (Jonathan Majors), head of a local drug gang. Young Rick makes the sale, and Johnny is impressed by his chutzpah; soon he’s the sole white member of the Curry crew, seduced by the gangster glamour—and the cash.

That disturbs his father, who wants him to stay in school. Rick Sr. dreams of using his profits to set up a video store that will mushroom into a whole chain of them, and doesn’t want the kid getting into serious trouble. He also has to deal with Rick’s sister Dawn (Bel Powley), a junkie literally in bed with a bad guy, and his own excitable dad Ray (Bruce Dern), who lives across the street with his long-suffering wife Vera (Piper Laurie).

But Rick Sr. is the card that the cops can use to force the younger Wershe to become their patsy. By threatening to send his father to prison on weapons charges, two FBI agents (Jennifer Jason Leigh and Rory Cochrane) and a local cop (Brian Tyree Henry) persuade him to buy and sell drugs so they can arrest suppliers and customers, and then play on his connections with Curry in the hope of eventually working their way up to the corrupt city officials in league with him.

The operation goes sour, however, when young Rick is shot by a trusted member of the Curry crew after he’s suspected of being unreliable. After a long recovery he suggests to his father that they make use of his knowledge of the drug trade to go into business with a local kingpin (Eddie Marsan). They’re quite a success—the bling-addicted kid even has a fling with Curry’s seductive wife—but ultimately fall afoul of the authorities again, and despite the FBI’s assurances that they’ll intervene to mitigate Rick’s sentence in return for his cooperation against higher-ups, their promises prove empty. Under Michigan he receives a mandatory life sentence. The final crawls indicate that he was eventually paroled in 2017 after three decades behind bars; but he remains in prison, now in Florida, on separate charges.

While adhering to the basic facts of Wershe’s case (though not always presenting them with absolute clarity), “White Boy Rick” casts them as much as possible to portray him as a pawn of a system that chews up and spits out informants as young as teens in an effort to secure convictions of bigger fish. In addition to airbrushing details of the Wershe family history, it sentimentalizes certain aspects of it. It spends considerable time, for example, on both Ricks’ desperate efforts to get Dawn clean; Powley plays the withdrawal scenes powerfully, but the overall effect is to make the family dynamic more supportive. Even more obvious along these lines is the subplot involving young Rick’s fathering of a child with a black girl. The entire sequence is played with a degree of coyness, down to the “ain’t he cute” portrayal of the girl’s little brother and the bait-and-switch reaction of the older Rick, that comes across as contrived. The final scenes of the family visiting Rick in prison are conventionally manipulative, too.

Such moments are especially noticeable when contrasted with the grittiness of the rest of the picture. The locations (with the exception of a few scenes set in tony homes and Las Vegas casinos) have the grimy, gloomy look of a city in the last throes of devastation and despair, and cinematographer Tat Radcliffe uses darkness and shadow to accentuate the dankness. Production designer Stefania Cella and costumer Amy Westcott also deserve credit for their contributions to the desolate period ambience.

The performances help as well. The laid-back approach of Merritt contrasts nicely with the more extravagant work of McConaughey, and Powley’s attention-grabbing turn adds an extra layer to the mix. The supporting cast isn’t given much opportunity to stand out (RJ Cyler is nearly anonymous here, and while Majors has a few choice moments, both Leigh and Cochrane are little more than pro forma), but expectedly, Dern grabs every chance he has to show off, and Laurie complements him nicely with her understatement.

“White Boy Rick” has a potent message about how the drive to fight crime can lead to questionable tactics and miscarriages of justice, but it rather stacks the deck in delivering it. Still, it’s a docu-drama, not a documentary, and so long as one keeps that in mind, it’s a reasonably compelling cautionary tale.