What prevents the anode from corroding in electrolytic organic reactions?
One would control the composition of the electrodes (mercury, platinum, Ebonex, boron-doped diamond coating) and the potential of the cell so that the organic reaction went forward while the electrodes remained inert.

Metal oxidation is facilitated by Lewis base ligands that drive reaction by stabilizing the ionic products.  Don't have them in there.