It is a glycoalkaloid that builds up in potato tubers that have been exposed to light (they turn green), in their sprouts and in their leaves. The leaves, stems and green fruit of tomato plants contain a similar one, tomatine. It tastes bitter and, in quantity, causes vomiting, diarrhoea and headache.
It does not disappear with cooking: cut away the green parts and sprouts from potatoes thoroughly and throw out any that are very green or taste bitter.

