The toxin is named phytohemagglutinin (PHA), a member of a very common class of proteins called lectins. Lectins are glycoproteins that are present in a wide variety commonly-consumed plant foods, particularly in the seeds. In most cases, they are not harmful and possibly beneficial, but some lectins are known to be toxic. One of the most dangerous poisons known, ricin, is a lectin derived from the seeds of the castor bean Ricinus communis (not a true bean and totally unrelated to the legume family Fabaceae); this is not, however, the same lectin found in beans and other legumes.
PHA is known to be an insecticide, and plants probably developed it to keep their seeds from being destroyed by pests. In humans and other susceptible mammals (those of us without compound stomachs) PHA attacks and disables the epithelial cells lining the intestine. The body reacts to the threat by emptying the entire digestive tract as rapidly and completely as possible, to rid itself of the toxic substance. This is accomplished by means of severe vomiting and diarrhea. Usually, the reaction subsides without the need for medical intervention after several miserable hours, though some persons may require IV replacement of fluids because of dehydration. But because food poisoning can come from many different sources, some of them fatal, seeking medical help is advisable when its symptoms occur.
This reaction to kidney beans is not very common because the beans are not often eaten raw. They are usually dried and require several hours of cooking before they are soft enough to eat. PHA in beans is deactivated and reduced to safe levels by as little as ten minutes of boiling. Other means of heating are less effective and may actually increase the level of PHA, as will heating below the boiling point. For this reason, such foods as chili should not be made with kidney beans in a slow cooker at the low setting without first boiling the beans.
For the safest results in cooking dried kidney beans, they should first be soaked for several hours, the soaking water discarded, then brought to the boil in fresh water and cooked for at least ten minutes.
Red kidney beans (Phaseolus vulgaris) have by far the highest concentrations of PHA. The white variety known as cannellini has only about a third of the level of the red kidney beans, but still enough to cause problems if not properly cooked. Kidney beans should never be sprouted for use in salads, and it is not likely that stir-frying kidney bean sprouts is safe, either. The presence of PHA is not, however, limited to beans of the species P vulgaris. It has also been found in significant levels in fava beans (Vicia faba).
Lima beans (Phaseolus lunatus) can also be quite dangerous when consumed raw, but in this case the culprit is a different toxin altogether: linamarin, a cyanogenic glucoside. This is the same toxic substance found in cassava root.
Individuals vary in their sensitivity to PHA, so it is probably a good idea when cooking to treat all dried beans as if they were kidney beans, and to cook fresh mature beans (shellie beans) at least long enough to deactivate the toxin. Gardeners, in particular, should be a aware of the potential dangers of raw beans if they like to "graze" in their gardens, eating the fresh raw seeds directly from the shell. The level of PHA in all varieties is not known.
Green beans (snap beans) are a questionable matter. Many people do like to eat young green beans raw, and overcooking green beans until mushy is widely regarded as a sin against the vegetable. I can find no clear evidence that raw green beans have PHA levels high enough to make them unsafe for most of the population. It should be noted that the level of PHA is highest in seeds, and green beans are usually consumed for the sake of the green fleshy pod, at a stage when the seeds are only beginning to develop. And they do taste so good that I'm likely to take the chance.
Photo Credit: Kidney Beans http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License