LONDON — They were two bright, idealistic young people who believed passionately in prison rehabilitation and threw themselves into a program that educates inmates, aiming to give them hope and reduce their odds of reoffending.

On Friday, a celebration of that program became the tragic last act of their lives. Both recent Cambridge University graduates, they then became victims of a murderous rampage by a former prisoner, an alumnus of the very program they had dedicated themselves to.

The two victims — Saskia Jones, 23, and Jack Merritt, 25 — died and three others were injured in what the police have called a terrorist attack in central London. The episode seized the nation’s attention and raised tough questions about the rehabilitation system they were so devoted to, and about Britain’s criminal sentencing, prison release and post-release supervision.