Green (sunburned) potatoes, sprouts, leaves and stems contain solanine. Cooked, peeled potato flesh is safe.
Like tomatoes, potatoes are a nightshade and accumulate toxic glycoalkaloids in green or sprouting tubers and above-ground parts.
Solanine and chaconine are concentrated in green skin, eyes (sprouts) and plant tops. They disrupt cell membranes and inhibit cholinesterase, affecting the GI tract and nervous system. Cooking does not reliably destroy these toxins.
Fuentes
Discard any potato that has green skin or active sprouts. Cooked, white-flesh potato in moderation is fine.