Secondary piperidines are ideal pharmaceutical building blocks owing to the prevalence of piperidines in commercial drugs. Here, we report an electrochemical method for cyanation of the heterocycle adjacent to nitrogen without requiring protection or substitution of the N–H bond. The reaction utilizes ABNO (9-azabicyclononane N-oxyl) as a catalytic mediator. Electrochemical oxidation of ABNO generates the corresponding oxoammonium species, which promotes dehydrogenation of the 2° piperidine to the cyclic imine, followed by addition of cyanide. The low-potential, mediated electrolysis process is compatible with a wide range of heterocyclic and oxidatively sensitive substituents on the piperidine ring and enables synthesis of unnatural amino acids.